複数ステップのタスクは、いくつかのことを順番に尋ねます。進行状況が現在地を示し、取り組むステップは 1 つだけで、その操作で先へ進んだり戻ったりします。フレームはページなので、ドキュメント全体がスクロールし、操作ボタンはフォームの流れの中で、その末尾に置かれます。この例では、ワークスペースを 3 ステップで設定し、入力内容はページ自体のメモリーに保持します。
複数ステップのタスク
<div class="page bg-surface-base fg-text-body text-sm" data-example="multi-step"> <header class="navbar" style="--navbar-padding-x: max(1.5rem, calc(50% - 26rem))"> <a class="navbar-brand" href="#"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <circle cx="8" cy="8" r="6" /> <path d="M8 4.3333A3.6667 3.6667 0 0 1 8 11.6667Z" fill="currentColor" stroke="none" /> </svg>Atlas</a> <a class="btn btn-quiet btn-sm ml-auto shrink(1)" href="#">Save and exit</a> </header> <main class="grow(1) w-full max-w(880) mx-auto px-lg pt-xl pb-2xl container-inline"> <header class="flex flex-col gap-3xs mb-xl"> <h1 class="heading heading-xl">Set up your workspace</h1> <p class="m(0) fg-text-muted">Three steps, about two minutes. Everything here can be changed later in settings.</p> </header> <nav class="mb-xl max-w(560) hidden@container(--3xl)" aria-label="Progress"> <ol class="steps" data-ms-progress="short"> <li class="steps-item basis-auto"> <a class="steps-title link link-quiet" href="#ms-details">Basic details</a> </li> <li class="steps-item basis-auto"> <a class="steps-title link link-quiet" href="#ms-preferences">Preferences</a> </li> <li class="steps-item basis-auto"> <span class="steps-title">Review</span> </li> </ol> </nav> <div class="flex gap-2xl items-start"> <nav class="w(224) shrink(0) sticky top(72) hidden block@container(--3xl)" aria-label="Progress"> <ol class="steps steps-vertical" data-ms-progress> <li class="steps-item"> <span class="steps-body"> <a class="steps-title link link-quiet" href="#ms-details">Basic details</a> <span class="steps-description">Name, address and contact</span> </span> </li> <li class="steps-item"> <span class="steps-body"> <a class="steps-title link link-quiet" href="#ms-preferences">Preferences</a> <span class="steps-description">Alerts and region</span> </span> </li> <li class="steps-item"> <span class="steps-body"> <span class="steps-title">Review</span> <span class="steps-description">Check, then create</span> </span> </li> </ol> </nav> <div class="grow(1) basis(0) min-w(0) max-w(560)"> <div data-ms-task> <form class="form" method="post"> <section id="ms-details" data-ms-step aria-labelledby="ms-details-title"> <div class="form-fields"> <div class="flex flex-col gap-3xs"> <h2 class="heading scroll-mt(72)" id="ms-details-title" tabindex="-1"> <span class="sr-only">Step 1 of 3:</span>Basic details</h2> <p class="m(0) fg-text-muted">What the workspace is called and who answers for it.</p> </div> <div class="field"> <label for="ms-name">Workspace name</label> <input class="input" id="ms-name" name="name" autocomplete="organization" required pattern=".*\S.*" data-error="ms-name-error"> <span class="field-error" id="ms-name-error">Enter a name for the workspace.</span> </div> <div class="field"> <label for="ms-slug">Address</label> <div class="input-group"> <span class="input-group-addon">atlas.dev/</span> <input class="input-group-field" id="ms-slug" name="slug" autocomplete="off" autocapitalize="none" spellcheck="false" pattern="[a-z0-9]+(-[a-z0-9]+)*" required aria-describedby="ms-slug-hint" data-error="ms-slug-error"> </div> <span class="field-hint" id="ms-slug-hint">Lowercase letters, numbers and hyphens.</span> <span class="field-error" id="ms-slug-error">Enter an address in lowercase letters, numbers and hyphens, such as atlas-labs.</span> </div> <div class="field"> <label for="ms-email">Contact email</label> <input class="input" id="ms-email" type="email" name="email" autocomplete="email" placeholder="you@company.com" required data-error="ms-email-error"> <span class="field-error" id="ms-email-error">Enter an email address, such as you@company.com.</span> </div> </div> </section> <section id="ms-preferences" data-ms-step aria-labelledby="ms-preferences-title"> <div class="form-fields"> <div class="flex flex-col gap-3xs"> <h2 class="heading scroll-mt(72)" id="ms-preferences-title" tabindex="-1"> <span class="sr-only">Step 2 of 3:</span>Preferences</h2> <p class="m(0) fg-text-muted">How Atlas reaches you, and where it builds.</p> </div> <fieldset class="fieldset gap-sm"> <legend class="fieldset-legend">Where should deployment alerts go?</legend> <div class="auto-grid auto-grid-fit gap-sm" style="--auto-grid-min: 11rem"> <label class="choice"> <input type="radio" class="radio" name="alerts" value="email" checked> <span class="choice-body"> <span class="choice-title">Email</span> <span class="choice-description">To the contact address, as each deployment fails.</span> </span> </label> <label class="choice"> <input type="radio" class="radio" name="alerts" value="phone"> <span class="choice-body"> <span class="choice-title">Phone</span> <span class="choice-description">A text message, for production only.</span> </span> </label> <label class="choice"> <input type="radio" class="radio" name="alerts" value="none"> <span class="choice-body"> <span class="choice-title">None</span> <span class="choice-description">Nothing is sent. Failures show in the dashboard.</span> </span> </label> </div> </fieldset> <div data-ms-phone> <div class="field"> <label for="ms-phone">Phone number</label> <input class="input" id="ms-phone" type="tel" name="phone" autocomplete="tel" pattern="\+?[0-9][0-9 \-]{6,}" aria-describedby="ms-phone-hint" data-error="ms-phone-error"> <span class="field-hint" id="ms-phone-hint">Needed only when alerts go to a phone. Include the country code.</span> <span class="field-error" id="ms-phone-error">Enter a phone number with its country code, such as +886 912 345 678.</span> </div> </div> <div class="field"> <label for="ms-region">Default region</label> <select class="select" id="ms-region" name="region" aria-describedby="ms-region-hint"> <option class="select-option" value="Tokyo (hnd1)">Tokyo (hnd1)</option> <option class="select-option" value="Singapore (sin1)">Singapore (sin1)</option> <option class="select-option" value="Frankfurt (fra1)">Frankfurt (fra1)</option> <option class="select-option" value="Washington, D.C. (iad1)">Washington, D.C. (iad1)</option> </select> <span class="field-hint" id="ms-region-hint">Where new projects are built and served.</span> </div> </div> </section> <section id="ms-review" data-ms-step data-ms-review aria-labelledby="ms-review-title" hidden> <div class="form-fields"> <div class="flex flex-col gap-3xs"> <h2 class="heading scroll-mt(72)" id="ms-review-title" tabindex="-1"> <span class="sr-only">Step 3 of 3:</span>Review</h2> <p class="m(0) fg-text-muted">Check what you entered, then create the workspace.</p> </div> <div class="flex flex-col gap-2xs"> <div class="flex items-center justify-between gap-sm"> <h3 class="heading heading-xs">Basic details</h3> <button type="button" class="btn btn-quiet btn-sm btn-hang-end" data-ms-edit="0">Edit <span class="sr-only">basic details</span> </button> </div> <dl class="data-list"> <div class="data-list-item"> <dt class="data-list-term min-w(128)">Workspace name</dt> <dd class="data-list-value" data-ms-value="name"></dd> </div> <div class="data-list-item"> <dt class="data-list-term">Address</dt> <dd class="data-list-value" data-ms-value="address"></dd> </div> <div class="data-list-item"> <dt class="data-list-term">Contact email</dt> <dd class="data-list-value" data-ms-value="email"></dd> </div> </dl> </div> <div class="flex flex-col gap-2xs"> <div class="flex items-center justify-between gap-sm"> <h3 class="heading heading-xs">Preferences</h3> <button type="button" class="btn btn-quiet btn-sm btn-hang-end" data-ms-edit="1">Edit <span class="sr-only">preferences</span> </button> </div> <dl class="data-list"> <div class="data-list-item"> <dt class="data-list-term min-w(128)">Deployment alerts</dt> <dd class="data-list-value" data-ms-value="alerts"></dd> </div> <div class="data-list-item"> <dt class="data-list-term">Default region</dt> <dd class="data-list-value" data-ms-value="region"></dd> </div> </dl> </div> </div> </section> <div class="form-actions"> <button type="button" class="btn hidden" data-ms-back>Back</button> <button class="btn btn-primary" data-ms-next>Create workspace</button> </div> </form> </div> <div data-ms-done hidden> <div class="flex flex-col items-start gap-md"> <span class="icon-frame icon-frame-success" aria-hidden="true"> <svg class="icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M3.5 10L7.8545 14.3545A0.2 0.2 0 0 0 8.1413 14.3504L16.5 5.5" /> </svg> </span> <div class="flex flex-col gap-3xs"> <h2 class="heading scroll-mt(72)" tabindex="-1" data-ms-done-title>Workspace created</h2> <p class="m(0) fg-text-muted"> <span class="fg-text-strong" data-ms-value="name"></span>is ready at <span class="fg-text-strong" data-ms-value="address"></span>. This example keeps what you typed in memory only: nothing was sent.</p> </div> <button type="button" class="btn" data-ms-restart>Start over</button> </div> </div> </div> </div> </main></div>/** * A workspace set up in three steps, with nowhere to send it. The markup is one whole form in order, which is * what a browser without this module shows. The module divides it: it shows one step at a time, moves * aria-current along the progress, checks the step in hand before going on, and at the end swaps the form * for the result. What was typed stays in the fields, and where the reader is stays in `state`; nothing is * stored and nothing leaves the page. In a product each step is a route and the server keeps the draft. * Returns the function that stops it and puts the whole form back. */export function mount(root) { const controller = new AbortController() const { signal } = controller const task = root.querySelector('[data-ms-task]') const form = task.querySelector('.form') const steps = [...form.querySelectorAll('[data-ms-step]')] const review = form.querySelector('[data-ms-review]') const back = form.querySelector('[data-ms-back]') const next = form.querySelector('[data-ms-next]') const done = root.querySelector('[data-ms-done]') const phone = form.querySelector('[data-ms-phone]') // The same three steps twice: the vertical list of a wide page and the short row of a narrow one. const lists = [...root.querySelectorAll('[data-ms-progress]')].map(list => ({ list, short: list.dataset.msProgress === 'short', items: [...list.querySelectorAll('.steps-item')] })) const last = steps.length - 1 const submitLabel = next.textContent // Where the reader is, the furthest step they have reached, and whether the task is finished. const state = { step: 0, reached: 0, done: false } /** * A step's name in the progress is a link while the step can be opened and plain words while it cannot, as * the steps component asks: the element is replaced only when that changes. */ const name = (item, index, open) => { const old = item.querySelector('.steps-title') if ((old.localName === 'a') === open) return old const title = document.createElement(open ? 'a' : 'span') title.className = open ? 'steps-title link link-quiet' : 'steps-title' title.textContent = old.textContent if (open) title.href = `#${steps[index].id}` old.replaceWith(title) return title } const headingOf = (step) => steps[step].querySelector('.heading') const controlsOf = (step) => [...steps[step].querySelectorAll('input, select, textarea')].filter(control => control.willValidate) /** * A field's error is read with the field only while it shows: its id joins aria-describedby, after the hint, * while the field is marked or the browser reports it, and leaves when the value is valid again. */ const describe = (control) => { if (!control.dataset?.error) return const invalid = !control.validity.valid && (control.getAttribute('aria-invalid') === 'true' || control.matches(':user-invalid')) if (control.validity.valid) control.removeAttribute('aria-invalid') const ids = (control.getAttribute('aria-describedby') ?? '').split(' ').filter(id => id && id !== control.dataset.error) if (invalid) ids.push(control.dataset.error) if (ids.length) control.setAttribute('aria-describedby', ids.join(' ')) else control.removeAttribute('aria-describedby') } /** * The browser holds the rules (required, type, pattern) and shows a field's error once the reader has edited * it. A field never touched has to be marked here, with aria-invalid, when Next is pressed: a submit would mark * every field of the form as tried, the ones in steps not reached yet among them. Focus goes to the first. */ const check = (step) => { const invalid = controlsOf(step).filter(control => !control.validity.valid) for (const control of invalid) { control.setAttribute('aria-invalid', 'true') describe(control) } if (!invalid.length) return true if (state.step !== step) { state.step = step render() } invalid[0].focus() return false } // The phone number is asked for, and required, only while alerts go to a phone. const askPhone = () => { const field = phone.querySelector('.input') const wanted = form.elements.alerts.value === 'phone' phone.hidden = !wanted field.disabled = !wanted field.required = wanted if (!wanted) field.removeAttribute('aria-invalid') // An error that no longer shows is no longer read with the field when it comes back. describe(field) } const values = () => { const written = new FormData(form) const text = (name) => String(written.get(name) ?? '').trim() const alerts = { email: `Email to ${text('email')}`, phone: `Text message to ${text('phone')}`, none: 'None' } return { name: text('name'), address: `atlas.dev/${text('slug')}`, email: text('email'), alerts: alerts[text('alerts')], region: text('region') } } const render = () => { task.hidden = state.done done.hidden = !state.done steps.forEach((step, index) => { step.hidden = index !== state.step }) // A button's own display outranks the hidden attribute, so Back leaves with the utility of that name. back.classList.toggle('hidden', state.step === 0) next.textContent = state.step === last ? submitLabel : 'Next' for (const { list, short, items } of lists) { list.classList.toggle('steps-complete', state.done) items.forEach((item, index) => { const current = !state.done && index === state.step // A step already reached is a link back to it; the current one and the ones ahead are plain words. const open = !state.done && !current && index <= state.reached if (current) item.setAttribute('aria-current', 'step') else item.removeAttribute('aria-current') // In the short row the other steps' names are not drawn, and a link nobody can see is not one to tab to or // to tap: there a step already reached is words, and Back is the way to it. const title = name(item, index, open && !short) // The short row shows the current step's name; the others keep theirs for assistive technology. if (short) title.classList.toggle('sr-only', !current) }) } // What was typed is set as text, never as markup. if (state.done || state.step === last) { const written = values() for (const slot of root.querySelectorAll('[data-ms-value]')) slot.textContent = written[slot.dataset.msValue] } } /** * Going on checks every step passed on the way and stops at the first that fails. Going back checks nothing: * a reader may leave a step half written and find it as they left it. */ const go = (target) => { for (let step = state.step; step < target; step++) if (!check(step)) return state.step = target state.reached = Math.max(state.reached, target) render() headingOf(target).focus() } const advance = () => { if (state.step < last) return go(state.step + 1) for (let step = 0; step < last; step++) if (!check(step)) return state.done = true render() done.querySelector('[data-ms-done-title]').focus() } next.addEventListener('click', advance, { signal }) back.addEventListener('click', () => go(state.step - 1), { signal }) // Next is not a submit button, so Enter in a field is given the same meaning here. form.addEventListener('keydown', (event) => { if (event.key !== 'Enter' || event.isComposing || !event.target.matches('input')) return event.preventDefault() advance() }, { signal }) form.addEventListener('submit', event => event.preventDefault(), { signal }) for (const type of ['input', 'change', 'focusout']) { form.addEventListener(type, event => describe(event.target), { signal }) } form.addEventListener('change', (event) => { if (event.target.name === 'alerts') askPhone() }, { signal }) // A step already reached is opened from the progress, and from Edit in the review. for (const { list, items } of lists) { list.addEventListener('click', (event) => { const title = event.target.closest('a.steps-title') if (!title) return event.preventDefault() go(items.indexOf(title.closest('.steps-item'))) }, { signal }) } for (const edit of form.querySelectorAll('[data-ms-edit]')) { edit.addEventListener('click', () => go(Number(edit.dataset.msEdit)), { signal }) } const clear = () => { form.reset() for (const control of form.querySelectorAll('[data-error]')) { control.removeAttribute('aria-invalid') describe(control) } Object.assign(state, { step: 0, reached: 0, done: false }) } root.querySelector('[data-ms-restart]').addEventListener('click', () => { clear() askPhone() render() headingOf(0).focus() }, { signal }) next.type = 'button' askPhone() render() return () => { controller.abort() clear() // The whole form again, in order, as the markup has it. task.hidden = false done.hidden = true steps.forEach((step) => { step.hidden = step === review }) back.classList.add('hidden') next.type = 'submit' next.textContent = submitLabel phone.hidden = false phone.querySelector('.input').disabled = false phone.querySelector('.input').required = false for (const { list, items } of lists) { list.classList.remove('steps-complete') items.forEach((item, index) => { item.removeAttribute('aria-current') // The review holds no field, so the whole form has nothing to link its step to. name(item, index, steps[index] !== review).classList.remove('sr-only') }) } }}#構成
- タスク用のヘッダーを持つページ。 ナビゲーションバーには、ブランドと、出口を 1 つだけ置きます。
ml-autoで末尾に寄せた、控えめな「Save and exit」です。タスクにはメインナビゲーションを置きません。ほかのリンクはどれも、作業内容を失う原因になるからです。 - タスクの幅は 1 つ。 メイン領域は
max-w(880) mx-auto px-lgで、サイズコンテナーcontainer-inlineでもあります。残る幅は 832px です。w(224)の進行状況カラム、48px のgap-2xl、そしてmax-w(560)のフォームで、これはフィールドを 1 列に並べて読みやすい幅です。 - 進行状況にはステップ。
aria-current="step"を持つのは現在の項目だけです。スタイルシートは、それより前のステップを完了として、後のステップを未着手として描きます。開くことのできるステップの名前は控えめなリンクで、それ以外はただのテキストです。 - タスク全体で 1 つのフォーム。 各ステップは、見出しを名前とする
<section>で、フィールドはform-fieldsに入れます。そのため、フィールドどうしの間隔はフォームの 1.25rem に保たれます。2 つ目のステップの選択肢は選択カードブロックです。質問を legend とする<fieldset>と、選択肢を並べた自動グリッドで構成し、フォームのカラムでは横に 3 つ、スマートフォンでは縦に 1 つずつ並びます。 - フォームの末尾に
form-actions。 ソースでは「Back」が先、確定ボタンが最後です。フォームが 24rem 未満になると、確定ボタンを先にして全幅で積み重なります。スマートフォンはこの状態になります。ビューポートの下端には何も固定しません。そこに置いたバーは、キーボードが開くと、その上のフィールドを覆ってしまいます。 - 確認画面は、ステップごとのデータリストです。 それぞれ、ステップの名前と、そのステップを開く「Edit」ボタンの下に置きます。ボタンは控えめなスタイルで、
btn-hang-endを指定しているため、ボタンの文字は、値が届く端で終わります。
#幅ごとの進行状況
ページは進行状況を 2 つ持ち、そのうち 1 つを表示します。
- メイン領域が 48rem 以上のとき フォームの横に並ぶ
steps steps-verticalのリストです。各ステップに、名前と、そこで尋ねる内容を説明する 1 行があります。リストはsticky top(72)、つまり 56px のナビゲーションバーの 16px 下に固定されるため、長いステップをスクロールしても見えたままです。 - 48rem 未満のとき フォームの上に置いた 1 行の
stepsです。この行に表示する名前は現在のステップだけで、ほかの 2 つの名前はsr-onlyです。そのため、位置はマーカーと線が示し、名前はすべて読み上げられます。
1 行のほうには hidden@container(--3xl)、カラムのほうには hidden block@container(--3xl) を指定します。表示されていないほうは display: none になるため、支援技術でもキーボードでも、進行状況は 1 つだけになります。
3 つの名前をすべて載せたステップの行は、スマートフォンには収まりません。コンポーネントは、収まらない名前を省略記号で切り詰めます。名前が 1 つなら、390px でも行全体が収まります。行の各項目は basis-auto なので、現在のステップは名前に必要な幅を取り、残りをほかの 2 つが分け合います。文字サイズを 2 倍にしたスマートフォンでは、その 1 つの名前も切り詰められますが、行の下の見出しが名前を省略せずに伝えます。
#スクリプトが決めること
マークアップは、フォーム全体を順番どおりに書いたものです。フィールドのある 2 つのステップが続き、最後にフォームを送信するボタンが 1 つあります。これをステップに分けるのは例のモジュールです。ブラウザーとスタイルシートが大半の処理を担うため、モジュールは短く済みます。
- ルールはブラウザーが持ちます。
required、type="email"、patternが有効な値を定め、モジュールはvalidity.validを読み取るだけです。各フィールドはfield-errorにメッセージを持ちます。入力フィールドのスタイルシートは、フィールドが無効な間だけこれを表示し、有効になると再び隠します。 :user-invalidは、利用者がフィールドを編集した後にエラーを表示します。 これにスクリプトは不要です。一度も触れていないフィールドは別です。「Next」は、そのステップで検証に通らないすべてのフィールドにaria-invalid="true"を設定して同じ状態を描画し、値が有効になったフィールドから順に外します。- 「Next」はボタンであり、送信ボタンではありません。 送信を試みると、フォームのすべてのフィールドが試行済みとして扱われます。まだ到達していないステップのフィールドも含まれるため、それらは最初からエラーの状態で開くことになります。そのためモジュールは、進行中のステップを自分で検証し、フィールドでの Enter に「Next」と同じ意味を持たせます。
- フォーカスは利用者を追います。 ステップが検証に通らないと、フォーカスは最初の無効なフィールドに移ります。ステップが変わると、フォーカスは新しいステップの見出しに移ります。見出しは、「Step 2 of 3: Preferences」のように、ステップとその位置を伝えます。
- 戻るときは何も検証しません。 「Back」、進行状況のステップ名、確認画面の「Edit」は、どれも現在のステップを、書きかけであってもそのまま残します。フィールドはドキュメントから外れないため、すべての値が保たれます。先へ進むときは、途中の各ステップを検証し、最初に通らなかったステップで止まります。まだ到達していないステップはリンクではないため、そこへ飛ぶことはできません。
- 回答に応じて変わるフィールド。 電話番号は、通知を電話で受け取る場合にだけ表示され、必須になります。表示されていない間は
disabledなので、検証も送信もされません。
製品では、この大部分をルーターとサーバーが担います。
- ステップごとのルート。 たとえば
/setup/detailsと/setup/preferencesです。この場合、各ステップは独立したフォームになり、「Next」はその送信ボタンになります。ブラウザーの「戻る」や再読み込みも、利用者の期待どおりに動きます。進行状況のリンクは、これらのルートへの実際のリンクです。 - サーバーはすべてのステップをもう一度検証し、見つけたエラーを返します。エラーは同じ方法で表示します。フィールドに
aria-invalid="true"を設定し、メッセージをそのfield-errorに入れます。 - 下書きはサーバーが保持します。 「Next」のたびにそのステップの内容を保存し、「Save and exit」は保存してから離れます。確認画面は、フィールドではなく下書きを読み出します。到達した最も先のステップも下書きの一部で、サーバーはそれより先のルートを拒否します。
#使い分け
ステップは、順序に意味があるときに使います。後のステップが前の回答に左右される場合や、全体を一度に示すと多すぎる場合です。ステップ数は 3 から 5 が目安です。それより多い場合は、タスクの後に回せるものがないかを検討します。
- グループが互いに独立していて、利用者がそのうちの 1 つを変えるために戻ってくる場合は、設定ページを使います。設定ページのナビゲーションでは、どのグループも好きな順序で開けます。
- すべてが 1 画面に収まる場合は、単一のフォームを使います。ステップに分けると、利用者は全体を見渡せなくなり、部分ごとに押下が 1 回増えます。
- ログインのように、前後に何もない短いタスクが 1 つだけの場合は、中央配置ページを使います。
#アクセシビリティ
- ランドマークは、ヘッダー、メイン領域、「Progress」という名前のナビゲーション 1 つです。進行中のステップは、見出しを名前とする
<section>です。 - 進行状況は
<ol>なので、リストがステップの数を伝えます。現在のステップはaria-current="step"を持ちます。短い行でも、表示されていない名前はリストに残っています。 - ステップが変わると、フォーカスはその見出しに移ります。見出しには
tabindex="-1"とscroll-mt(72)を指定しているため、スティッキー配置のナビゲーションバーの下に隠れません。スクリーンリーダーはそこからステップの位置と名前を読み上げ、Tab で最初のフィールドに移動できます。 - ステップが検証に通らないと、フォーカスは最初の無効なフィールドに移ります。フィールドの
field-errorは、表示されている間だけaria-describedbyに加わるため、メッセージはラベルと一緒に読み上げられます。 - 最後に、フォーカスは結果の見出しに移ります。「Start over」はフィールドを消去し、最初のステップの見出しに戻ります。
- スクリプトがない場合、ページは 1 つの長いフォームです。フィールドのある 2 つのステップはどちらもマークアップにあり、どちらも
hiddenではありません。電話番号には、どんなときに必要かの説明が付いており、ボタンはすべてを一度に送信します。最初から隠れているのは、フィールドを持たない「Back」、確認画面、結果だけです。
#関連項目
- ステップ購入手続きや初期設定のような短い手順の中での現在位置を、番号付きリストで示します。
- フォームフォームの幅に応じて行、セクション、操作ボタンを配置するレイアウト。
- 入力フィールド背景面より一段くぼんだテキスト入力フィールド。ラベル、ヒント、エラー、グループに対応します。
- 選択肢説明を添えられる、ラジオボタンやチェックボックスの選択肢。
- ラジオボタン複数の選択肢から 1 つを選ぶ、小さな円形のコントロール。ネイティブのラジオボタンに適用します。
- セレクト選択肢リストもインターフェースと同じ質感で表示できるネイティブのセレクト。
- 自動グリッド収まる数だけ等幅のカラムを並べ、カラム数をグリッド自身が決めます。
- データリスト1 つの対象の情報を、細い線で区切った項目名と値で表示します。デプロイ、注文、プロフィールなどに。
- ナビゲーションバーページ上部にあり、スクロールでコンテンツがバーの下を通ると質感が現れるバー。
- ボタン面からわずかに浮いた操作要素です。ポインターを重ねるとさらに浮き上がり、押すと沈み込みます。
- リンク周囲の文と同じ文字色で表示する、移動先を持つテキストリンク。
- 見出しページの前景色で表示する見出しと、その上のラベル、下の導入文。
- アイコンフレーム見出しの横などで、アイコンを適切な大きさで収める小さなウェル。