ColorInput
高度な16進数カラー選択を可能にする統合されたカラーピッカープレビューを備えたテキスト入力。
いつ使用するか
- ユーザーが色選択をカスタマイズする必要がある場合に使用します。
基本的な使用法
最も簡単な使用法。
astro
---
import ColorInput from '@/components/data-entry/ColorInput.astro';
---
<ColorInput value="#3b82f6" /> ラベルとエラー状態
ColorInput はカスタムラベルと視覚的な検証状態をサポートします。
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" /> 無効
無効状態に設定します。
astro
---
import ColorInput from '@/components/data-entry/ColorInput.astro';
---
<ColorInput value="#a8a29e" disabled /> プロパティ
| プロパティ | 説明 | タイプ | デフォルト |
|---|---|---|---|
| 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 |