Component docs
Loading
"use client";
import { RadioGroup } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
options (required) | readonly ChoiceOption<Value>[] | — | Options to choose from. |
defaultValue | Value | null | none | Checked value when uncontrolled (default: none). |
disabled | boolean | — | Disables interaction. |
name | string | a generated one | Form field name (default: a generated one). |
onValueChange | (value: Value) => void | — | Called with the new value (only when it changes). |
orientation | "horizontal" | "vertical" | — | Layout and arrow-key axis. |
value | Value | null | — | Checked value (controlled); null for none. |
optionsrequiredreadonly ChoiceOption<Value>[]
Options to choose from.
defaultValuedefault noneValue | null
Checked value when uncontrolled (default: none).
disabledboolean
Disables interaction.
namedefault a generated onestring
Form field name (default: a generated one).
onValueChange(value: Value) => void
Called with the new value (only when it changes).
orientation"horizontal" | "vertical"
Layout and arrow-key axis.
valueValue | null
Checked value (controlled); null for none.
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
const options = [
{ label: "candraw", value: "candraw" },
{ label: "cantext", value: "cantext" },
];
<RadioGroup options={options} />