Framework
Framework
Framework
aria-labelledbystringoptionsreadonly Option[]disabled?booleanfalseinvalid?booleanfalsename?stringonChange?(value: string, event: ChangeEvent<HTMLInputElement>) => voidref?Ref<HTMLDivElement>value?string| Prop | Type | Default |
|---|---|---|
aria-labelledby | string | - |
options | readonly Option[] | - |
disabled? | boolean | false |
invalid? | boolean | false |
name? | string | - |
onChange? | (value: string, event: ChangeEvent<HTMLInputElement>) => void | - |
ref? | Ref<HTMLDivElement> | - |
value? |
string| - |
import { Radio } from '@k8ordo/ui';import { Radio } from '@k8ordo/ui';
const options = [
{ label: 'React', value: 'react' },
{ label: 'Vue', value: 'vue' },
{ label: 'Svelte', value: 'svelte' },
];
<p id="radio-label">Framework</p>
<Radio
defaultValue="vue"
disabled={false}
aria-labelledby="radio-label"
options={options}
/>const [value, setValue] = useState('react');
<p id="radio-controlled-label">Framework</p>
<Radio
disabled={false}
aria-labelledby="radio-controlled-label"
onChange={(value) => setValue(value)}
options={options}
value={value}
/><p id="radio-disabled-label">Framework</p>
<Radio
defaultValue="vue"
disabled
aria-labelledby="radio-disabled-label"
options={options}
/>