--- layout: layouts/component.njk title: Radio Group description: A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time. toc: - label: Usage id: usage - label: Examples id: examples children: - label: Form id: example-form --- {% from "macros/code_preview.njk" import code_preview %} {% from "macros/code_block.njk" import code_block %} {% set code %}
{% endset %} {{ code_preview("radio-group", code) }}

Usage

Simply add the input class to your <input type="radio"> elements or have a parent with the form class (read more about form). You can also set the aria-invalid attribute to true to make the input invalid.

{{ code_block(code) }}

Examples

Form

{% set code %}
{% endset %} {{ code_preview("radio-group-form", code, "w-full max-w-sm") }}