Skip to content

Color Utils

Helpers for colour conversion and contrast on the client.

Installation

bun add @xerobi/ui
import { ColorPicker, ColorPreview } from "@xerobi/ui/color-utils"

This component is client-side. In Astro, hydrate it with a client directive.

API reference

ColorPicker

PropTypeDescription
sizenumber
optionsstring[]
limitnumber | "auto"
valuestring | string[]
variant"circular" | "rounded" | "square"
onChange(value: string | string[]) => void
slotProps{ item?: DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> | undefined; itemContainer?: DetailedHTMLProps<HTMLAttributes<HTMLSpan...

ColorPreview

PropTypeDescription
limitnumber
sizenumber
gapnumber
colors*string[]
slotProps{ item?: DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> | undefined; label?: DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElem...

Search documentation

Search pages, components and blocks.