Forms

RadioGroup

An accessible radio button group component for selecting one option from a set. Essential for healthcare forms where mutually exclusive options are common (e.g., appointment type, insurance plan, priority level).

Basic Usage

Use RadioGroup for mutually exclusive selections. Perfect for appointment types, visit reasons, and other single-choice scenarios.

Appointment Type

Select the type of appointment you need

With Descriptions

Add descriptions to help users understand each option. Especially useful for complex choices like insurance plans or treatment options.

Insurance Plan (required)

Select your primary insurance provider

Horizontal Layout

Use horizontal orientation for compact layouts or when options are short. Ideal for payment methods or simple status selections.

Payment Method (required)

Disabled Options

Disable specific options when they're not available or require special permissions. The entire group can also be disabled.

Priority Level

Some options require administrator approval

Visit Reason (Disabled)

This field is disabled during system maintenance

Validation

Show error messages when validation fails. Use validateOnMount to show errors immediately.

Visit Reason (required)
Required Selection (validateOnMount) (required)

Sizes

Choose the appropriate size based on context. Use larger sizes for important forms and smaller sizes for compact interfaces.

Small Size
Medium Size (Default)
Large Size

Props

PropTypeDefaultDescription
id stringUnique identifier for the radio group
name stringForm field name
label stringGroup label (required)
options RadioOption[]Radio options array (required)
value stringCurrently selected value
required booleanfalseWhether a selection is required
disabled booleanfalseWhether the entire group is disabled
error stringError message to display
hint stringHint text
size 'sm' | 'md' | 'lg''md'Size of the radio buttons
orientation 'vertical' | 'horizontal''vertical'Layout orientation
hideLabel booleanfalseWhether to hide the group label visually
class stringAdditional CSS classes
onchange (value: string) => voidChange handler
testId stringTest ID for e2e testing
validateOnMount booleanfalseShow validation state immediately without waiting for interaction

Healthcare Best Practices

  • • Always use required for critical selections like insurance plan or appointment type
  • • Provide clear descriptions for complex options (e.g., insurance plan types, treatment options)
  • • Use horizontal layout sparingly - vertical layout is more accessible and easier to scan
  • • Disable options rather than hiding them when they're temporarily unavailable - this provides better context
  • • Show validation errors only after user interaction to avoid overwhelming users
  • • Include hint text to guide users, especially for fields with regulatory requirements
  • • Ensure proper keyboard navigation and screen reader support for accessibility compliance
  • • Group related options logically (e.g., all appointment types together, all payment methods together)