GradientEditorStop
GradientEditorStop is a headless primitive for rendering and editing a single gradient stop.
Props
| Prop | Default | Type |
|---|---|---|
stop*Current stop value. | — | GradientStop |
index*Current stop index. | — | number |
active*Whether this stop is active. | — | boolean |
Events
| Event | Payload | Description |
|---|---|---|
select | index: number | Emitted when the stop is selected. |
updatePosition | index: number, position: number | Emitted when the stop position changes. |
updateColor | index: number, hex: string | Emitted when the stop color changes. |
updateOpacity | index: number, opacity: number | Emitted when the stop opacity changes. |
remove | index: number | Emitted when the stop is removed. |
Slots
| Slot | Props | Description |
|---|---|---|
default | stop state + update handlers | Full gradient stop render contract. |
Default slot props
ts
{
stop: GradientStop
index: number
active: boolean
positionPercent: number
opacityPercent: number
hex: string
css: string
select: () => void
updatePosition: (position: number) => void
updateColor: (hex: string) => void
updateOpacity: (opacity: number) => void
remove: () => void
}Example
vue
<GradientEditorStop :stop="stop" :index="index" :active="active" v-slot="ctx">
<MyGradientStopRow v-bind="ctx" />
</GradientEditorStop>