openpencil/packages/docs/programmable/sdk/api/components/fill-picker-root.md
2026-03-24 23:24:08 +03:00

1.6 KiB

title description
FillPickerRoot Headless popover-based fill picker primitive.

FillPickerRoot

FillPickerRoot is a headless popover-based fill picker for solid, gradient, and image fills.

Props

Events

Slots

Trigger slot props

{
  style: Record<string, string>
}

Default slot props

{
  fill: Fill
  category: 'SOLID' | 'GRADIENT' | 'IMAGE'
  toSolid: () => void
  toGradient: () => void
  toImage: () => void
  update: (fill: Fill) => void
}

Example

<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>