Components

Radio

Selects one option in a named group of choices.

tsx
import Radio from '@precursor/radio';

Example

tsx
import Radio from '@precursor/radio';

export default function Example() {
    return (
        <>
            <Radio label="Light" name="mode" />
            <Radio label="Dark" name="mode" />
        </>
    );
}

Props

Radio props
PropTypeDefaultNotes
labelRequiredstring——
size"s" | "m" | "l"'m'—
classNamestring——
aria-describedbystring——
aria-invalidboolean——
disabledboolean——
idstring——
nameRequiredstring——
typeInputTypes——
defaultValuestring——
valuestring——
checkedboolean——
state"success" | "error" | "warning"——
onChangeChangeEventHandler<HTMLInputElement>——