A control that allows the user to toggle between checked and not checked.
❯buridan add checkboxUse the following to build the Checkbox component.
from components.ui.checkbox import checkboxFor manual installation, copy each of the source codes below in their respective locations.
Pair the checkbox with field.root and field.label for proper layout and labeling. checkbox.root's id is what html_for should point to.
Props used: id, default_checked on checkbox.root; html_for on field.label.
Use field.description for helper text underneath the label.
Props used: id, default_checked on checkbox.root; html_for on field.label.
By clicking this checkbox, you agree to the terms and conditions.
Use the disabled prop to prevent interaction — the wrapper's has-[:disabled] styling dims it automatically, no extra data attribute needed.
Props used: id, disabled on checkbox.root; html_for on field.label.
Use multiple field.roots inside a fieldset to build a checkbox list.
Props used: id, default_checked on checkbox.root; html_for on field.label.
Renders a <label> wrapping a visually-hidden <input type="checkbox"> and the indicator — clicking anywhere in the root toggles it, with no extra JS wiring required.
checkbox.root(
checkbox.indicator(),
id="terms",
default_checked=True,
)
If no children are passed, a default checkbox.indicator() (tick icon) is rendered automatically.
The tick icon shown when the checkbox is checked, via peer-checked:grid — no fallback_id/menu_id-style wiring needed, it's a direct sibling of the input.
checkbox.indicator(hi("Tick02Icon"))
If no children are passed, hi("Tick02Icon") is used by default.