FillPickerRoot
FillPickerRoot is a headless popover-based fill picker for solid, gradient, and image fills.
Props
| Prop | Default | Type |
|---|---|---|
fill*Current fill value. | — | Fill |
contentClassOptional class for the popover content. | — | string | undefined |
swatchClassOptional class for the default trigger button. | — | string | undefined |
Events
| Event | Payload | Description |
|---|---|---|
update | fill: Fill | Emitted when the fill changes. |
Slots
| Slot | Props | Description |
|---|---|---|
trigger | swatch style | Custom trigger with swatch background style. |
default | fill state + conversion helpers | Main fill editor content. |
Trigger slot props
ts
{
style: Record<string, string>
}Default slot props
ts
{
fill: Fill
category: 'SOLID' | 'GRADIENT' | 'IMAGE'
toSolid: () => void
toGradient: () => void
toImage: () => void
update: (fill: Fill) => void
}Example
vue
<FillPickerRoot :fill="fill" @update="fill = $event">
<template #default="{ fill, category, toSolid, toGradient, update }">
<div>{{ category }}</div>
<button @click="toSolid">Solid</button>
<button @click="toGradient">Gradient</button>
<MyFillEditor :fill="fill" @change="update" />
</template>
</FillPickerRoot>