Best apple
API Reference
Props mirror Base UI React where applicable, adapted for Svelte 5. Native HTML attributes for the rendered element are also accepted unless noted.
Radio.Root
Represents the radio button itself. Renders a <span> element and a hidden <input> beside.
Props
Data attributes
| Attribute | Description |
|---|---|
data-checked | Present when the radio is checked. |
data-disabled | Present when the radio is disabled. |
data-unchecked | Present when the radio is not checked. |
Radio.Indicator
Indicates whether the radio button is selected. Renders a <span> element.
Props
Data attributes
| Attribute | Description |
|---|---|
data-checked | Present when the radio is checked. |
data-disabled | Present when the radio is disabled. |
data-unchecked | Present when the radio is not checked. |
RadioGroup
Extends div HTML attributes.
Props
defaultValue string —
- Name
defaultValue- Description
Uncontrolled initial value.
- Type
string
onValueChange function —
- Name
onValueChange- Description
Event handler called when the value changes.
- Type
((value: string, event: Event) => void) | undefined
Data attributes
| Attribute | Description |
|---|---|
data-disabled | Present when the part is disabled. |