Props
| Name | Description |
|---|---|
activator Type: ElementOrComponentRef | 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 Type: booleanDefaultconfig.adaptive (true) | When Below |
alpha Type: booleanDefaultfalse | Enable the alpha channel. The picker shows an opacity slider and emits Enable it wherever eight-digit values can occur: an incoming |
anchor Type: ElementOrComponentRef | 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 Type: ElementOrComponentRefOrSelector | Constrains the popover within a bounding element: it stays inside it alongside its trigger (sideways for a popover above or below); away from the trigger it may pass the edge, and it flips at the viewport only. 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. |
disabled Type: booleanDefaultfalse | Disable all interaction (activator and palette). Stops the palette opening. The activator |
disableFlip Type: booleanDefaultfalse | Disables the automatic flip to the opposite side when the popover would overflow (flipping is on by default). v2 spelled this |
eager Type: booleanDefaultfalse | Renders the palette panel at mount instead of on the first open (the phone sheet's too). 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 Type: booleanDefaultfalse | 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 Type: string | Accessible label. The activator is named by it followed by the activator's own text, through The trigger is named by this text followed by whatever the trigger shows (a hex code, say), and the mobile sheet by the same pair. On a bare colour dot it is the whole name, so say which colour is being changed ("Colour for the bug label") rather than accepting the generic fallback. See example |
modelValue requiredType: string | null | v-model: the current color as a |
offCanvasProps Type: Partial<BbOffCanvasProps> | Props for the phone sheet (the |
offset Type: numberDefault4 | Space the floating container will maintain from the activator. |
padding Type: numberDefault6 | Minimum empty space to keep from the edge of the page |
placement Type: Placement | 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 Type: (PtMap<BbColorPalettePtPart, "open"> & { 'swatch:selected'?: PtValue | undefined; }) | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | Passthrough, attribute form: one attribute per part, |
readonly Type: booleanDefaultfalse | 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 colour stays in the reading order. See example |
swatches Type: boolean | string[][] | Controls swatches display in the picker:
- Each inner array is a column of shades, so ramps are designed vertically. A row-wise |
transitionDuration Type: numberDefault250 | How long the transition has to last in milliseconds |
v-model
Values kept in sync through v-model.
| Name | Description |
|---|---|
modelValue Type: string | null | Seed it explicitly: |
Events
| Name | Description |
|---|---|
hide Type: (): void | Emitted as soon as the palette starts to close. |
show Type: (): void | Emitted as soon as the palette (the popover, or the sheet on a phone) starts to open. |
shown Type: (): void | Emitted once the palette is open and its open transition has finished. |
update:modelValue Type: (value: string): void | Emitted when a color is picked. Payload is a concrete 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 | Description |
|---|---|
activator Type: BbColorPaletteActivatorSlotProps | Custom activator element. Apply Spread |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
arrowPaddingremovedfails silentlyflipdisableFlipfails silentlypickereyeDropperfails silentlypt:panel:selectedremovedfails silentlyIt never applied anything:
selectedis a state ofswatchonly (pt:swatch:selected)pt:root:selectedremovedfails silentlyIt never applied anything:
selectedis a state ofswatchonly (pt:swatch:selected)pt:sheet:selectedremovedfails silentlyIt never applied anything:
selectedis a state ofswatchonly (pt:swatch:selected)showArrowremovedfails silently- event
update:openremovedfails silently