Radio Group

Usage

Include CSS

Import Tailwind and one full Basecoat style bundle.

@import "tailwindcss";
@import "basecoat-css/vega.css";

Or import only the base CSS, Radio Group component CSS, and one style pack.

@import "tailwindcss";
@import "basecoat-css/base.css";
@import "basecoat-css/components/field.css";
@import "basecoat-css/components/radio.css";
@import "basecoat-css/styles/vega.css";

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".

<input type="radio" name="plan" class="input" />

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.

Subscription Plan

Yearly and lifetime plans offer significant savings.

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.

Notification Preferences

Choose how you want to receive notifications.

RTL

Set dir="rtl" on the radio group or an ancestor.

تباعد قياسي لمعظم حالات الاستخدام.

مساحة أكبر بين العناصر.

تباعد أدنى للتخطيطات الكثيفة.