Skip to content

CSS: radio-input-group

.instui-radio-input-group — A single-select radio <fieldset>, plain or as a connected segmented toggle.

Source: radio-input-group.css

Accessibility

Renders a native <fieldset> with a <legend> that names the group; the child radios share one name, so only one can be selected at a time.

Usage

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/radio-input-group.css";

Examples

html
<fieldset class="instui-radio-input-group -variant-toggle">
  <legend>T-shirt size</legend>
  <label class="instui-radio -variant-toggle"><input type="radio" name="size" checked> Small</label>
  <label class="instui-radio -variant-toggle"><input type="radio" name="size"> Medium</label>
  <label class="instui-radio -variant-toggle"><input type="radio" name="size"> Large</label>
</fieldset>
T-shirt size

Structure

text
.instui-radio-input-group.-variant-toggle
  legend
  radio (component)
    input
flowchart TD n0[".instui-radio-input-group.-variant-toggle"]:::cssdoc-root n1("legend"):::cssdoc-part n2(["radio"]):::cssdoc-component n3("input"):::cssdoc-part n0 --> n1 n2 --> n3 n0 --> n2 click n2 "/api/css/radio.md" classDef cssdoc-root stroke-width:1px; classDef cssdoc-part stroke-width:1px; classDef cssdoc-slot stroke-width:1px; classDef cssdoc-component stroke-width:1px;

Modifiers

ModifierDescription
.-layout-columnsLay the radios out in columns.
.-layout-inlineLay the radios out inline.
.-requiredMark the group as required.
.-variant-toggleLay the child toggles out as a segmented control (only the selected segment fills).

Pseudo-elements

Pseudo-elementDescription
::afterRenders the decorative required-field asterisk after the legend text when the group is required.

Tokens consumed

TokenTypeValue
--instui-component-form-field-layout-asterisk-color<color>light-dark(#CF1F24, #FA917F)LightDark
--instui-component-form-field-layout-font-family[ <font-family-name> | <generic-font-family> ]#Atkinson Hyperlegible Next, "Helvetica Neue", Helvetica, Arial, sans-serif
--instui-component-form-field-layout-font-size<length>1rem
--instui-component-form-field-layout-font-weight<integer>400
--instui-component-form-field-layout-gap-inputs<length>0.75rem
--instui-component-form-field-layout-gap-primitives<length>0.5rem
--instui-component-form-field-layout-line-height<length>1.125rem
--instui-component-form-field-layout-text-color<color>light-dark(#273540, #ffffff)LightDark
--instui-spacing-space-md<length>0.75rem

Subcomponents

  • radio — The individual control this group collects.
  • form-field-group — The general wrapper for grouping and laying out fields.