StellarUI

<stellar-checkbox>

Properties

Preview

Markup

Copy
<stellar-checkbox
  checked
  label="Accept terms"
  description="You can change this later in settings."
  value="on"
>
</stellar-checkbox>

API

Complete props, events, slots, and implementation notes for the shipped checkbox.

Props

PropTypeDefaultNotes
toneneutral | primary | secondary | tertiary | errorneutral
sizexs | sm | md | lg | xlmd
orientationvertical | horizontalvertical
labelstring''
descriptionstring''
errorstring''
checkedbooleanfalse
indeterminatebooleanfalse
disabledbooleanfalse
valuestringon

Events

EventSourceNotes
changehostRedispatched from the inner native checkbox.

Slots

SlotNotes
labelOptional label content. In vertical orientation it renders above the checkbox; in horizontal it renders inline to the right.
descriptionOptional helper content below the control. Overrides the description prop when present.
errorOptional validation message below the control. It replaces description while the inner control is invalid.

Notes

  • The public tag is `stellar-checkbox`, backed by a real native `<input type="checkbox">` inside the component.
  • `label` and `description` match the rest of the StellarUI field-control family, and `orientation` controls whether the label sits above or inline with the checkbox.
  • `required`, `aria-invalid`, and `custom-validity` forward to the inner native checkbox for validation-sensitive flows.
  • The host exposes `setCustomValidity()`, `checkValidity()`, `reportValidity()`, `validity`, `validationMessage`, and `willValidate`, so app code can use native-like validity APIs on the custom element.
  • For Datastar, prefer `data-attr:custom-validity="..."` on the custom element host instead of the Pro-only `data-custom-validity` attribute.
  • `checked`, `disabled`, and `value` mirror native checkbox semantics, while `indeterminate` sets the native property after render.
  • The host redispatches `change` so outer Datastar listeners can treat it like a normal form control.
  • The tone ramp stays aligned with the rest of StellarUI's shipped control set: `neutral`, `primary`, `secondary`, `tertiary`, and `error`.