- Android
- iOS
- Web
Button Group
A Button Group component groups multiple buttons together for selecting from a set of related actions or options.
Example.tsx
| Name | Type | Default | Details |
|---|---|---|---|
| className | string | Optional | Supported Tailwind-style utilities, resolved entirely in Rust. See the engine README. |
| buttonClassName | string | Optional | Utility classes for each segment. |
| items | readonly T[] | Optional | Plain labels, item objects, or options with a string value. |
| selected | T | Selection<T> | Optional | The controlled selection. Option objects can be selected by value. |
| disabled | boolean | Optional | |
| onChange | ((value: Selection<T>) => void) | Optional | |
| keyExtractor | ((item: T, index: number) => Key) | Optional | Stable key for custom items. |
| renderButton | ((item: T, selected: boolean, index: number) => ReactNode) | Optional | Render the contents of a segment. |
| ariaLabel | string | Optional | |
| value | T | Selection<T> | Optional | Alias for selected. |
| defaultValue | Selection<T> | Optional | |
| onValueChange | ((value: Selection<T>) => void) | Optional | |
| getKey | ((item: T, index: number) => Key) | Optional | Alias for keyExtractor. |
| renderItem | ((item: T, index: number) => ReactNode) | Optional | Render segment contents without using the selected state. |
| size | string | number | Optional |