Radio Group
Usage
Include CSS
Import Tailwind and one full A3S UI style bundle.
Or import only the base CSS, Radio Group component CSS, and one style pack.
Radio Group uses Radio styles and composes Field styles in the richer examples.
Using CDN or bundler imports? See the Installation page.
Add your radio group HTML
Add class="input" to radio inputs. Use a shared name attribute for mutually exclusive options, and wrap related options in a semantic <fieldset> or an element with role="radiogroup".
Examples
Description
Radio group items with a description using the Field component.
Standard spacing for most use cases.
More space between elements.
Minimal spacing for dense layouts.
Choice Card
Use a native <label> to wrap the entire .field for a clickable card-style selection.
Fieldset
Use a native <fieldset> and <legend> to group radio items with a label and description.
Disabled
Use the disabled attribute to disable individual items.
Invalid
Use aria-invalid="true" on radio inputs and data-invalid on fields to show validation errors.
RTL
Set dir="rtl" on the radio group or an ancestor.
تباعد قياسي لمعظم حالات الاستخدام.
مساحة أكبر بين العناصر.
تباعد أدنى للتخطيطات الكثيفة.