# ToggleGroup

Barra de botões que ficam apertados, para escolha que muda a vista na hora:
alinhamento, modo de exibicao, filtro rápido.

Com `toggleMultiple`, vira seleção múltipla.

## No React Native

Traduz: o `@rivocode/ui-native` exporta `ToggleGroup` - `items` na raiz; `multiple` para vários, o mesmo nome e o mesmo sentido do web. A API não é a mesma do web (no nativo tudo é controlado), e a [tabela de paridade](/react-native) diz o que muda peça a peça.

## Importação

```tsx
import { ToggleGroup } from '@rivocode/ui'
```

## Props

| Prop | Tipo | Obrigatória | Desde | O que faz |
| --- | --- | --- | --- | --- |
| `defaultValue` | `readonly string[]` |  | 0.4.0 | The pressed state of the toggle group represented by an array of the values of all pressed toggle buttons. |
| `disabled` | `boolean` |  | 0.4.0 | Whether the toggle group should ignore user interaction. |
| `loopFocus` | `boolean` |  | 0.4.0 | Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys. |
| `multiple` | `boolean` |  | 0.4.0 | When `false` only one item in the group can be pressed. |
| `onValueChange` | `((groupValue: string[], eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element \| undefined; }) => void)` |  | 0.4.0 | Callback fired when the pressed states of the toggle group changes. |
| `orientation` | `Orientation` |  | 0.4.0 |  |
| `render` | `ComponentRenderFn<HTMLProps, ToggleGroupState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` |  | 0.4.0 | Allows you to replace the component's HTML element with a different tag, or compose it with another component. |
| `value` | `readonly string[]` |  | 0.4.0 | The pressed state of the toggle group represented by an array of the values of all pressed toggle buttons. |

Além dessas: repassa `className`, `style`, `id` e os demais atributos do elemento raiz.

## Ver também

- [Button](/componentes/button.md)
- [ButtonGroup](/componentes/button-group.md)
- [Clipboard](/componentes/clipboard.md)
- [Toggle](/componentes/toggle.md)
- [Toolbar](/componentes/toolbar.md)
- [Convenções da biblioteca](/convencoes.md): Provider, tokens e as regras que valem para toda peça
- [Índice completo](/llms.txt)
