Checkbox
A control that allows the user to toggle between checked and not checked.
Installation
Command to install the Checkbox component.
Component Guide
Use the following to build the Checkbox component.
from components.ui.checkbox import checkboxSource Code & Dependencies
For manual installation, copy each of the source codes below in their respective locations.
components/core/core.py
components/core/hugeicon.py
components/ui/checkbox.py
Examples
Basic
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.
Description
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.
Disabled
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.
Group
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.
API Reference
checkbox.root
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.
checkbox.indicator
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.