@cas-smartdesign/swatch-picker
v5.0.9
Published
A color picker element which has the look and feel of the SmartDesign 3.0 color picker
Readme
@cas-smartdesign/swatch-picker
A color picker element.
This element must be used together with the design tokens of SmartDesign. For an independent application, make sure to include the @cas-smartdesign/design-tokens package. For a web app / web widget, refer to the official documentation about design token usage.
Attributes
color: string- Defines the color of the icon and the value of the element
columncount: number- Defines the number of columns
colorsize: number- Defines the size of the individual colors on the palette
aria-disabled: "true" | "false"- Disables the picker when "true", the attribute of the
disabledproperty
- Disables the picker when "true", the attribute of the
Properties
colorList: string[]- Defines the color palette used by the element, if null then default color palette will be used
disabled: boolean- A disabled picker does not open. Disabling it while the palette is open closes the palette and restores the color it was opened with, like Escape, without a value change event
CSS Custom Properties
--sd-swatch-picker-icon-color- Defines the color of the icon (default is var(--color-fg-action-accent-default, #1467ba))
--sd-swatch-picker-inactive-icon-color- Defines the color of the icon with a disabled picker state (default is var(--color-fg-interaction-disabled, #999))
Custom events
sd-swatch-picker-value-change- This event is dispatched when the value (color) of the picker has changed by the User. The detail contains the updated color.
