--- title: Radio button layout: docs theme: library doc-tab: form doc-subtab: radio breadcrumb: - home - documentation - form - form-radio meta: colors: false sizes: false variables: false --- {% capture radio_example %}
{% endcapture %} {% capture radio_default_example %}
{% endcapture %} {% capture radio_disabled_example %}
{% endcapture %}

The radio class is a simple wrapper around the <input type="radio"> HTML elements. It is intentionally not styled, to preserve cross-browser compatibility and the user experience.

Make sure the linked radio buttons have the same value for their name HTML attribute.

{{ radio_example }}
{% highlight html -%} {{- radio_example -}} {%- endhighlight %}

You can check a radio button by default by adding the checked HTML attribute to the <input> element.

{{ radio_default_example }}
{% highlight html -%} {{- radio_default_example -}} {%- endhighlight %}

You can disable a radio button by adding the disabled HTML attribute to both the <label> and the <input>.

{{ radio_disabled_example }}
{% highlight html -%} {{- radio_disabled_example -}} {%- endhighlight %}