Radio Components
Examples
<script>
let radiooptions = [
{
id: 'country-option-1',
value: 'USA',
checked: true,
label: 'United States'
},
{
id: 'country-option-2',
label: 'Germany',
value: 'Germany'
},
{
id: 'country-option-3',
label: 'Spain (disabled)',
value: 'Spain',
disabled: true
}
];
let radioname='countries'
</script>
<Radio options={radiooptions} name={radioname}/>
Props
The component has the following props, type, and default values. See type-list page for type information.
Name | Type | Default |
---|---|---|
legend | string | '' |
divClass | string | 'flex items-center mb-4' |
inputClass | string | 'w-4 h-4 border-gray-300 focus:ring-2 focus:ring-blue-300 dark:focus:ring-blue-600 dark:focus:bg-blue-600 dark:bg-gray-700 dark:border-gray-600' |
labelClass | string | 'block ml-2 text-sm font-medium text-gray-900 dark:text-gray-300' |
name | string | 'countries' |
options | RadioType[] | - |