Skip to content

RadioGroup

Picks one value from a small set of options.

Visibility
RadioGroup.tsx
import {RadioGroup, RadioGroupItem} from 'alinea/components'

export function RadioGroupExample() {
  return (
    <RadioGroup label="Visibility" defaultValue="public">
      <RadioGroupItem value="public">Public</RadioGroupItem>
      <RadioGroupItem value="unlisted">Unlisted</RadioGroupItem>
      <RadioGroupItem value="private">Private</RadioGroupItem>
    </RadioGroup>
  )
}

Props

<RadioGroup>

PropTypeDefaultDescription
valuestringDefault –
defaultValuestringDefault –
onValueChange(value: string) => voidDefault –
orientationOrientationDefault 'vertical'
namestringDefault –
labelReactNodeDefault –
descriptionReactNodeDefault –
errorReactNodeDefault –
requiredbooleanDefault –
disabledbooleanDefault –
readOnlybooleanDefault –
iconIconType | ReactElementDefault –
sharedbooleanDefault –Marks the field as shared between translations

Also accepts className and style, id and aria-* labelling attributes and data-* attributes.

<RadioGroupItem>

PropTypeDefaultDescription
value*stringDefault –
disabledbooleanDefault –
autoFocusbooleanDefault –
descriptionReactNodeDefault –

Also accepts className and style, id and aria-* labelling attributes and data-* attributes.