Skip to content

Radio

const Radio: <T>(props) => Element;

Single-select radio group with keyboard navigation.

Navigate items with ↑/↓ (or j/k), select with Space or Enter. Supports both horizontal and vertical layout via direction.

Type ParameterDefault type
Tstring
ParameterType
propsRadioProps<T> & RefAttributes<RadioHandle<T>>

Element

const [size, setSize] = useState<string>();
<Radio
items={[
{ label: "Small", value: "sm" },
{ label: "Medium", value: "md" },
{ label: "Large", value: "lg" },
]}
value={size}
onChange={setSize}
/>

Type ParameterDefault type
Tstring
PropertyTypeDescription
direction?"row" | "column"Layout direction (default: “column”)
disabled?booleanWhether the entire group is disabled
focusedItemStyle?StyleStyle for the focused item
gap?numberGap between items (default: 0)
itemsRadioItem<T>[]Radio options
itemStyle?StyleStyle for each radio item
onChange(value) => voidCalled when selection changes
selectedChar?stringCustom character for selected state (default: ”(●)”)
selectedItemStyle?StyleStyle for the selected item
style?StyleStyle for the radio group container
unselectedChar?stringCustom character for unselected state (default: ”(○)”)
valueT | undefinedCurrently selected value

A single option inside a Radio group.

Type ParameterDefault type
Tstring
PropertyTypeDescription
disabled?booleanWhether this option is disabled
labelstringDisplay label
valueTValue returned on selection

Handle for Radio — exposes selected value

Type ParameterDefault type
Tstring
blur(): void;

Programmatically blur (unfocus) this element

void

FocusableHandle.blur


focus(): void;

Programmatically focus this element

void

FocusableHandle.focus


scrollIntoView(options?): void;

Scroll the nearest parent ScrollView to make this element visible. Behaves like the DOM Element.scrollIntoView() method. No-op if the element is not inside a ScrollView.

ParameterTypeDescription
options?ScrollIntoViewOptionsAlignment options (default: { block: "nearest" })

void

const inputRef = useRef<InputHandle>(null);
// Minimal scroll — just enough to make it visible
inputRef.current?.scrollIntoView();
// Center the element in the viewport
inputRef.current?.scrollIntoView({ block: "center" });

FocusableHandle.scrollIntoView

PropertyModifierTypeDescriptionInherited from
isFocusedreadonlybooleanWhether this element is currently focusedFocusableHandle.isFocused
valuereadonlyT | undefinedCurrently selected value-