SColorPickerComponent
This component specify a color picker. It uses under the hood the AMAZING Pickr library with some additional features like sugar theming support as well as some events and more. Almost all the Pickr options are available through properties. Check out the api documentation for more details...
Preview
With a different format (hsla)
Loading code example. Please wait...
Just a button
Loading code example. Please wait...
Disabled
Loading code example. Please wait...
RTL Support
Loading code example. Please wait...
Features
-
All the Pickr features are supported
-
Full support for sugar theming system for easy integration
Import
Install
Events
-
s-color-picker.change
Dispatched when the color picker change the input value
-
s-color-picker
Dispatched for every events of this component. Check the detail.eventType prop for event type
Interface
-
namecolorString
Specify the name that will be assigned to the injected input if you don't provide one yourself
-
valueString
Specify the initial value for your picker
-
updateInput["pointerup","validate","eyedropper","reset","clear","close"]
- pointerdown
- pointerup
- pointermove
- validate
- eyedropper
- reset
- clear
- close
Array<String>Specify when you want to updat the attached input. Can be "pointermove", "pointerup", "pointerdown", "input", "validate", "close"
-
formathex
- hex
- hexa
- rgb
- rgba
- hsl
- hsla
StringSpecify the format of the color you want as end in the input value. Can be "hex", "hexa", "rgb", "rgba", "hsl" or "hsla"
-
inlinefalseBoolean
Specify if you want to initalize the color picker inline or if you want it to be displayed only when the focus is in the input
-
i18n{"reset":"Reset","clear":"Clear","validate":"Validate"}Object
Specify some translations for the color picker. You can translate the "reset", "clear" and "validate" buttons
-
placeholderSelect a colorString
Specify the placeholder that will be assigned to the injected input if you don't provide one yourself
-
backdropfalseBoolean
Specify if you want the ".s-backdrop" element or not
-
eyeDroppertrueBoolean
Specify if you want the eye dropper capability to pick a color anywhere on the screen or not
-
actions["reset","validate"]
- clear
- reset
- validate
Array<String>Specify the actions buttons you want to display. Can be "clear", "reset" and "validate". If false, hide all button
-
floatSettings{"position":"auto","shift":10,"offset":0,"arrow":false,"arrowSize":15,"arrowPadding":10}Object
Specify some float settings to pass to the "makeFloat" function of the sugar toolkit
-
eyeDropperIconClasss-icon s-icon--eye-dropperString
Specify the class you want to apply on the "i" that display the "eyeDropper" icon
-
copyIconClasss-icon s-icon--copyString
Specify the class you want to apply on the "i" that display the "copy" icon
-
copiedIconClasss-icon s-icon--copiedString
Specify the class you want to apply on the "i" that display the "copy" icon when the color has been copied
-
buttonIconClasss-icon s-icon--colorString
Specify the class you want to apply on the injected button icon
-
backdropClasss-backdropString
Specify the class to apply on the backdrop when the "backdrop" prop is true
-
disabledfalseBoolean
Specify if the color picker is disabled