Checkbox

A control that allows the user to toggle between checked and not checked.

Usage

Add the input class to your <input type="checkbox"> elements. Pair it with Field and a native <label> for proper layout and labeling.

<input type="checkbox" class="input">

Checked state

Use native HTML attributes for state. Add checked for an initially checked checkbox, or read and update the element's checked property in JavaScript.

<input type="checkbox" class="input" checked>

Invalid state

Set aria-invalid="true" on the checkbox and, when using field, set data-invalid="true" on the field wrapper.

You must accept the terms to continue.

Examples

Basic

Description

By clicking this checkbox, you agree to the terms and conditions.

Disabled

Group

Sidebar

Select the items you want to display in the sidebar.

Table

Status Email
Active olivia@example.com
Inactive noah@example.com

RTL

Checkbox layout uses document direction and logical spacing. Set dir="rtl" on a parent to render right-to-left.

يمكنك تغيير هذا الخيار في أي وقت.