Checkbox โ
A control for boolean / multi-state selection. Toggle Vue / CSS to switch the live demo and source together.
Basic โ
Default checkbox; optional label and description.
Vue SFC
States โ
Disabled, pre-checked and indeterminate states.
Vue SFC
Sizes โ
Small, medium and large.
Vue SFC
With input โ
Each step sits directly below a mono-input of the same size, which is where a mismatch shows up first. The box tracks the shared --theme-control-height-* token at half height, and the label, description and gap scale with it.
Vue SFC
Colors โ
All built-in color variants.
Vue SFC
Group โ
Simple group layout.
Vue SFC
Slots โ
Custom label/description via slots.
Vue SFC
Event: change โ
Listen for change events.
Vue SFC
Controlled โ
Drive the value imperatively.
Vue SFC
Indeterminate toggle โ
Toggle the indeterminate flag.
Vue SFC
Select-all group โ
Master checkbox + members.
Vue SFC
Event log โ
Live log of emitted events.
Vue SFC
Customized โ
Custom checkbox with advanced styling.
Vue SFC
CSS Variables โ
Vue SFC
Every checkbox is themed through --mono-checkbox-* custom properties. Setting one on the element, on any wrapper/ancestor, or inline all work โ custom properties inherit, and they pierce the shadow-DOM boundary, so the same overrides apply to <mono-checkbox> and the shadow build. The color prop sets the accent, but an explicit --mono-checkbox-accent override always wins. To re-skin globally, set the underlying --theme-* tokens โ they feed the defaults below.
| Variable | Default | Controls |
|---|---|---|
--mono-checkbox-accent | --theme-primary | Box fill/border when checked (set by color) |
--mono-checkbox-bg | #ffffff | Box background when unchecked |
--mono-checkbox-border | theme border mix | Box border color |
--mono-checkbox-border-hover | primary mix | Box border on hover |
--mono-checkbox-icon | #ffffff | Check / indeterminate glyph color |
--mono-checkbox-ring | primary 20% | Focus-visible ring color |
--mono-checkbox-shadow | 0 1px 2px โฆ | Box shadow |
--mono-checkbox-text | --theme-text | Label text color |
--mono-checkbox-description | #6b7280 | Description text color |
--mono-checkbox-radius | 25% | Box corner radius โ a percentage, so it scales with size and never rounds into a circle. Absolute lengths (4px) also work. |
--mono-checkbox-border-width | 2px (1.5px at xs/sm) | Box border width |
--mono-checkbox-gap | 0.75rem at md, 0.375rem โ 1.125rem across the scale | Gap between box and label |
The box itself is not a variable: it is always half of --theme-control-height-* for the current size, so a checkbox stays proportional to an input or select beside it. Retune that token and the checkbox follows. Label and description sizes track --theme-title-font-* / --theme-subtitle-font-* per step.
Types โ
Import
import { CheckboxProps } from 'mono-helper'| Prop | Value | Default | Description |
|---|---|---|---|
modelValue | boolean | โ | Bound checked state of the checkbox. |
checked | boolean | โ | Whether the checkbox is checked. |
color | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | โ | Color theme of the checkbox. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | โ | Visual size of the checkbox. |
disabled | boolean | โ | Disables interaction and dims the checkbox. |
indeterminate | boolean | โ | Shows the indeterminate (mixed) state. |
label | string | โ | Label text shown next to the checkbox. |
description | string | โ | Secondary description text shown under the label. |
value | string | โ | Form value submitted when checked. |
name | string | โ | Form field name of the checkbox. |
ariaLabelText | string | โ | Accessible label text for screen readers. |
cssClass | CheckboxCssClass | โ | Per-element class overrides. |
visible | boolean | โ | Whether the control is shown. Defaults to `true`. |
visibleType | 'invisible' | 'none' | โ | How it hides when `visible` is `false`. Defaults to `'none'`. |