ColorInput
Eine Texteingabe mit integrierter Farbauswahlvorschau, die eine erweiterte Hex-Farbauswahl ermöglicht.
Wann zu verwenden
- Wird verwendet, wenn der Benutzer die Farbauswahl anpassen muss.
Grundlegende Verwendung
Die einfachste Verwendung.
astro
---
import ColorInput from '@/components/data-entry/ColorInput.astro';
---
<ColorInput value="#3b82f6" /> Beschriftungs- und Fehlerzustände
ColorInput unterstützt benutzerdefinierte Beschriftungen und visuelle Validierungszustände.
Invalid color selection
astro
---
import ColorInput from '@/components/data-entry/ColorInput.astro';
---
<ColorInput label="Brand Color" value="#10b981" />
<ColorInput label="Theme Color" value="#ef4444" error="Invalid color selection" /> Deaktiviert
Auf deaktivierten Zustand gesetzt.
astro
---
import ColorInput from '@/components/data-entry/ColorInput.astro';
---
<ColorInput value="#a8a29e" disabled /> Eigenschaften
| Eigenschaft | Beschreibung | Typ | Standard |
|---|---|---|---|
| value | The current hex color value. | string | '#000000' |
| label | The label to display above the input. | string | '' |
| class | Additional CSS classes for styling. | string | '' |
| error | Indicates an error state or displays an error message | string | boolean | |
| success | Indicates a success state or displays a success message | string | boolean | |
| disabled | Disables the component | boolean | false |