本文へ移動
セクション
Fiesta

field

フォーム 実際のフォームが取らせる状態で、人が文字を入力する欄を並べています。どれも余白のある rst-box の中に入っています。フォームを入れるカードがそれだからです。

ラベル、入力欄、任意のヒント、補足、エラー。ID を明示した、一般的なテキスト系のコントロールです。

どの例も実際に動きますが、リンクはどこにも移動しません。 HTML にはコピーできるマークアップがあります。

素のまま

プレビュー

これは <section rst-box><form rst-form> の中に置きます。

<div rst-field>
  <label rst-field-label for="f_bare">タイトル</label>
  <input rst-input type="text" id="f_bare" name="f_bare">
</div>

ヒントつき

プレビュー

これは <section rst-box><form rst-form> の中に置きます。

<div rst-field>
  <label rst-field-label for="f_hint">スラッグ <span rst-field-hint>(小文字、スペースなし)</span></label>
  <input rst-input type="text" id="f_hint" name="f_hint">
</div>

コントロールの下にヘルプつき

プレビュー

これは <section rst-box><form rst-form> の中に置きます。

<div rst-field>
  <label rst-field-label for="f_help">メールアドレス</label>
  <input rst-input type="email" id="f_help" name="f_help" autocomplete="email" aria-describedby="f_help-help">
  <p rst-field-help id="f_help-help">返信をお送りするためだけに使います。</p>
</div>

必須

プレビュー

これは <section rst-box><form rst-form> の中に置きます。

<div rst-field>
  <label rst-field-label for="f_required">氏名</label>
  <input rst-input type="text" id="f_required" name="f_required" required>
</div>

エラーつき

プレビュー

これは <section rst-box><form rst-form> の中に置きます。

<div rst-field>
  <label rst-field-label for="f_error">メールアドレス</label>
  <input rst-input type="email" id="f_error" name="f_error" value="grace@" aria-invalid="true" aria-describedby="f_error-error">
  <p rst-field-error id="f_error-error" role="alert">メールアドレスの形式ではないようです。</p>
</div>

短い

プレビュー

これは <section rst-box><form rst-form> の中に置きます。

<div rst-field>
  <label rst-field-label for="f_short">郵便番号</label>
  <input rst-input="short" type="text" id="f_short" name="f_short" value="D02 XY45">
</div>

見出しの項目

プレビュー

これは <section rst-box><form rst-form> の中に置きます。

<div rst-field>
  <label rst-field-label for="f_primary">タイトル</label>
  <input rst-input="primary" type="text" id="f_primary" name="f_primary" value="四半期の取締役会">
</div>