View as Markdown

API reference: @salmonui/inputs/color-picker

ColorSwatchPropsinterface

import type { ColorSwatchProps } from '@salmonui/inputs/color-picker';
interface ColorSwatchProps {
    readonly color: ColorInput | null;
    readonly 'aria-label'?: string | undefined;
    readonly colorName?: ((color: Color) => string) | undefined;
    readonly id?: string | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
}
ColorSwatchProps members (6)
NameSignatureDescription
colorreadonly color: ColorInput | null;

The color; null draws the "no color" swatch.

aria-labeloptionalreadonly 'aria-label'?: string | undefined;

Accessible name; default the color's description ('dark vibrant green') or 'No color'. Pass '' to make it decorative.

colorNameoptionalreadonly colorName?: ((color: Color) => string) | undefined;

Replaces the English description when no aria-label is given.

idoptionalreadonly id?: string | undefined;
classNameoptionalreadonly className?: string | undefined;
styleoptionalreadonly style?: CSSProperties | undefined;