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>