Skip to content

FillPickerRoot

FillPickerRoot ist ein headless popover-basiertes Füllungsauswahl-Primitiv für einfarbige, Verlaufs- und Bildfüllungen.

Props

PropDefaultType
fill*
Aktueller Füllungswert.
Fill
contentClass
Optionale Klasse für den Popover-Inhalt.
string | undefined
swatchClass
Optionale Klasse für die Standard-Trigger-Schaltfläche.
string | undefined

Ereignisse

EventPayloadDescription
updatefill: FillAusgelöst, wenn sich die Füllung ändert.

Slots

SlotPropsDescription
triggerFarbmuster-StilBenutzerdefinierter Trigger mit Farbmuster-Hintergrundstil.
defaultFüllungszustand + Konvertierungs-HilfsmittelHaupt-Füllungs-Editor-Inhalt.

Trigger-Slot-Props

ts
{
  style: Record<string, string>
}

Standard-Slot-Props

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

Beispiel

vue
<FillPickerRoot :fill="fill" @update="fill = $event">
  <template #default="{ fill, category, toSolid, toGradient, update }">
    <div>{{ category }}</div>
    <button @click="toSolid">Einfarbig</button>
    <button @click="toGradient">Verlauf</button>
    <MyFillEditor :fill="fill" @change="update" />
  </template>
</FillPickerRoot>

Verwandte APIs

Released under the MIT License.