API reference: @salmonui/inputs/color-picker
ColorSwatchcomponent
import { ColorSwatch } from '@salmonui/inputs/color-picker';function ColorSwatch(props: ColorSwatchProps): ReactNode;
A color preview: role="img" named by the color, the
color over a checkerboard so alpha shows, or a struck-through box for no
color. Pure markup, server rendered.
Props: ColorSwatchProps
| Name | Signature | Description |
|---|---|---|
color | readonly color: ColorInput | null; | The color; |
aria-labeloptional | readonly 'aria-label'?: string | undefined; | Accessible name; default the color's description ( |
colorNameoptional | readonly colorName?: ((color: Color) => string) | undefined; | Replaces the English description when no |
idoptional | readonly id?: string | undefined; | |
classNameoptional | readonly className?: string | undefined; | |
styleoptional | readonly style?: CSSProperties | undefined; |