The radio button component. When multiple options are available, typically accessible forms do the following:

  • They wrap all the possible options for that same group into a <fieldset> or a div with the role set to radiogroup.
  • The radios will have the name set to a common value, so that only one of the possible options can be picked.

To style the fieldset, you mark it with the class GenshiRadioGroup. Each separate radio button can continue using the GenshiInput class, with __label, __control and __helper as elements.

<fieldset class="GenshiRadioGroup">
  <div class="GenshiInput">
    <label class="GenshiInput__label">
      <input type="radio" name="update" value="now" class="GenshiInput__control" />
      Install update now
    </label>
    <small class="GenshiInput__helper">The application will be restarted.</small>
  </div>
  <fieldset class="GenshiRadioGroup"></fieldset>
</fieldset>
Install updates
The application will be restarted.
The update will be available on next launch.
Option not available for users of the free edition.

Inline mode

If you don’t plan on adding helpers, your field set will still look vertical by default.

Install updates

However, this can be changed by applying the --inline modifier to the GenshiRadioGroup:

Install updates

Validation

Radio buttons may be valid or invalid.

The kitchen is still open.
We've run out of ingredients.
Your credit card is connected.
Your bank doesn't currently allow this.

However, you don’t usually mark individual options as invalid. Typically, you mark an entire fieldset as invalid.

Install updates
Please, install the update now.

Component sizes

The application will be restarted.
The application will be restarted.
The application will be restarted.
The application will be restarted.
The application will be restarted.