Input
한 줄의 텍스트를 입력받습니다.
사용법
레이블을 항상 표시하고 제출 전에 입력 조건을 안내하세요.
접근성
htmlFor와 id로 연결하세요. 오류에는 aria-invalid, 도움말에는 aria-describedby를 사용합니다. leadingIcon은 장식에 사용하세요. 포커스를 유지한 채 아이콘을 숨기려면 null을 전달하세요.
| 속성 | 타입 | 기본값 |
|---|---|---|
| type | Native HTML input type | text |
| disabled / readOnly | boolean | false |
| aria-invalid | boolean | None |
| leadingIcon | ReactNode | None |
| ref | HTMLInputElement | None |
<label htmlFor="project">Project name</label>
<Input id="project" placeholder="Your next idea"
aria-describedby="project-hint"
leadingIcon={
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinejoin="round">
<path d="M3 6h6l2 2h10v11H3z" />
</svg>
} />
<p id="project-hint">Use a short, memorable name.</p>