Skip to content

Checkbox

An enhanced native <input type="checkbox"> supporting indeterminate state and checkbox groups.

Basic Usage

Basic usage

CheckedUnchecked

Indeterminate State

Indeterminate

Indeterminate

Use it with select-all linkage scenarios (see the example below) to express "partially selected".

Disabled

Disabled

Checked & disabledUnchecked & disabled

Checkbox Group

Checkbox group

Fruits (multiple selectable)AppleBananaOrange

The group is controlled via value (a JSON array); each item's value acts as the option identifier.

Select All / Indeterminate Linkage

Select-all & indeterminate linkage

Select allAppleBananaOrange

Events

Selection events

AppleBananaOrange

Listen to oas-change: a single item dispatches detail: { checked, value }, the group dispatches detail: { value: string[] }.

API

Attributes

AttributeDescriptionTypeDefault
checkedWhether checkedboolean
disabledDisabledboolean
indeterminateIndeterminate stateboolean
valueOption identifierstring

Events

EventDescription
oas-changeChange, detail: { checked, value }; group: detail: { value } (array)

Slots

NameDescription
default

oas-checkbox-group: value (JSON array), disabled, supports slot="label" to set the group title.