Props
| Name | Type | Default | Description |
|---|---|---|---|
autofocus | Booleanish | undefined | - | Sets autofocus on page load. |
compact | boolean | undefined | false | Displays the component in a compact version. See example |
dependencies | unknown[] | undefined | - | Defines an array of dependencies that will trigger actions in the component upon change. Only meaningful when |
depsDebounceTime | number | undefined | - | Timeout used to debounce response to changes to dependencies. See example |
description | string | undefined | - | Descriptive text displayed below the label and above the input. Unlike the hint it is always
visible, and it is linked to the input via One description for the whole set — there is no per-option equivalent. When each option needs its own line, the options are not uniform and a |
direction | InputDirection | undefined | - | Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like Splits the legend from the options, not the options from each other — that is |
disabled | boolean | undefined | false | Disables the component. Currently exempts options that are already ticked, so a disabled group with a selection can still be unticked. Until that is fixed in the library, lock a group carrying a selection with |
enforceCoherence | boolean | undefined | false | If coherence is enforced the input cannot have a modelValue that is incoherent with its current items. e.g. You cannot set v-model to a user that is not present in the items passed. modelValue will be reset upon incoherence. Drops model entries the current options no longer contain. Worth it when the options depend on another field, and not otherwise — a selection can vanish without the user doing anything. See example |
errors | string | string[] | undefined | - | Can be a string or an array of string containing the messages to display.
They render in an One channel for the whole fieldset, which is the concrete payoff over a hand-stacked row of |
hasErrors | boolean | undefined | false | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. See example |
hasWarnings | boolean | undefined | false | Define if the component should be in a warning state.
Same chrome as errors with |
hideLabel | boolean | undefined | false | Visually hides each option's label text (the text rendered next to every
input) while keeping it accessible to screen readers.
Does not affect the fieldset legend — use Hides each option's text, not the legend. For a group whose options are drawn entirely by the |
hideLegend | boolean | undefined | false | Visually hides the legend of the fieldset while maintaining accessibility. Hides the group's name while keeping it for assistive technology. For when a visible heading right above already says the same words — never as a way to avoid writing one. See example |
hint | string | undefined | - | Text box to be displayed near the input, usually to indicate instructions. See example |
id | string | undefined | - | The identifier of the component. |
inputDirection | "horizontal" | "vertical" | undefined | - | Defines the direction of the inputs in the fieldset. Lays the options out inside the fieldset. Defaults to |
inputPosition | "left" | "center" | "right" | undefined | "left" | Sets the alignment of the input. Since inputs are inline block they can be aligned just as text can. See example |
itemProps | BbOptionGroupItemProps<T> | undefined | - | ADDITIONAL row fields resolved from each item — never its text or value
(those stay on |
itemsrequired | T[] | ((prefill: boolean, modelValue?: any) => T[] | Promise<T[]>) | - | Used to retrieve items; can be an array or a function. An array, or a function called on mount and after every |
itemText | ItemAccessor<T, string> | undefined | - | Defines a path that returns a property of the object to use as text or a function that returns a string. A property path ( |
itemValue | ItemAccessor<T> | undefined | - | Defines a path that returns a property of the object to use as value or a function that returns any value. Prefer a stable primitive id. With this unset the model holds the whole item, which works — matching is structural, not by reference — but an id survives a refetch and is readable in a payload. See example |
legendrequired | string | - | Text content of the legend. Required, because it is the fieldset's accessible name: a screen reader announces it on entry, so every box is heard as an answer to a named question. Hide it with |
legendMode | "outside" | "inside" | undefined | - | Legend rendering mode. No floating mode here — a group has no single input for a label to float into. See example |
legendPosition | "left" | "center" | "right" | undefined | - | Sets the text alignment of the label. Renamed from v2's |
loadingText | string | undefined | - | String displayed while items are being loaded. Worth setting to something specific. "Loading hubs…" tells the reader more than the default. See example |
max | number | undefined | - | Maximum number of selected items. A shape rule, not a validation rule: it prevents the extra choice rather than complaining about it. Once the cap is reached the options that are off render disabled and the ticked ones stay live, so the user swaps rather than getting stuck. See example |
modelValuerequired | any | - | Used by v-model. Can be an array of any serializable type. |
modelValueDebounceTime | number | undefined | - | Timeout used to debounce response to changes to modelValue. |
multiple | boolean | undefined | true | Enables multi-selection behavior.
When true, True by default, so the model must be an array — a non-array throws on mount. Setting it false gives a single-value control that emits a bare value and |
name | string | undefined | - | Defines the name of the input. |
noDataText | string | undefined | - | String displayed when there are no items to display. See example |
persistentHint | boolean | undefined | false | Keeps the hint displayed. |
pt | GroupPtMap<T> | undefined | - | Passthrough, object form: the same keys as the |
pt:description | PtValue | undefined | - | |
pt:description:disabled | PtValue | undefined | - | |
pt:description:errors | PtValue | undefined | - | |
pt:description:has-value | PtValue | undefined | - | |
pt:description:loading | PtValue | undefined | - | |
pt:description:readonly | PtValue | undefined | - | |
pt:description:warnings | PtValue | undefined | - | |
pt:hint | PtValue | undefined | - | |
pt:hint:disabled | PtValue | undefined | - | |
pt:hint:errors | PtValue | undefined | - | |
pt:hint:has-value | PtValue | undefined | - | |
pt:hint:loading | PtValue | undefined | - | |
pt:hint:readonly | PtValue | undefined | - | |
pt:hint:warnings | PtValue | undefined | - | |
pt:icon | PtValue | ((ctx: PtItemCtx<T, GroupPtState>) => PtItemResult) | undefined | - | |
pt:icon:checked | PtValue | undefined | - | |
pt:icon:disabled | PtValue | undefined | - | |
pt:icon:errors | PtValue | undefined | - | |
pt:icon:focus-visible | PtValue | undefined | - | |
pt:icon:focused | PtValue | undefined | - | |
pt:icon:has-value | PtValue | undefined | - | |
pt:icon:loading | PtValue | undefined | - | |
pt:icon:readonly | PtValue | undefined | - | |
pt:icon:warnings | PtValue | undefined | - | |
pt:item | PtValue | ((ctx: PtItemCtx<T, GroupPtState>) => PtItemResult) | undefined | - | |
pt:item-description | PtValue | ((ctx: PtItemCtx<T, GroupPtState>) => PtItemResult) | undefined | - | |
pt:item-description:checked | PtValue | undefined | - | |
pt:item-description:disabled | PtValue | undefined | - | |
pt:item-description:errors | PtValue | undefined | - | |
pt:item-description:focus-visible | PtValue | undefined | - | |
pt:item-description:focused | PtValue | undefined | - | |
pt:item-description:has-value | PtValue | undefined | - | |
pt:item-description:loading | PtValue | undefined | - | |
pt:item-description:readonly | PtValue | undefined | - | |
pt:item-description:warnings | PtValue | undefined | - | |
pt:item:checked | PtValue | undefined | - | |
pt:item:disabled | PtValue | undefined | - | |
pt:item:errors | PtValue | undefined | - | |
pt:item:focus-visible | PtValue | undefined | - | |
pt:item:focused | PtValue | undefined | - | |
pt:item:has-value | PtValue | undefined | - | |
pt:item:loading | PtValue | undefined | - | |
pt:item:readonly | PtValue | undefined | - | |
pt:item:warnings | PtValue | undefined | - | |
pt:label | PtValue | ((ctx: PtItemCtx<T, GroupPtState>) => PtItemResult) | undefined | - | |
pt:label:checked | PtValue | undefined | - | |
pt:label:disabled | PtValue | undefined | - | |
pt:label:errors | PtValue | undefined | - | |
pt:label:focus-visible | PtValue | undefined | - | |
pt:label:focused | PtValue | undefined | - | |
pt:label:has-value | PtValue | undefined | - | |
pt:label:loading | PtValue | undefined | - | |
pt:label:readonly | PtValue | undefined | - | |
pt:label:warnings | PtValue | undefined | - | |
pt:legend | PtValue | undefined | - | |
pt:legend:disabled | PtValue | undefined | - | |
pt:legend:errors | PtValue | undefined | - | |
pt:legend:has-value | PtValue | undefined | - | |
pt:legend:loading | PtValue | undefined | - | |
pt:legend:readonly | PtValue | undefined | - | |
pt:legend:warnings | PtValue | undefined | - | |
pt:list | PtValue | undefined | - | |
pt:list:disabled | PtValue | undefined | - | |
pt:list:errors | PtValue | undefined | - | |
pt:list:has-value | PtValue | undefined | - | |
pt:list:loading | PtValue | undefined | - | |
pt:list:readonly | PtValue | undefined | - | |
pt:list:warnings | PtValue | undefined | - | |
pt:message | PtValue | undefined | - | |
pt:message:disabled | PtValue | undefined | - | |
pt:message:errors | PtValue | undefined | - | |
pt:message:has-value | PtValue | undefined | - | |
pt:message:loading | PtValue | undefined | - | |
pt:message:readonly | PtValue | undefined | - | |
pt:message:warnings | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:disabled | PtValue | undefined | - | |
pt:root:errors | PtValue | undefined | - | |
pt:root:has-value | PtValue | undefined | - | |
pt:root:loading | PtValue | undefined | - | |
pt:root:readonly | PtValue | undefined | - | |
pt:root:warnings | PtValue | undefined | - | |
readonly | boolean | undefined | false | Sets the input in a readonly state. Keeps every box focusable and submitted while swallowing every change. The right lock for a value the user may read and must not alter, and the reliable one when the group already carries a selection. See example |
reverse | boolean | undefined | false | Reverses the layout. Applicable in every direction the order of the label and the input is swapped. See example |
selectable | boolean | ((item: T) => boolean) | undefined | true | Defines whether options are selectable. Can be a global boolean that affects all options or a function that accepts an item and returns a boolean that only affects that item. Non-selectable options are rendered disabled. A boolean for the group or a predicate over the item. This is where v2's per-item |
warnings | string | string[] | undefined | - | Warning messages to display beneath the field, in their own |
v-model
Values kept in sync through v-model.
| Name | Type | Description |
|---|---|---|
modelValue | any | The array of resolved values, re-emitted in full on every change — never the option that moved. Diff it against the previous value when you need to know what changed. See example |
Events
| Name | Type | Description |
|---|---|---|
active | (e: "active"): void | Emitted when the group becomes active (focus/click enters it). |
blur | (e: "blur", event: FocusEvent): void | Emitted when one of the generated checkbox inputs loses focus.
Forwards the original DOM |
change | (e: "change", event: Event): void | Emitted when an option is toggled.
Forwards the original DOM |
click | (e: "click", event: MouseEvent): void | Emitted when one of the generated checkbox inputs is clicked.
Forwards the original DOM |
focus | (e: "focus", event: FocusEvent): void | Emitted when one of the generated checkbox inputs receives focus.
Forwards the original DOM |
inactive | (e: "inactive"): void | Emitted when focus/click moves outside the group after it was active. Useful for validation-on-blur flows at group level. |
input | (e: "input", event: Event): void | Emitted on native input events from generated checkbox inputs.
Forwards the original DOM |
keydown | (e: "keydown", event: KeyboardEvent): void | Emitted for keyboard interaction on generated checkbox inputs.
Forwards the original DOM |
mousedown | (e: "mousedown", event: MouseEvent): void | Emitted when a pointing device button is pressed over a checkbox input.
Forwards the original DOM |
mouseup | (e: "mouseup", event: MouseEvent): void | Emitted when a pointing device button is released over a checkbox input.
Forwards the original DOM |
update:modelValue | (e: "update:modelValue", value: any): void | Emitted with the coherent next selection array whenever selection changes. |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
append | object | Content rendered after the last option, inside the options container. |
description | BbCheckboxGroupDescriptionSlotProps | Replaces the description text. Provided alone (no |
icon | BbCheckboxGroupIconSlotProps<T> | Replaces the default checkmark icon for each checkbox option. Replaces the box visual per option, and receives |
label | BbCheckboxGroupLabelSlotProps<T> | Replaces the default label text for each option. One template for every option, scoped |
legend | BbCheckboxGroupLegendSlotProps | Replaces the default fieldset legend text for the group. Scoped |
loading | object | Content shown while options are loading (replaces the default loading text). |
no-data | object | Content shown when no options are available (replaces the default "no data" text). |
prepend | object | Content rendered before the first option, inside the options container. |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
colorremovedfails silentlyhasWarninghasWarningsfails silentlylabelPositionlegendPositionfails silently