VERIFICATION-0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
How consistently is this practice followed? · Extended localized content for verification and layout resilience
Choose the response that best describes the current state.
<forma-question>
A stable prompt, help, selector, and validation structure for assessment questions.
<forma-question>patterns/question.htmlThe question shell is the frame every assessment item shares: an optional number or identifier, the prompt as a heading, help text, the answer selector and any validation message. It is a section labelled by its prompt, so each question is a navigable region with a stable structure regardless of which selector sits inside. The shell carries no applicability, branching, scoring or persistence meaning; the application decides whether a question is rendered and what its answer means.
aria-labelledby, so the section has an accessible name and appears in heading navigation.aria-hidden); the heading carries the meaning.minmax(0, 1fr) with min-inline-size: 0, so wide selectors cannot push the page sideways.The smallest correct markup: the canonical pattern from patterns/question.html inside its public tag. Copy this first, then adapt labels, names and state.
Rendered from the canonical pattern file.
Choose the response that best describes the current state.
<forma-question class="forma-component-tag">
<section class="forma-question" aria-labelledby="question-example-title">
<header class="forma-question__header">
<span class="forma-question__number" aria-hidden="true">7</span>
<div>
<h2 class="forma-question__prompt" id="question-example-title">How consistently is this practice followed?</h2>
<p class="forma-question__help" id="question-example-help">Choose the response that best describes the current state.</p>
</div>
</header>
<div class="forma-question__body" aria-describedby="question-example-help">
<!-- Insert a selector pattern here. -->
</div>
</section>
</forma-question>
Click or tap the code once to select all of it, then copy.
The application rendered a question-level error after an attempted advance. The error sits below the selector and is referenced from the inputs with aria-describedby, alongside the help text.
Consider the last three months of changes.
<forma-question class="forma-component-tag">
<section class="forma-question" aria-labelledby="question-error-title">
<header class="forma-question__header">
<span class="forma-question__number" aria-hidden="true">4</span>
<div>
<h2 class="forma-question__prompt" id="question-error-title">How often are production changes reviewed by a second person?</h2>
<p class="forma-question__help" id="question-error-help">Consider the last three months of changes.</p>
</div>
</header>
<div class="forma-question__body">
<fieldset class="forma-ordinal-scale forma-ordinal-scale--3" aria-labelledby="question-error-title" aria-describedby="question-error-help question-error-message">
<div class="forma-ordinal-scale__options">
<label class="forma-ordinal-option">
<input type="radio" name="question-error-review" value="rarely" required aria-invalid="true">
<span class="forma-ordinal-option__marker" aria-hidden="true">1</span>
<span class="forma-ordinal-option__label">Rarely</span>
</label>
<label class="forma-ordinal-option">
<input type="radio" name="question-error-review" value="sometimes" aria-invalid="true">
<span class="forma-ordinal-option__marker" aria-hidden="true">2</span>
<span class="forma-ordinal-option__label">Sometimes</span>
</label>
<label class="forma-ordinal-option">
<input type="radio" name="question-error-review" value="always" aria-invalid="true">
<span class="forma-ordinal-option__marker" aria-hidden="true">3</span>
<span class="forma-ordinal-option__label">Always</span>
</label>
</div>
</fieldset>
<p class="forma-validation-message" id="question-error-message">
<span class="forma-validation-message__mark" aria-hidden="true">!</span>
Choose one response before continuing.
</p>
</div>
</section>
</forma-question>
Click or tap the code once to select all of it, then copy.
A long policy prompt wraps inside the heading column while the number badge stays aligned to the first line. The body holds a Binary choice; the shell does not change for a different selector.
A restore that was planned but not performed counts as No.
<forma-question class="forma-component-tag">
<section class="forma-question" aria-labelledby="question-binary-title">
<header class="forma-question__header">
<span class="forma-question__number" aria-hidden="true">12</span>
<div>
<h2 class="forma-question__prompt" id="question-binary-title">Does every service that stores customer data have a documented, tested restore procedure that has been exercised within the last twelve months?</h2>
<p class="forma-question__help" id="question-binary-help">A restore that was planned but not performed counts as No.</p>
</div>
</header>
<div class="forma-question__body">
<fieldset class="forma-binary-choice" aria-describedby="question-binary-help">
<legend class="forma-binary-choice__legend">Tested restore procedure in place</legend>
<div class="forma-binary-choice__options">
<label class="forma-binary-option"><input type="radio" name="question-binary-restore" value="yes" required><span>Yes</span></label>
<label class="forma-binary-option"><input type="radio" name="question-binary-restore" value="no"><span>No</span></label>
</div>
</fieldset>
</div>
</section>
</forma-question>
Click or tap the code once to select all of it, then copy.
Not every question is a scale. An optional follow-up uses an ordinary labelled textarea inside the same shell, so numbering, prompt and help stay consistent across selector types.
Optional. Two or three sentences are enough.
<forma-question class="forma-component-tag">
<section class="forma-question" aria-labelledby="question-text-title">
<header class="forma-question__header">
<span class="forma-question__number" aria-hidden="true">13</span>
<div>
<h2 class="forma-question__prompt" id="question-text-title">What would most improve your recovery process?</h2>
<p class="forma-question__help" id="question-text-help">Optional. Two or three sentences are enough.</p>
</div>
</header>
<div class="forma-question__body">
<div class="forma-field">
<label class="forma-field__label" for="question-text-answer">Your answer</label>
<textarea id="question-text-answer" name="question-text-answer" rows="3" aria-describedby="question-text-help"></textarea>
</div>
</div>
</section>
</forma-question>
Click or tap the code once to select all of it, then copy.
Each mobile example renders in its own document inside a real narrow viewport, so Forma's media and container queries run exactly as they would on a phone. Choose a width to compare.
A five-point agreement question at phone width. The header keeps the number beside the wrapping prompt and the scale below reflows to a vertical list.
<forma-question class="forma-component-tag">
<section class="forma-question" aria-labelledby="question-mobile-title">
<header class="forma-question__header">
<span class="forma-question__number" aria-hidden="true">2</span>
<div>
<h2 class="forma-question__prompt" id="question-mobile-title">Releases can be rolled back without a code change.</h2>
<p class="forma-question__help">Choose the response that best matches your team.</p>
</div>
</header>
<div class="forma-question__body">
<fieldset class="forma-ordinal-scale forma-ordinal-scale--5" aria-labelledby="question-mobile-title">
<div class="forma-ordinal-scale__options">
<label class="forma-ordinal-option"><input type="radio" name="question-mobile-rollback" value="0" required><span class="forma-ordinal-option__marker" aria-hidden="true">1</span><span class="forma-ordinal-option__label">Strongly disagree</span></label>
<label class="forma-ordinal-option"><input type="radio" name="question-mobile-rollback" value="1"><span class="forma-ordinal-option__marker" aria-hidden="true">2</span><span class="forma-ordinal-option__label">Disagree</span></label>
<label class="forma-ordinal-option"><input type="radio" name="question-mobile-rollback" value="2"><span class="forma-ordinal-option__marker" aria-hidden="true">3</span><span class="forma-ordinal-option__label">Neither agree nor disagree</span></label>
<label class="forma-ordinal-option"><input type="radio" name="question-mobile-rollback" value="3"><span class="forma-ordinal-option__marker" aria-hidden="true">4</span><span class="forma-ordinal-option__label">Agree</span></label>
<label class="forma-ordinal-option"><input type="radio" name="question-mobile-rollback" value="4"><span class="forma-ordinal-option__marker" aria-hidden="true">5</span><span class="forma-ordinal-option__label">Strongly agree</span></label>
</div>
</fieldset>
</div>
</section>
</forma-question>
Click or tap the code once to select all of it, then copy.
The canonical pattern in a true 320px viewport, the minimum width every Forma component must support without page-level horizontal scrolling.
Forma components have no JavaScript API. Their public contract is the markup: native elements and attributes you write, and the CSS hooks below. The CSS hook table is generated from the built stylesheet, so it always matches the shipped implementation.
| Attribute | On | Values | Default | Description |
|---|---|---|---|---|
aria-labelledby | section.forma-question | id of .forma-question__prompt | — | Names the question region by its prompt. The same id can label the inner fieldset when the prompt replaces a visible legend. |
aria-describedby | selector fieldset or input | ids of help and error text | — | Associates help and validation text with the control that receives focus. Put it on the fieldset or inputs; a plain div does not reliably expose a description. |
aria-hidden | .forma-question__number | true | — | Keeps the decorative number badge out of the accessibility tree; the heading already names the question. |
aria-invalid | inputs | true | absent | Set by the application when the question fails validation so assistive technology reports the error state. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-question | Block class | — | Root section. A grid with vertical padding and a subtle bottom rule that separates consecutive questions. |
.forma-question__body | Element class | — | Container for the selector and validation message. It is allowed to shrink so wide selectors cannot overflow. |
.forma-question__header | Element class | — | Two-column grid: number badge and the prompt/help column. |
.forma-question__help | Element class | — | Secondary instruction text under the prompt; reference it with aria-describedby. |
.forma-question__number | Element class | — | Circular monospace badge for a question number or short identifier. Decorative. |
.forma-question__prompt | Element class | — | The prompt heading. Use a heading level that fits the page outline. |
| Keys | Result |
|---|---|
| Tab / Shift+Tab | Moves into and out of the selector inside the body. The shell itself adds no focus stops. |
| Selector keys | Whatever the embedded selector provides natively, for example arrow keys within a radio group. |
The shell does not participate in forms. The selector inside it submits its own native values.
| State | How it is expressed | Presentation |
|---|---|---|
| Unanswered | no checked input in the body | Nothing in the shell changes; the selector shows no selection. |
| Invalid | application renders .forma-validation-message and sets aria-invalid | A text error with a non-color mark appears under the selector and is associated with the inputs. |
| Not applicable | application omits the section | Forma has no hidden or skipped state. The application decides applicability and does not render the question. |
auto minmax(0, 1fr)), so long prompts wrap beside the badge.clamp(); help text stays at 0.875rem.min-inline-size: 0; the embedded selector owns its own narrow-screen recomposition..forma-question__help.Generated fault-injection specimens expose content, spacing, color-cue, and reduced-effective-contrast risks. They screen presentation robustness as engineering screens without claiming human-subject validation.