Radio
Sizes
Selected size: md
xs
sm
md (default)
lg
xl
<script lang="ts">
let size = 'md'
</script>
<p>
<b>Selected size: </b>
{size}
</p>
<div class="c-flex c-gutter-md c-wrap c-items-center">
<div>
<CRadio bind:value={size} label="xs" selectedValue="xs" size="xs" />
</div>
<div>
<CRadio bind:value={size} label="sm" selectedValue="sm" size="sm" />
</div>
<div>
<CRadio bind:value={size} label="md (default)" selectedValue="md" />
</div>
<div>
<CRadio bind:value={size} label="lg" selectedValue="lg" size="lg" />
</div>
<div>
<CRadio bind:value={size} label="xl" selectedValue="xl" size="xl" />
</div>
</div>
svelte
Click fold/expand code
Disabled
Disabled
<script lang="ts">
let value = false
</script>
<CRadio bind:value label="Disabled" disabled />
svelte
Click fold/expand code
CRadio Props
- valuedefault:
boolean | string | number
false
The radio selected status. It is recommended to use
bind:value
. - selectedValuedefault:
boolean | string | number
true
The selected value.
- labeldefault:
string
The label text.
- sizedefault:
'xs' | 'sm' | 'md' | 'lg' | 'xl'=
undefined
The size of radio. Notice that the default value is
'md'
instead ofundefined
- disableddefault:
boolean
false
Determine whether the radio is disabled or not.
CRadio Events
- change
The change event.
CRadio Slots
No data
CRadio Exports
No data
On this page