[Components](https://oods-foundry.com/components) / visual

# ColorStatePicker

Edits the color state of a visual encoding.

Generated from @oods/foundry 0.10.1

- Categories

  visual

- Contexts

  form

- Readiness

  `react-and-vue`

## Playground

This component's contract doesn't list typed props, so the playground shows its documented example.

Documented example `ColorStatePicker` : mount and declared input triggers, A labelled Select inside a fieldset edits only declared semantic color states and emits one string change; prop changes resynchronise local selection..

The render follows the page's theme switch: light, dark or high contrast. Both frameworks render the same example.

The real ColorStatePicker, live

React

Color state

Color state

Vue

Color state

Color state

Events it emits: change. Use either render above, and each event shows here with the framework that sent it.



## Code

The documented example. HTML is the markup the React component renders for it, which @oods/component-styles styles.

**React**

```
import { ColorStatePicker } from '@oods/components-react';
import '@oods/component-styles/css';

const colorStates = [
  "neutral",
  "success"
];

export function Example() {
  return (
    <ColorStatePicker
      colorStates={colorStates}
      value="neutral"
    />
  );
}
```

## Props, slots and events

Contract version 1.1.0. Types are from the React declarations in @oods/components-react.

Props

| Prop | Type | Required | Documented example |
| - | - | - | - |
| `title` | `string \| undefined` | no | |
| `colorStates` | `readonly string[] \| undefined` | no | `["neutral","success"]` |
| `value` | `string \| undefined` | no | `neutral` |
| `disabled` | `boolean \| undefined` | no | |

### Slots

none

### Events

change

## States

editing, disabled

## Accessibility

- Role

  `combobox`

- How it gets its name

  `label` on `select`

### Keyboard

Keyboard

| Key | What it does |
| - | - |
| `Tab` | Focus the labelled native field |

### Obligations in the contract

- Visible text explains the declared trait values
- Every native control has a visible label

A labelled Select inside a fieldset edits only declared semantic color states and emits one string change; prop changes resynchronise local selection.

## Tokens

The token roles this component reads.

- `surface.panel`
- `text.body`
- `focus.outer`

## Readiness

The evidence recorded for this component, with its label.

`react-and-vue`: catalog_list gives this label when the React and Vue components have complete readiness evidence, but the sweep's generated apps don't use the component in both.

Readiness evidence

| Evidence | React | Vue |
| - | - | - |
| state | implemented-evidence-complete | implemented-evidence-complete |
| versioned contract | passed | passed |
| target implementation | passed | passed |
| package export | passed | passed |
| public declaration | passed | passed |
| dependency closure | passed | passed |
| framework scenario | passed | passed |
| accessibility | verified | verified |
| interaction | verified | verified |
| visual themes | verified | verified |

## Use your own

You can replace this component with your own React or Vue component. Map it, and generated code imports yours at the exact version you name. A contract report, run in a real browser, lists what your component met, what it didn't, and what wasn't checked.

The `component_map` call, with the parts in angle brackets yours to fill:

```
{
  "action": "create",
  "apply": true,
  "externalSystem": "<your design system>",
  "externalComponent": "<YourColorStatePicker>",
  "oodsTraits": [
    "Colorized"
  ],
  "substitution": {
    "component": "ColorStatePicker",
    "react": {
      "package": "<your-package>/react",
      "version": "<exact version>",
      "export": "<YourColorStatePicker>"
    },
    "vue": {
      "package": "<your-package>/vue",
      "version": "<exact version>",
      "export": "<YourColorStatePicker>"
    }
  }
}
```

## How this page was made

Generated at build from the published data, each source with the hash of what was read. [The page's manifest](https://oods-foundry.com/components/color-state-picker/manifest.json).

- **Contract**: `@oods/component-contracts@0.10.1 componentContracts.ColorStatePicker` `sha256:2efabd0cc0a3…`
- **Documented example**: `@oods/component-contracts@0.10.1 sharedScenarios ColorStatePicker` `sha256:e8ab5e8009c7…`
- **Catalog entry (catalog_list)**: `generated/0.10.1/system/catalog.json ColorStatePicker` `sha256:c06a363e1075…`
- **React readiness**: `@oods/components-react@0.10.1 readiness ColorStatePicker` `sha256:d14797272f34…`
- **Vue readiness**: `@oods/components-vue@0.10.1 readiness ColorStatePicker` `sha256:b9a41a85a2d8…`
- **Prop types**: `generated/0.10.1/components/prop-types.json ColorStatePicker` `sha256:fd0abbee8e59…`
