Skip to content

ColorPickerRoot ​

ColorPickerRoot udostępnia slot przycisku z wyglądem próbki, przycisk domyślny oraz slot zawartości z bieżącym kolorem i funkcją update().

vue
<ColorPickerRoot :color="color" @update="color = $event">
  <template #trigger="{ style }">
    <button class="size-6 rounded border" :style="style" />
  </template>
  <template #default="{ color, update }">
    <MyColorEditor :color="color" @change="update" />
  </template>
</ColorPickerRoot>

ColorPickerRoot

Generated from packages/vue/src/primitives/ColorPicker/ColorPickerRoot.vue

Props

PropDefaultType
color*—Color
label"Edit color"string | undefined
ui—ColorPickerUI | undefined

Events

EventPayloadDescription
update[color: Color]
openChange[open: boolean]
cancel[]

Slots

SlotPropsDescription
trigger{ style: { background: string; }; }
default{ color: Color; }

Zobacz też ​

Released under the MIT License.