Selection and input
RadioGroup
One choice out of a few, all visible at once.
iOSSwiftUI rows with a checkmarkAndroidCompose RadioButton rowsRenders in a Screen or an Island
Import
ts
import {RadioGroup} from '@hzblj/kara-ui'Props
A single choice from a list: rows with a checkmark on the selected one on iOS, Material radio buttons on Android. A native atom — it renders inside <Screen> or <Island>.
| Prop | Type | Description |
|---|---|---|
| options* | RadioOption[] | The choices, top to bottom. |
| value* | string | The selected option's |
| onValueChange | (value: string) => void | The user pressed an option; it passes that option's |
options*
RadioOption[]The choices, top to bottom.
value*
stringThe selected option's value. Update it from onValueChange.
onValueChange
(value: string) => voidThe user pressed an option; it passes that option's value.
RadioOption
One choice of a RadioGroup.
| Prop | Type | Description |
|---|---|---|
| label* | string | The option's text. |
| value* | string | Identifies the option to |
label*
stringThe option's text.
value*
stringIdentifies the option to value and onValueChange, and keys its row — keep it unique.
Platform notes
- Exactly one option is selected at all times. For an independent on/off, use
SwitchorCheckbox.