Oddmash UI
すべてのコンポーネント

Input

一行のテキストを入力します。

使い方

ラベルを常に表示し、送信前に入力条件を伝えます。

アクセシビリティ

htmlFor と id で結び付け、エラーには aria-invalid、補足には aria-describedby を使います。leadingIcon は装飾に使用してください。フォーカスを保ってアイコンを隠すには null を渡します。

プロパティ型既定値
typeNative HTML input typetext
disabled / readOnlybooleanfalse
aria-invalidbooleanNone
leadingIconReactNodeNone
refHTMLInputElementNone
<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>

インタラクティブなドキュメント