structyl

Radio Group API

View component

The full prop reference for the Radio Group component. A set of checkable buttons where only one can be checked at a time.

Import

tsx
import { RadioGroup } from '@structyl/styled';

Props

Root

Container for radio group with managed state and keyboard navigation

PropTypeDefault
value#string

Controlled value of the selected radio item

defaultValue#string

Uncontrolled default value for the selected radio item

onValueChange#(value: string) => void

Callback fired when selected value changes

disabled#boolean

Disables all items in the group

false
required#boolean

Makes selection required for form submission

false
name#string

Name attribute for hidden input elements (for form submission)

orientation#'horizontal' | 'vertical'

Layout direction for keyboard navigation

'vertical'
dir#'ltr' | 'rtl'

Text direction for keyboard navigation behavior

loop#boolean

Whether keyboard focus wraps around to opposite end

true
asChild#boolean

Render as child component (merge props with single child)

className#string

CSS class name (styled version adds default grid layout)

Item

Individual radio button option (styled version with color support)

PropTypeDefault
value#string

Unique value for this radio option (required)

disabled#boolean

Disables this individual radio item

asChild#boolean

Render as child component (merge props with single child)

color#'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success'

Styled-layer only: color theme for border and indicator

'primary'
className#string

CSS class name (styled version applies 4x4 h-4 w-4 default)

Indicator

Visual indicator shown when radio item is checked (primitives only)

PropTypeDefault
forceMount#boolean

Mount indicator regardless of checked state (useful for animations)

asChild#boolean

Render as child component (merge props with single child)

className#string

CSS class name

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library