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
| Prop | Type | Description |
|---|---|---|
| size | number | |
| options | string[] | |
| limit | number | "auto" | |
| value | string | string[] | |
| variant | "circular" | "rounded" | "square" | |
| onChange | (value: string | string[]) => void | |
| slotProps | { item?: DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> | undefined; itemContainer?: DetailedHTMLProps<HTMLAttributes<HTMLSpan... |
ColorPreview
| Prop | Type | Description |
|---|---|---|
| limit | number | |
| size | number | |
| gap | number | |
| colors* | string[] | |
| slotProps | { item?: DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> | undefined; label?: DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElem... |