Checkbox

Represents an independent boolean choice through .checked and native input/change events; it participates in forms where supported.

HTML example

<slex-checkbox label="Send notifications" checked></slex-checkbox>

API Reference

Defaults describe rendered behavior when an attribute is omitted, not necessarily the property getter; auto means derived as described. Boolean attributes use presence; pass arrays through JavaScript properties.

Property / attribute Type Default Description
label string "" Visible control label.
unit string "" Exposed for contract consistency, but this component does not currently render it.
description string "" Exposed for contract consistency, but this component does not currently render it.
disabled boolean false Disables user interaction.
name string unset Name used when the custom element participates in a native form.
value string / number "on" Value submitted when checked; defaults to on when no value was assigned. Use checked to control the visual state.
aria-label string auto Accessible name override; otherwise the visible label supplies the name when available.
checked boolean false Current checked state.

Events: input, change. Use native event listeners; read interactive values from component properties.

Contract summary

Use dist/custom-elements.json for exact types and full descriptions. Use attributes for scalar initial values, JavaScript properties for arrays/objects, and native events for interaction.