---
title: "StateChange"
---
<!-- DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/docs/website.rs -->

A state change, representing a transition of an entity into a new state.

Useful for representing discrete state machines, mode transitions, or
state changes over time. Each logged [`archetypes.StateChange`](https://rerun.io/docs/reference/types/archetypes/state_change) marks a new state
at the given time. A `null` state resets the state, showing a gap in the state timeline view.

The state timeline view displays these as horizontal colored lanes over time.

## Fields
### Required
* `state`: [`Text`](../components/text.md)


## Can be shown in
* [StateTimelineView](../views/state_timeline_view.md)
* [DataframeView](../views/dataframe_view.md)

## API reference links
 * 🌊 [C++ API docs for `StateChange`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1archetypes_1_1StateChange.html)
 * 🐍 [Python API docs for `StateChange`](https://ref.rerun.io/docs/python/stable/common/archetypes#rerun.archetypes.StateChange)
 * 🦀 [Rust API docs for `StateChange`](https://docs.rs/rerun/latest/rerun/archetypes/struct.StateChange.html)

## Example

### State changes over time

snippet: archetypes/state_change

<picture data-inline-viewer="snippets/archetypes/state_change">
  <source media="(max-width: 480px)" srcset="https://static.rerun.io/state_change/6654a13e984702b96547750469c368ce6e900c0f/480w.png">
  <source media="(max-width: 768px)" srcset="https://static.rerun.io/state_change/6654a13e984702b96547750469c368ce6e900c0f/768w.png">
  <source media="(max-width: 1024px)" srcset="https://static.rerun.io/state_change/6654a13e984702b96547750469c368ce6e900c0f/1024w.png">
  <source media="(max-width: 1200px)" srcset="https://static.rerun.io/state_change/6654a13e984702b96547750469c368ce6e900c0f/1200w.png">
  <img src="https://static.rerun.io/state_change/6654a13e984702b96547750469c368ce6e900c0f/full.png">
</picture>

