Skip to content

Checkbox ​

The bq-checkbox component is an accessible checkbox input supporting checked, indeterminate, and disabled states with optional hint text.

Basic Usage ​

html
<bq-checkbox label="Accept terms and conditions"></bq-checkbox>

Checked ​

html
<bq-checkbox label="Receive notifications" checked></bq-checkbox>

Indeterminate ​

html
<bq-checkbox label="Select all" indeterminate></bq-checkbox>

With Hint ​

html
<bq-checkbox
  label="Marketing emails"
  hint="We'll send you updates about new features and promotions."
></bq-checkbox>

Disabled ​

html
<bq-checkbox label="Inactive option" disabled></bq-checkbox>
<bq-checkbox label="Locked selection" checked disabled></bq-checkbox>

Properties ​

PropertyTypeDefaultDescription
labelstring—Checkbox label text
checkedbooleanfalseWhether the checkbox is checked
indeterminatebooleanfalseDisplays the indeterminate (mixed) state
disabledbooleanfalseDisables the checkbox
namestring—Form field name
valuestring—Value submitted with the form
hintstring—Helper text displayed below the label

Events ​

EventDetailDescription
bq-change{ checked: boolean }Fired when the checked state changes

Slots ​

SlotDescription
(default)Custom label content (overrides the label property)

CSS Parts ​

PartDescription
wrapperThe outer checkbox wrapper
controlThe checkbox input control
inputThe native checkbox input
labelLabel text element
hintHint text element

Released under the MIT License.