Skip to content

BbSwitchGroup

Manage related on/off states, including optimistic saving and application-owned rollback.

import { BbSwitchGroup } from 'bitboss-ui';

On this page

Use it for

Use BbSwitchGroup for related states of things: storefront sections, feature flags, or notification channels.

Use something else when

Pass Through

Hover or tap a part to outline it. Toggles flip loading, errors and warnings when the component has them — only parts highlight.

Shown under the label — durable context.
Guidance while the control is focused.

The items, mapping, async provider, and coherence API is shared with BbCheckboxGroup. This page covers the switch-specific decisions.

Save settings on every flip

For a live settings panel, apply the next array optimistically, hold the group readonly during the request, and restore the previous array on failure.

Sections visible in the storefront

Turn Lighting off to see a rejected save revert.

Bind :model-value with @update:model-value when rollback matters. The event carries the whole next array. Inside a submit-gated form, use ordinary v-model and do not also save on every flip.

Explain unavailable switches

max disables off switches at the cap while leaving on switches available to trade. selectable gates specific items.

Escalate toTwo teams at a time. Finance alerts are set by your admin.

2 of 2 used

State the rule in description; an unexplained switch that does not move looks broken.

Coming from v2

A disabled field on an item is ignored in v3. Move that condition into selectable. Use readonly to lock an existing selection; current disabled behavior can still allow selected rows to turn off.

Choose the model shape

Multiple mode is the default and requires a seeded array. :multiple="false" emits one bare value or null.

Primary data residencyExactly one region holds the primary copy of your data.

Model: 'IT'

In v2, :multiple="false" was accepted but ignored. Audit existing models before upgrading because v3 now changes the emitted shape.

The group renders real switches with one required legend. Use stable primitive values through item-value, not whole domain objects.