Skip to main content

Radio

A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.

import {
Radio,
FormControlLabel
} from '@streamelements/frontend-ui';

// ...

<Radio.Root>
<FormControlLabel css={{ display: 'grid', mb: '0.5rem' }}>
<Radio.Item value="darko" />
Darko
</FormControlLabel>
<FormControlLabel css={{ display: 'grid', mb: '0.5rem' }}>
<Radio.Item value="jacob" />
Jacob
</FormControlLabel>
<FormControlLabel css={{ display: 'grid', mb: '0.5rem' }}>
<Radio.Item value="perry" />
Perry
</FormControlLabel>
<FormControlLabel css={{ display: 'grid', mb: '0.5rem' }}>
<Radio.Item value="Nuuls" disabled />
Nuuls
</FormControlLabel>
</Radio.Root>

API​

The Chip component exposes the following props for style changes:

Root​

Name

Type

Default value

Description

asChildbooleanfalse
Change the component to the HTML tag or custom component of the only child. Merges original props with provided child.
defaultValuestring–
The value of the radio item that should be checked when initially rendered. Use when using it as uncontrolled component.
valuestring–
The controlled value of the radio item to check. Should be used in conjunction withonValueChange.
onValueChangeFunction–
Event handler called when the value changes.
(value: string) => void
namestring–
The name of the group. Submitted with its owning form as part of a name/value pair.
requiredboolean–
When true, indicates that the user must check a radio item before the owning form can be submitted.
orientation"horizontal" | "vertical"undefined
The orientation of the component. When horizontal, left and right arrow select previous and next. When vertical, up and down arrows select the previous or next item.
dir"ltr" | "rtl"ltr
The reading direction of the radio group. If omitted, assumes LTR (left-to-right) reading mode.
loopbooleantrue
When true, keyboard navigation will loop from last item to first, and vice versa.

Item​

Name

Type

Default value

Description

cssCSS{}
Pass on additional styling utilizing Stitches' tokens
valuestring–
The controlled value of the radio item to check. Should be used in conjunction withonValueChange.
disabledboolean–
When true, prevents the user from interacting with the radio item.
requiredboolean–
When true, indicates that the user must check the radio item before the owning form can be submitted.