Semantic differential
<forma-semantic-differential>
A bipolar textual scale that keeps the ordered response radio-backed and explicit.
- Authoring tag
<forma-semantic-differential>- Category
- Assessment and survey
- Behavior owner
- Native HTML
- Canonical source
patterns/semantic-differential.html
Purpose
A semantic differential places a response between two opposite descriptions, such as Highly manual and Highly automated. Only the endpoints have words; the positions between them are numbered. It is a native radio group in a fieldset. The visible endpoint row is decorative for assistive technology; instead each radio carries screen-reader text naming its position and, at the ends, the endpoint meaning, so the scale never depends on visual left/right placement. A separate mobile legend (1 = …, 7 = …) replaces the endpoint row on narrow screens.
Use when
- The question is a characterization between two opposite adjectives or states.
- Middle positions have no natural individual labels.
- Seven-position granularity suits the measurement.
Avoid when
- Every position has its own label: use Ordinal scale.
- The answer is a star or icon rating: use Symbol rating.
- The value is a continuous number: use Slider or Numeric stepper.
- The scale needs fewer or more than seven positions: the current grid is fixed at seven columns, so use Ordinal scale with the matching cardinality.
Behavior to know
- Endpoint meaning is programmatic: the first and last radios' names include the endpoint text.
- The desktop endpoint row is
aria-hidden; the mobile endpoint key is visible and readable. - Numbers inside cells are
aria-hiddenand only reinforce position. - The radio covers the whole cell, so the entire cell is the hit target.
Basic example
The smallest correct markup: the canonical pattern from patterns/semantic-differential.html inside its public tag. Copy this first, then adapt labels, names and state.
Minimal semantic differential
Rendered from the canonical pattern file.
<forma-semantic-differential class="forma-component-tag">
<fieldset class="forma-semantic-differential">
<legend class="forma-semantic-differential__legend">How would you characterize the current process?</legend>
<div class="forma-semantic-differential__endpoints" aria-hidden="true">
<span>Highly manual</span>
<span>Highly automated</span>
</div>
<div class="forma-semantic-differential__scale">
<label><input type="radio" name="automation-level" value="1" required><span aria-hidden="true">1</span><span class="forma-sr-only">Highly manual, position 1 of 7</span></label>
<label><input type="radio" name="automation-level" value="2"><span aria-hidden="true">2</span><span class="forma-sr-only">Position 2 of 7</span></label>
<label><input type="radio" name="automation-level" value="3"><span aria-hidden="true">3</span><span class="forma-sr-only">Position 3 of 7</span></label>
<label><input type="radio" name="automation-level" value="4"><span aria-hidden="true">4</span><span class="forma-sr-only">Position 4 of 7</span></label>
<label><input type="radio" name="automation-level" value="5"><span aria-hidden="true">5</span><span class="forma-sr-only">Position 5 of 7</span></label>
<label><input type="radio" name="automation-level" value="6"><span aria-hidden="true">6</span><span class="forma-sr-only">Position 6 of 7</span></label>
<label><input type="radio" name="automation-level" value="7"><span aria-hidden="true">7</span><span class="forma-sr-only">Highly automated, position 7 of 7</span></label>
</div>
<div class="forma-semantic-differential__endpoints forma-semantic-differential__endpoints--mobile">
<span>1 = Highly manual</span>
<span>7 = Highly automated</span>
</div>
</fieldset>
</forma-semantic-differential>
Click or tap the code once to select all of it, then copy.
Examples
Previously saved response
A draft reopened with position 5 checked. The checked cell takes the inverse surface; the endpoint row reads Slow to Fast.
<forma-semantic-differential class="forma-component-tag">
<fieldset class="forma-semantic-differential">
<legend class="forma-semantic-differential__legend">How would you describe code review turnaround?</legend>
<div class="forma-semantic-differential__endpoints" aria-hidden="true">
<span>Slow</span>
<span>Fast</span>
</div>
<div class="forma-semantic-differential__scale">
<label><input type="radio" name="differential-saved-review" value="1" required><span aria-hidden="true">1</span><span class="forma-sr-only">Slow, position 1 of 7</span></label>
<label><input type="radio" name="differential-saved-review" value="2"><span aria-hidden="true">2</span><span class="forma-sr-only">Position 2 of 7</span></label>
<label><input type="radio" name="differential-saved-review" value="3"><span aria-hidden="true">3</span><span class="forma-sr-only">Position 3 of 7</span></label>
<label><input type="radio" name="differential-saved-review" value="4"><span aria-hidden="true">4</span><span class="forma-sr-only">Position 4 of 7</span></label>
<label><input type="radio" name="differential-saved-review" value="5" checked><span aria-hidden="true">5</span><span class="forma-sr-only">Position 5 of 7</span></label>
<label><input type="radio" name="differential-saved-review" value="6"><span aria-hidden="true">6</span><span class="forma-sr-only">Position 6 of 7</span></label>
<label><input type="radio" name="differential-saved-review" value="7"><span aria-hidden="true">7</span><span class="forma-sr-only">Fast, position 7 of 7</span></label>
</div>
<div class="forma-semantic-differential__endpoints forma-semantic-differential__endpoints--mobile">
<span>1 = Slow</span>
<span>7 = Fast</span>
</div>
</fieldset>
</forma-semantic-differential>
Click or tap the code once to select all of it, then copy.
Long endpoint descriptions with help text
Endpoints that are phrases rather than single adjectives. They sit at opposite ends of a flex row and wrap independently; help text is associated with the group.
<forma-semantic-differential class="forma-component-tag">
<fieldset class="forma-semantic-differential" aria-describedby="differential-long-help">
<legend class="forma-semantic-differential__legend">Where does decision-making sit in your organization?</legend>
<p class="forma-field__description" id="differential-long-help">Answer for architecture decisions made in the last year.</p>
<div class="forma-semantic-differential__endpoints" aria-hidden="true">
<span>Made centrally by a platform or architecture group</span>
<span>Made independently by each delivery team</span>
</div>
<div class="forma-semantic-differential__scale">
<label><input type="radio" name="differential-long-decisions" value="1" required><span aria-hidden="true">1</span><span class="forma-sr-only">Made centrally by a platform or architecture group, position 1 of 7</span></label>
<label><input type="radio" name="differential-long-decisions" value="2"><span aria-hidden="true">2</span><span class="forma-sr-only">Position 2 of 7</span></label>
<label><input type="radio" name="differential-long-decisions" value="3"><span aria-hidden="true">3</span><span class="forma-sr-only">Position 3 of 7</span></label>
<label><input type="radio" name="differential-long-decisions" value="4"><span aria-hidden="true">4</span><span class="forma-sr-only">Position 4 of 7</span></label>
<label><input type="radio" name="differential-long-decisions" value="5"><span aria-hidden="true">5</span><span class="forma-sr-only">Position 5 of 7</span></label>
<label><input type="radio" name="differential-long-decisions" value="6"><span aria-hidden="true">6</span><span class="forma-sr-only">Position 6 of 7</span></label>
<label><input type="radio" name="differential-long-decisions" value="7"><span aria-hidden="true">7</span><span class="forma-sr-only">Made independently by each delivery team, position 7 of 7</span></label>
</div>
<div class="forma-semantic-differential__endpoints forma-semantic-differential__endpoints--mobile">
<span>1 = Central group</span>
<span>7 = Each team</span>
</div>
</fieldset>
</forma-semantic-differential>
Click or tap the code once to select all of it, then copy.
Mobile
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.
Endpoint key on a phone
At phone width the desktop endpoint row is hidden and the explicit 1 = / 7 = key appears below the scale.
What changes at narrow widths
- Below 44rem the aria-hidden endpoint row is hidden and the
--mobilekey, which states which number means what, is shown under the scale. - The seven cells keep a 2.75rem minimum width each; where the container is narrower than about 19.25rem the scale scrolls horizontally inside its own border instead of shrinking targets.
- Scrolling is contained to the scale (
overscroll-behavior-inline: contain) with a stable scrollbar gutter, so the page itself does not scroll sideways. - Cells are 48px tall and the whole cell is the tap target.
<forma-semantic-differential class="forma-component-tag">
<fieldset class="forma-semantic-differential">
<legend class="forma-semantic-differential__legend">How predictable is your release schedule?</legend>
<div class="forma-semantic-differential__endpoints" aria-hidden="true">
<span>Unpredictable</span>
<span>Predictable</span>
</div>
<div class="forma-semantic-differential__scale">
<label><input type="radio" name="differential-mobile-release" value="1" required><span aria-hidden="true">1</span><span class="forma-sr-only">Unpredictable, position 1 of 7</span></label>
<label><input type="radio" name="differential-mobile-release" value="2"><span aria-hidden="true">2</span><span class="forma-sr-only">Position 2 of 7</span></label>
<label><input type="radio" name="differential-mobile-release" value="3"><span aria-hidden="true">3</span><span class="forma-sr-only">Position 3 of 7</span></label>
<label><input type="radio" name="differential-mobile-release" value="4"><span aria-hidden="true">4</span><span class="forma-sr-only">Position 4 of 7</span></label>
<label><input type="radio" name="differential-mobile-release" value="5"><span aria-hidden="true">5</span><span class="forma-sr-only">Position 5 of 7</span></label>
<label><input type="radio" name="differential-mobile-release" value="6"><span aria-hidden="true">6</span><span class="forma-sr-only">Position 6 of 7</span></label>
<label><input type="radio" name="differential-mobile-release" value="7"><span aria-hidden="true">7</span><span class="forma-sr-only">Predictable, position 7 of 7</span></label>
</div>
<div class="forma-semantic-differential__endpoints forma-semantic-differential__endpoints--mobile">
<span>1 = Unpredictable</span>
<span>7 = Predictable</span>
</div>
</fieldset>
</forma-semantic-differential>
Click or tap the code once to select all of it, then copy.
Mobile · 320px
The canonical pattern in a true 320px viewport, the minimum width every Forma component must support without page-level horizontal scrolling.
API and configuration
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 |
|---|---|---|---|---|
type | input | radio | — | Required. Seven radios sharing one name. |
name | input | string | — | Groups the seven positions. Unique per question. |
value | input | string | — | Submitted position. The application decides direction and scoring. |
required | first input | boolean | absent | Native required-group validation. |
checked | input | boolean | absent | Restores a saved position. |
aria-hidden | desktop endpoints row and number spans | true | — | Hides the visual-only endpoint row and the decorative numbers; meaning is carried by the .forma-sr-only text in each label. |
aria-describedby | fieldset | id list | — | Associates help or error text with the scale. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-semantic-differential | Block class | — | Root fieldset with browser border and padding removed. |
.forma-semantic-differential__endpoints | Element class | — | Flex row placing the two endpoint descriptions at opposite ends. The desktop row is aria-hidden and is hidden below 44rem. |
.forma-semantic-differential__legend | Element class | — | Question text. |
.forma-semantic-differential__scale | Element class | — | Bordered seven-column grid of cells, each at least 2.75rem wide. Scrolls inline within itself on very narrow containers. |
.forma-semantic-differential__endpoints--mobile | Modifier class | — | Explicit number key (1 = …, 7 = …). Hidden on wide screens and shown below 44rem. |
.forma-sr-only | Block class | — | Visually hidden text inside each label that names the position and, at the ends, the endpoint meaning. |
| Keys | Result |
|---|---|
| Tab / Shift+Tab | Moves focus into and out of the group. |
| Arrow keys | Native radio behavior: moves to and selects the adjacent position. |
| Space | Selects the focused position when none is checked. |
| Event | Description |
|---|---|
input / change | Native events from the checked radio. |
Form behavior
Submits name=value for the checked position; unanswered submits nothing and fails required validation.
States
| State | How it is expressed | Presentation |
|---|---|---|
| Unanswered | no checked radio | All cells neutral. |
| Selected | :checked | The chosen cell takes the inverse surface. |
| Focus | :focus-visible on the radio | Two-tone focus ring around the cell. |
| Narrow | viewport below 44rem | Desktop endpoints hidden; the mobile key is shown and the scale may scroll inline. |
Accessibility
Forma provides
- Stretches each radio over its whole cell, so the full cell is the pointer and touch target.
- Hides visual-only endpoints and numbers from assistive technology to avoid double announcements.
- Shows selection with an inverse surface and Highlight/HighlightText in forced-colors mode.
Your application supplies
- Put the endpoint meaning in the screen-reader text of the first and last radios, and a position in every radio's text.
- Keep the mobile key text consistent with the desktop endpoints.
- Provide all seven positions; the grid assumes seven.
Responsive behavior
- Wide: seven equal columns (
minmax(2.75rem, 1fr)) under a two-ended endpoint row. - Below 44rem: the endpoint row swaps for the explicit key, and the scale gets
overflow-x: autowith contained overscroll and a stable gutter. - Long endpoint descriptions wrap within their half of the row.
Motion
- Cell background, border and text color use the shared perceptual interpolation (about 120ms), identical for every position. Selection is immediate.
- Under
prefers-reduced-motion: reducethe foundation makes these transitions effectively instant.
Usage guidance
Do
- Choose truly opposite, parallel endpoints.
- State in help text which aspect is being rated when the endpoints alone are ambiguous.
Avoid
- Relying on left/right placement to communicate meaning.
- Using the differential for value judgements where one end is plainly the right answer.
Verification specimens
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.