# `<alta-choice-group>`

> One answer among a few, each with what it needs of the machine; an option the machine cannot take is greyed with its reason.

One answer among a few, each with what it needs of the machine; an option the machine cannot take is greyed with its reason.

[All components](https://docs.altasystem.ai/ui/components/)

## States

The closed list `data-state` takes on the element.

- <span id="state-idle"></span>`idle`
- <span id="state-picking"></span>`picking`
- <span id="state-picked"></span>`picked`
- <span id="state-locked"></span>`locked`

## Other attributes

On the element, or on a part (`part: attribute`). A list of values is closed.

| Attribute | On | Values |
|---|---|---|
| `data-columns` | the element | `1`, `2`, `3` |
| `data-state` | `choice` | `available`, `recommended`, `picked`, `dimmed`, `off` |
| `data-off` | `choice` | `resources`, `host`, `os`, `hosted` |
| `data-short` | `choice` | any |

## Events

Dispatched on the element, bubbling. Listen with `addEventListener`.

- <span id="event-alta-pick"></span>`alta-pick`
- <span id="event-alta-picked"></span>`alta-picked`
- <span id="event-alta-choice-off"></span>`alta-choice-off`

## Parts

Every node you can style, as `[data-part="…"]`.

`group` · `choice` · `medallion` · `choice-text` · `choice-label` · `choice-hint` · `choice-why` · `tag` · `tick` · `note`

## Slots

Children with `slot="…"` replace or add to these places.

`choice:<id>`

## Style it

```css
[data-aui="choice-group"][data-state="locked"] [data-part="group"] { /* … */ }
```

## Words it reads

Keys of the string tables (override them on `<alta-provider>`).

`choice.`

## Files

`packages/ui/src/elements/choice-group.ts` · `packages/ui/styles/components/forms.css`
