Skip to content

Checkbox

The Checkbox component renders a Bulma checkbox inside a <label> element. Use the label prop for plain text, or the default slot for rich content.

<Checkbox name="agree" label="I agree to the terms" />
<Checkbox name="active" label="Active" checked />
<Checkbox name="tos" label="Accept terms of service" required />
<Checkbox name="locked" label="Locked option" disabled />
<Checkbox name="locked-checked" label="Locked and checked" disabled checked />

Use the default slot instead of label to include HTML inside the label:

<Checkbox name="rich">
I agree to the <a href="#">terms of service</a> and <a href="#">privacy policy</a>
</Checkbox>

Interests

<Checkbox name="interests" value="music" label="Music" />
<Checkbox name="interests" value="sport" label="Sport" />
<Checkbox name="interests" value="tech" label="Technology" checked />

data-* and aria-* attributes are forwarded to the <label> element; all other attributes are forwarded to the <input>:

<Checkbox
name="item"
label="Item"
data-item-id="42"
aria-label="Select item 42"
/>
PropTypeDefaultDescription
namestringRequired. name attribute.
idstringnameid attribute; defaults to name.
labelstringLabel text. Use the slot for rich content instead.
valuestringvalue attribute (useful in checkbox groups).
checkedbooleanPre-checked state.
requiredbooleanRequired field.
disabledbooleanDisabled state.
classstringExtra classes on the wrapping <label>.
data-**Forwarded to <label>.
aria-**Forwarded to <label>.
...*Other native input attributes forwarded to <input>.