Formulaires v1.0.0

Sélecteur de couleur

Champ de sélection de couleur avec pavé teinte/saturation, curseurs, nuancier prédéfini et saisie hex/rgb. Prend en charge le canal alpha et le mode popover compact. Inclut un canevas de saturation/luminosité déplaçable, un curseur arc-en-ciel de teinte, un curseur alpha optionnel, une saisie hex manuelle et des nuances prédéfinies cliquables. Fonctionne en autonome ou en mode compact.

Aperçu et code

Options

Nom Type Par défaut Description
value String "#3b82f6" Initial hex color value
label String nil Label text displayed above the picker
hint String nil Help text displayed below the picker
swatches Array [] Array of hex color strings for preset swatches. Defaults to a built-in palette when empty.
format Symbol :hex Output format: :hex, :rgb, or :hsl
alpha Boolean false Show alpha/opacity slider
show_input Boolean true Show text input for manual hex entry
disabled Boolean false Disable the entire color picker
error String nil Error message displayed below the picker
name String nil Name attribute for the hidden form input
compact Boolean false Compact mode — renders a small swatch trigger that opens the picker as a popover

Journal des modifications v1.0.0

- Initial release with saturation/lightness pad and hue slider
- Optional alpha channel slider
- Preset color swatches with active state ring
- Manual hex input with validation
- Compact popover mode
- Dark mode support throughout
- Hidden form input for Rails form integration

Obtenir l'accès complet

Débloquez le code source de ce composant et de tous les autres. Paiement unique pour un accès à vie.

Obtenir l'accès maintenant