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 |