Color Picker
Allow users to select a color from a color palette.
Anchor to propertiesProperties
- Anchor to alphaalphaboolean
Allow user to select an alpha value.
- Anchor to defaultValuedefaultValuestring
The default value for the field.
- Anchor to formResetCallbackformResetCallback() => void
- Anchor to namenamestring
An identifier for the field that is unique within the nearest containing form.
- Anchor to valuevaluestring
The currently selected color.
Supported formats include:
- HSL @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl
- HSLA @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsla
- RGB @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb
- RGBA @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb
- Hex (3-value, 4-value, 6-value, 8-value) @see https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color
For RGB and RGBA, both the legacy syntax (comma-separated) and modern syntax (space-separate) are supported.
Was this section helpful?
Anchor to eventsEvents
Learn more about registering events.
- Anchor to changechangeCallbackEventListener<typeof tagName> | null
- Anchor to inputinputCallbackEventListener<typeof tagName> | null
CallbackEventListener
(EventListener & {
(event: CallbackEvent<T>): void;
}) | null
CallbackEvent
Event & {
currentTarget: HTMLElementTagNameMap[T];
}
Was this section helpful?
Code
<s-color-picker
value="#FF0000"
alpha
></s-color-picker>
Examples
Code
Default
<s-color-picker value="#FF0000" alpha ></s-color-picker>