CheckboxGroup <pm-checkbox-group>
Checkbox group: choose any number of options under one label.
Variants
Set with the variant attribute.
variant="list"variant="card"Sizes
Set with the size attribute; controls keep touch-sized targets on phones.
size="xs"size="sm"size="md"size="lg"size="xl"Tones
Set tone on the element, or data-tone on any ancestor to tone a whole area.
tone="accent"tone="secondary"tone="neutral"tone="success"tone="warning"tone="danger"tone="info"States
Each state is one attribute.
DisabledRead-onlyRequiredErrorOverview
Declare options as <pm-choice value="x"> children. value is the chosen values joined with commas; the form receives one entry per chosen value under name. required needs at least one choice; min / max limit how many. variant="card" shows options as cards with an optional description.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
orientation | 'vertical' | 'horizontal' | vertical | Layout and arrow-key direction: horizontal or vertical. |
variant | 'list' | 'card' | — | list (default) or card. |
min | number | — | Fewest options that must be chosen. |
max | number | — | Most options that can be chosen; the rest are disabled once reached. |
name | string | — | Form field name: the value is submitted under it. |
value | string | — | Current value (submitted with the form). |
label | string | — | Visible label (required for accessibility; use hide-label to visually hide it). |
hint | string | — | Help text under the field, linked to it for screen readers. |
error | string | — | Custom error message. Setting it marks the control invalid. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | — | Control size. |
required | boolean | false | The form cannot be submitted until this has a value. |
disabled | boolean | false | Not interactive and not submitted. |
readonly | boolean | false | Focusable and submitted, but not editable. |
hide-labelprop: hideLabel | boolean | false | Hide the label visually; it stays the accessible name. |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-change | onPmChange | The selection changed. detail.values lists the chosen values; detail.value joins them with commas. |
Methods
checkValidity(), reportValidity(), validate(), focus()
<pm-choice>
Option declaration for pm-checkbox-group (renders nothing itself).
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
value | string | — | Value submitted when chosen. |
description | string | — | Second line under the label (card variant). |
disabled | boolean | — | Disable this option. |
Slots
| Slot | Description |
|---|---|
(default) | Option label (text). |