Props
| Name | Type | Default | Description |
|---|---|---|---|
activator | ElementOrComponentRef | undefined | - | External activator element or component ref.
When provided, the The escape hatch for a trigger you already hold — a component ref, a control from elsewhere. When set, the |
adaptive | boolean | undefined | `config.adaptive` (`true`) | When On a viewport below |
alpha | boolean | undefined | false | Enable the alpha channel. The picker shows an opacity slider and emits
Enable it wherever eight-digit values can occur: an incoming |
anchor | ElementOrComponentRef | undefined | - | Element or component ref the popover positions itself relative to. Defaults to the activator element when omitted, allowing the popover to be anchored to a larger container (e.g. the full input row) while a smaller element (e.g. a color dot) remains the click target. The prop form of the slot scope's |
boundary | ElementOrComponentRefOrSelector | undefined | - | Constrains the popover within a bounding element. Accepts an HTMLElement, a Vue component ref, or a CSS selector string. Reach for it when the palette lives inside a panel that scrolls, so the popover is kept in the panel rather than in the viewport. See example |
disabled | boolean | undefined | false | Disable all interaction (activator and palette). Blocks the activator entirely. The slot scope mirrors it as |
disableFlip | boolean | undefined | false | Disables the automatic flip to the opposite side when the popover would overflow (flipping is on by default). v2 spelled this |
eager | boolean | undefined | false | Prevents rendering content before it's made visible. Off by default, so the palette body mounts lazily on first open. Turn it on only for measurement or SSR — not to make the popover feel faster. |
eyeDropper | boolean | undefined | false | Show an eyedropper button inside the palette to sample any color on screen. Uses the native EyeDropper API — hidden automatically on unsupported browsers. The button renders only where the browser implements the native |
label | string | undefined | - | Accessible label applied to the activator element via On a bare color dot this is the only accessible name there is, and it also names the mobile sheet. Say which color is being changed — "Color for the bug label" — rather than accepting the generic fallback. See example |
modelValuerequired | string | null | - | v-model: the current color as a |
offCanvasProps | Partial<BbOffCanvasProps> | undefined | - | Props for the phone sheet. A |
offset | number | undefined | 4 | Space the floating container will maintain from the activator. |
padding | number | undefined | 6 | Minimum empty space to keep from the edge of the page |
placement | Placement | undefined | - | Position of the overlay in respect to the related activator. A preference, not a guarantee: the popover flips to the opposite side when it would overflow, unless |
pt | (PtMap<BbColorPalettePtPart, "open"> & { 'swatch:selected'?: PtValue | undefined; }) | undefined | - | Passthrough, object form: the same keys as the |
pt:panel | PtValue | undefined | - | |
pt:panel:open | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:open | PtValue | undefined | - | |
pt:sheet | PtValue | undefined | - | |
pt:sheet:open | PtValue | undefined | - | |
pt:swatch | PtValue | undefined | - | |
pt:swatch:open | PtValue | undefined | - | |
pt:swatch:selected | PtValue | undefined | - | |
readonly | boolean | undefined | false | Prevent opening the palette while keeping the activator visible. Keeps the activator visible and focusable and never opens the palette. Prefer it to a disabled-looking custom style for a review state, so the color stays in the reading order. See example |
swatches | boolean | string[][] | undefined | - | Controls swatches display in the picker:
- Each inner array is a **column** of shades, so ramps are designed vertically. A row-wise |
transitionDuration | number | undefined | 250 | How long the transition has to last in milliseconds |
v-model
Values kept in sync through v-model.
| Name | Type | Description |
|---|---|---|
modelValue | string | null | Seed it explicitly — |
Events
| Name | Type | Description |
|---|---|---|
hidden | (event: "hidden"): void | |
hide | (event: "hide"): void | |
show | (event: "show"): void | |
shown | (event: "shown"): void | |
update:modelValue | (event: "update:modelValue", value: string): void | Drag-frequency, not a commit: it fires on every frame while a handle moves. Repaint from it freely, debounce anything that persists. In v3 the payload is always a concrete color, so a handler narrowing on |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
activator | BbColorPaletteActivatorSlotProps | Custom activator element.
Apply The scope also carries |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
arrowPaddingremovedfails silentlyflipdisableFlipfails silentlypickereyeDropperfails silentlyshowArrowremovedfails silently