Skip to content
Star

PxCheckbox

A styled checkbox component. Supports binary (true/false) mode and array-based multi-check (like native <input type="checkbox">). Built as a self-contained component (no external checkbox library).

Usage

Demo

Binary Mode

Value: false

Array Mode

Selected: []

Props

PropTypeDefaultDescription
modelValuerequiredboolean | unknown[]In binary mode: a boolean. In array mode: the array of selected values.
binarybooleanfalseWhen true, modelValue is a boolean toggle. When false, modelValue is an array.
valueunknownundefinedThe value added/removed from the modelValue array when checked/unchecked (array mode only).
inputIdstringundefinedHTML id for the input element. Use with a matching label for attribute.
disabledbooleanfalseDisables the checkbox.

Emits

EventPayloadDescription
update:modelValueboolean | unknown[]Emitted on checkbox change.
changeEventNative change event.

Built with VitePress