Skip to content

ExpressiveCSS

Browse documentation

Radio Buttons

Material Design 3 radios, from the HTML.

View as Markdown

On this page

Wrap an <input type="radio"> in a <label> to make the control. The label text is a sibling of the input and needs no extra class or <span>. Radio buttons are CSS only. There is no JavaScript component and nothing to AutoInit.

Tokens follow the M3 radio spec. The icon is a 20dp ring with a 2dp stroke. Selected is primary with a 10dp inner disc (the M3 gap). The state layer is 40dp at 8% hover and 10% focus. The touch target is 48dp. The label is body-large / on-surface. Disabled is on-surface at 38%.

Use the same name on every radio in a group. Add disabled to disable one. with-gap is a no-op, because the selected state is always the ring plus inner disc.

Colour
<fieldset>
  <legend>Colour</legend>
  <label>
    <input name="group1" type="radio" checked>
    Red
  </label>
  <label>
    <input name="group1" type="radio">
    Yellow
  </label>
  <label>
    <input name="group1" type="radio" disabled>
    Brown
  </label>
</fieldset>

In a row

Put the labels in a <div class="inline"> to sit them on one line. A bare group stacks vertically.

Colour
<fieldset>
  <legend>Colour</legend>
  <div class="inline">
    <label>
      <input name="group2" type="radio" checked>
      Red
    </label>
    <label>
      <input name="group2" type="radio">
      Yellow
    </label>
  </div>
</fieldset>

No matching pages

  • Source color

    The seed every generated ramp derives from. Pick one and browse the docs — the whole theme follows. Error does not: it is a fixed hue.

    Default source: Mist Iris.

    ExpressiveCSS presets: Lagoon, Harbor, Breeze, Cobalt, Iris.

    Bold

    Soft

    Mist

    Glow