Skip to content

Radio

RadioGroup holds a set of Radio options. Use it when there are a few options and it helps to see them all; for more than five or so, use Select.

import { Radio, RadioGroup } from '@beyul/sulmu-ui'

Source · Figma

import { Radio, RadioGroup } from '@beyul/sulmu-ui'
export default function Example() {
return (
<RadioGroup aria-label="Priority" defaultValue="low">
<Radio value="low">Low</Radio>
<Radio value="medium">Medium</Radio>
<Radio value="high">High</Radio>
</RadioGroup>
)
}
import { Radio, RadioGroup } from '@beyul/sulmu-ui'
export default function Example() {
return (
<RadioGroup aria-label="Kind" defaultValue="internal" orientation="horizontal">
<Radio value="internal">Internal</Radio>
<Radio value="external">External</Radio>
<Radio value="partner" disabled>
Partner (disabled)
</Radio>
</RadioGroup>
)
}

Priority: medium

import { Radio, RadioGroup, Stack, Text } from '@beyul/sulmu-ui'
import { useState } from 'react'
export default function Example() {
const [value, setValue] = useState<string | null>('medium')
return (
<Stack gap={3}>
<RadioGroup
aria-label="Priority"
orientation="horizontal"
value={value}
onValueChange={(d) => setValue(d.value)}
>
<Radio value="low">Low</Radio>
<Radio value="medium">Medium</Radio>
<Radio value="high">High</Radio>
</RadioGroup>
<Text textStyle="caption" tone="subtle">
Priority: {value}
</Text>
</Stack>
)
}
PropTypeDefaultDescription
orientation"horizontal" | "vertical"verticalStack the options (vertical, default) or lay them out in a row (horizontal).
defaultValuestring | null-The initial value of the checked radio when rendered. Use when you don't need to control the value of the radio group.
valuestring | null-The controlled value of the radio group
namestring-The name of the input fields in the radio (Useful for form submission).
disabledboolean-If true, the radio group will be disabled
onValueChange((details: ValueChangeDetails) => void)-Function called once a radio is checked
PropTypeDefaultDescription
valuestring | null-The controlled value of the radio group
disabledboolean-If true, the radio group will be disabled

The remaining props of Ark UI’s RadioGroup parts are accepted too.

  • Give the group a name for assistive tech: an aria-label, or a Field label.
  • Arrow keys move the selection inside the group; Tab moves in and out of it.
  • Set name on the group to submit the selected value with a native form.