Radio
Radio inputs allow the user to select multiple options from a set.
Basic Example
Using the i-radio component together with a i-radio-group allows you to choose a value from multiple choices using a single model binding:
Disabled State
You can disable a radio using the disabled property.
Readonly State
You can make a radio readonly using the readonly property.
Size Variants
You’re able to use the size property to control the size of your radio, using one of the available sizes: sm, md, and lg. The default size is set to md.
Group Disabled State
You can disable an entire radio group using the disabled property.
Group Size Variants
You’re able to use the size property to control the size of your radio group, using one of the available sizes: sm, md, and lg. The default size is set to md.
The chosen size will be applied to all of its child inputs.
Group Color Variants
You can use the color property to set a light or dark color for your radios.
Custom vs. Native
Inkline uses a custom radio design by default. You can use the native property to use native browser radio indicators.
Configuration
Props
Use props to modify the component’s design and behavior.
- Property
colorType'light' | 'dark'Default'light'Description The color variant of the radio - Property
disabledTypeBooleanDefaultfalseDescription The disabled state of the radio - Property
indeterminateTypeBooleanDefaultfalseDescription The indeterminate state of the radio - Property
valueTypeAnyDefault''Description Used to set the radio value when used inside a radio group - Property
modelValueTypeAnyDefaultfalseDescription Used to set the radio value when used by itself - Property
nameTypeStringDefaultuid()Description The unique identifier of the radio - Property
nativeTypeBooleanDefaultfalseDescription Displays the native browser radio input indicator - Property
readonlyTypeBooleanDefaultfalseDescription The readonly state of the radio - Property
sizeType'sm' | 'md' | 'lg'Default'md'Description The size variant of the radio - Property
tabindexTypeNumber | StringDefault0Description The tabindex of the radio
Slots
Use slots to insert custom content into well-defined component locations.
- Property
defaultDescription Slot for default radio label
Events
Use events to react to something happening inside the component.
- Property
update:modelValueDescription Event emitted for setting the modelValue
CSS Variables
Read more about configuring Inkline’s Design System variables to update the look and feel of the component.
- Property
----backgroundValuecolor('white')Description The background of the radio component indicator - Property
----background--checkedValuecolor('primary')Description The background of the radio component indicator when checked - Property
----background--disabledValuecolor('light-25')Description The background of the radio component indicator when disabled - Property
----background--checked-disabledValuecolor('primary-25')Description The background of the radio component indicator when checked and disabled - Property
----border-colorValuecolor('light-55')Description The border-color of the radio component indicator - Property
----border-color--checkedValuecolor('primary-55')Description The border-color of the radio component indicator when checked - Property
----border-color--disabledValuecolor('light')Description The border-color of the radio component indicator when disabled - Property
----border-color--checked-disabledValuecolor('primary-30')Description The border-color of the radio component indicator when checked and disabled - Property
----border-styleValuevar(--border-style)Description The border style of the radio component indicator - Property
----border-top-widthValuevar(--border-top-width)Description The border top width of the radio component indicator - Property
----border-right-widthValuevar(--border-right-width)Description The border right width of the radio component indicator - Property
----border-bottom-widthValuevar(--border-bottom-width)Description The border bottom width of the radio component indicator - Property
----border-left-widthValuevar(--border-left-width)Description The border left width of the radio component indicator - Property
----border-widthValuevar(----border-top-width) var(----border-right-width) var(----border-bottom-width) var(----border-left-width)Description The border width of the radio component indicator - Property
----border-top-left-radiusValue50%Description The border top left radius of the radio component indicator - Property
----border-top-right-radiusValue50%Description The border top right radius of the radio component indicator - Property
----border-bottom-right-radiusValue50%Description The border bottom right radius of the radio component indicator - Property
----border-bottom-left-radiusValue50%Description The border bottom left radius of the radio component indicator - Property
----border-radiusValuevar(----border-top-left-radius) var(----border-top-right-radius) var(----border-bottom-right-radius) var(----border-bottom-left-radius)Description The border radius of the radio component indicator - Property
----box-shadow-offset-xValuevar(--box-shadow-offset-x)Description The box shadow horizontal offset of the radio component indicator - Property
----box-shadow-offset-yValuevar(--box-shadow-offset-y)Description The box shadow vertical offset of the radio component indicator - Property
----box-shadow-blur-radiusValuevar(--box-shadow-blur-radius)Description The box shadow blur radius of the radio component indicator - Property
----box-shadow-spread-radiusValuevar(--box-shadow-spread-radius)Description The box shadow spread radius of the radio component indicator - Property
----box-shadow-colorValuevar(--box-shadow-color)Description The box shadow spread radius of the radio component indicator - Property
----box-shadowValuevar(----box-shadow-offset-x) var(----box-shadow-offset-y) var(----box-shadow-blur-radius) var(----box-shadow-spread-radius) var(----box-shadow-color)Description The box shadow of the radio component indicator - Property
----colorValuecolor('white')Description The color of the radio component indicator icon - Property
----color--disabledValuecolor('light-25')Description The color of the radio component indicator icon when disabled - Property
----margin-rightValuecalc(var(--margin-right) / 2)Description The right margin of the radio component indicator - Property
----sizeValue1remDescription The size of the radio component indicator - Property
----checkmark--sizeValue8pxDescription The size of the radio component indicator check mark icon - Property
----label--font-sizeValuefont-size()Description The font size of the radio component label - Property
----label--colorValuecontrast-color($color-light)Description The label color of the radio component label - Property
----label--color--disabledValuecolor('light-70')Description The label color of the radio component when disabled