Tailwind radios

Responsive radios built with Tailwind. Limits the user to one selection, from a list of preset options. The singular property of a radio button makes it distinct from a checkbox.


Basic example

Radio Buttons
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!-- Required form plugin -->
<link href="https://cdn.jsdelivr.net/npm/@tailwindcss/custom-forms@0.2.1/dist/custom-forms.css" rel="stylesheet">

<div class="block">
  <span class="text-gray-700">Radio Buttons</span>
  <div class="mt-2">
    <div>
      <label class="inline-flex items-center">
        <input type="radio" class="form-radio" name="radio" value="1" checked>
        <span class="ml-2">Option 1</span>
      </label>
    </div>
    <div>
      <label class="inline-flex items-center">
        <input type="radio" class="form-radio" name="radio" value="2">
        <span class="ml-2">Option 2</span>
      </label>
    </div>
    <div>
      <label class="inline-flex items-center">
        <input type="radio" class="form-radio" name="radio" value="3">
        <span class="ml-2">Option 3</span>
      </label>
    </div>
  </div>
</div>