> ## Documentation Index
> Fetch the complete documentation index at: https://help.standards.site/llms.txt
> Use this file to discover all available pages before exploring further.

# States

A **state** is a named condition an element can be in. Many elements in Standards respond to viewer interaction, and each of those conditions can be styled.

<Frame>
  <img src="https://mintcdn.com/standards/eseM9UR4fUkc6IS3/images/states-button-edit-1.gif?s=3522e05e80c3b7c5a7c14653e276d5d7" alt="States Button Edit 1" width="1210" height="678" data-path="images/states-button-edit-1.gif" />
</Frame>

***

## Basics

* States are **mutually exclusive**: an element is in one state at a time
* Editing a state changes how the element looks in that condition **everywhere it appears**
* States can be **synced** (share styling) or **overridden** individually

### Elements with states

Common elements that have states include:

* **Button**: Rest, Hover, Active, Active / Hover
* **Toggle button**: Rest, Hover, Active, Active / Hover
* **Dropdown**: Closed, Open
* **Menu**: Closed, Open
* **Menu controls**: Rest, Hover
* **Search**: Rest, Searching
* **Search input**: Rest, Hover, Loading, Focused, Focused / Hover
* **Search result**: Rest, Hover
* **Input text**: Rest, Hover, Focused, Focused / Hover
* **Thumbnail**: one state per result category, called **formats** rather than states

The available states depend on the element and how it's configured. Some states only become available in certain setups. For example, a button's **Active** state applies when the button links to a page, and a toggle button's applies when it controls the slide currently showing. States that combine two conditions, like **Active / Hover**, let you style the overlap directly.

***

## Switching states

<Frame>
  <img src="https://mintcdn.com/standards/eseM9UR4fUkc6IS3/images/states-switching-state.png?fit=max&auto=format&n=eseM9UR4fUkc6IS3&q=85&s=00eee94b6b6681d312b94cb956254592" alt="States Switching State" width="1200" height="600" data-path="images/states-switching-state.png" />
</Frame>

<Steps>
  <Step title="Select an element with states">
    Select an element such as a **button**, **dropdown**, or **search**.
  </Step>

  <Step title="Choose the state">
    In the contextual toolbar, select the **state** dropdown, then select available states. States that aren't currently available are greyed out, with a tooltip explaining why. Alternatively, select the state dropdown from the right settings bar.
  </Step>

  <Step title="Choose a state">
    Select a state to switch the element into it on the canvas. Paired elements stay in sync, so switching a control to **Open** also opens its menu or dropdown.
  </Step>
</Steps>

<Info>
  **Note:** If an element has fewer than two available states, no state switcher is shown.
</Info>

***

## The state editor

The state editor opens an overlay that shows every state of an element side by side, so you can style and compare them at once.

<Frame>
  <img src="https://mintcdn.com/standards/eseM9UR4fUkc6IS3/images/states-editor.png?fit=max&auto=format&n=eseM9UR4fUkc6IS3&q=85&s=d6db31297260fe19dabab147004661cf" alt="States Editor" width="1200" height="600" data-path="images/states-editor.png" />
</Frame>

<Steps>
  <Step title="Select the element">
    Select the element you want to edit, such as a button or dropdown.
  </Step>

  <Step title="Open the editor">
    In the right sidebar **State** settings group (or from the state switcher menu), select **Edit states**. The overlay opens with a panel for each available state.
  </Step>

  <Step title="Style each state">
    Select elements inside a panel and adjust their settings as normal. Changes apply to that state only. You can multi select to edit multiple at once by holding <kbd>shift</kbd> + clicking.
  </Step>

  <Step title="Finish">
    Select **Done** (or press <kbd>esc</kbd>) to close the overlay and return to the canvas.
  </Step>
</Steps>

### Editor options

* **Move and resize**: drag the overlay by its header to reposition it, or drag its edges and corner to resize. The panels reflow to fit the width available.
* **Full screen**: the expand icon in the header fills the canvas with the editor, which helps when an element has several states. Selecting it again returns to the floating panel.
* **Light / dark**: the theme icon switches the overlay between light and dark, so you can check a design in both. This affects the overlay only, not the rest of the editor, and it's remembered per element — an element you've switched opens in that mode next time, while elements you haven't follow the editor's appearance setting.

<Info>
  **Note:** States that can't currently apply, such as a button's **Active** with no page link, are left out of the editor entirely. The state switcher still lists them, greyed out with an explanation.
</Info>

***

## Overrides and resetting

<Frame>
  <img src="https://mintcdn.com/standards/eseM9UR4fUkc6IS3/images/states-reset.png?fit=max&auto=format&n=eseM9UR4fUkc6IS3&q=85&s=bc18262e03a3ec56ec5ee7f2c7a593a9" alt="States Reset" width="1200" height="600" data-path="images/states-reset.png" />
</Frame>

By default, a state inherits its styling from the element's default state. When you change a setting for a specific state, it becomes an **override** for that state only.

* A blue dot appears next to states that have overrides differing from the default
* To clear a state's overrides and return it to the default styling, select the blue **reset** icon in the **State** settings group title while that state is active

<Info>
  **Tip:** Style the default state first to get the shared look right, then switch into other states to add only the differences, like a color or scale change on hover.
</Info>

### What varies per state

An element's own parts vary per state: a button's text and icon, a menu's logos and controls, a result row's thumbnail and details. Content you add yourself inside a [menu](/menus) or dropdown is styled once and looks the same in every state of its container, which keeps a menu's contents from silently diverging between its Closed and Open states.

A menu's logo and controls are the exception worth knowing: they aren't one element styled per state but **pairs** of elements, one per state, so each is edited directly. See [Native elements](/menus#native-elements).
