Checkbox

Usage

<Checkbox />
<Checkbox checked />
<Checkbox indeterminate />

Label

<label><Checkbox />Checkbox one</label>
<label><Checkbox />Checkbox two</label>

Theming

TokenDefault value
--np-checkbox-container-shape2px
--np-checkbox-outline-color--np-color-primary
--np-checkbox-selected-container-color--np-color-on-surface-variant
--np-checkbox-selected-icon-color--np-color-on-primary

Example

<Checkbox
	checked
	--np-checkbox-container-shape="10px"
	--np-checkbox-outline-color="var(--np-color-tertiary)"
	--np-checkbox-selected-container-color="var(--np-color-error)"
	--np-checkbox-selected-icon-color="var(--np-color-on-error)"
/>

API

AttributeTypeDefaultDescription
...attributesOmit<HTMLInputAttributes, 'type'>

Bindables

AttributeTypeDescription
indeterminateboolean | null | undefinedInput property
checkedboolean | null | undefinedInput property
groupstring | number | undefinedInput property
elementHTMLElementA reference to the root DOM element of the component. This variable is bound using bind:this, allowing direct access to the underlying HTML element for manipulation or querying within the component's logic.