Radio Button Group
Mutually exclusive options with shared validation and required state
Built-in Features
What you get out of the box with zero configuration
Auto-initializes with the forms system. Two-way binding syncs disabled and required states between inputs and containers.
Required selection enforced on form submit. Auto-revalidates on change once an error is shown. Call NDS.Forms.clearStatus() to reset.
Ripple effect on hover, smooth state transitions, and three sizes (SM, MD, LG) with proportional scaling.
Column layout by default, row layout with nds-rowView class. Gaps adjust on mobile for touch-friendly spacing.
Usage Guidelines
When and how to use radio buttons effectively
When to Use
- Selecting exactly one option from a mutually exclusive set
- Use checkboxes when multiple selections are allowed
- Use a select dropdown when there are more than 7 options
- Use switches for instant on/off actions without form submission
- Always provide a default selection when possible to avoid empty submissions
- Wrap options in a fieldset with a legend that describes what the user is choosing
JavaScript API
Validation Attributes
- Add
data-requiredto the group to require a selection before form submission - Add
data-error-messageon the group to override the default validation message - Place a
nds-form-footerwithdata-feedback-targetinside the group for dynamic feedback placement - Use
data-state="disabled"on the group to disable all radio buttons at once