Attention and verification

Emphasis budget

<forma-emphasis-budget>

Declares bounded primary, secondary, and supporting emphasis so competing regions cannot all claim the strongest visual priority.

Authoring tag
<forma-emphasis-budget>
Behavior owner
Application content
Canonical source
patterns/emphasis-budget.html

Purpose

An emphasis budget is a declared limit on visual competition within one decision region. The root carries data-emphasis-budget="one-primary", and each direct region claims data-emphasis="primary", "secondary" or "supporting". Exactly one direct region may be primary. Forma draws three clearly different weights (a framed primary, a secondary with an inline-start rule, supporting items with a thin top rule) and pairs each with a visible .forma-emphasis-label, so the level stays readable with color, borders and tint removed. The budget is checked by tests and review, not enforced by CSS, and the application decides which content deserves each level.

Use when

  • A consequential decision screen has several regions that could all look important, and one must clearly lead.
  • Teams want a reviewable, testable rule that stops every panel from being styled as primary.
  • Nested areas of a page are independent decisions that each need their own single primary.

Avoid when

Behavior to know

  • Primary: 2px functional border, surface background and full padding.
  • Secondary: 0.2rem inline-start rule and lighter padding.
  • Supporting: thin top rule, laid out in an auto-fit grid via .forma-emphasis-budget__support.
  • Every level carries a visible text label, so emphasis survives grayscale and forced colors.
  • Nested budgets are allowed and are evaluated separately, against their own direct children.

Basic example

The smallest correct markup: the canonical pattern from patterns/emphasis-budget.html inside its public tag. Copy this first, then adapt labels, names and state. This component owns a page's main landmark, so it renders in its own document below.

Canonical

Minimal emphasis budget

Rendered from the canonical pattern file.

Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.

HTML · Minimal emphasis budget Raw HTML for HTML · Minimal emphasis budget
<forma-emphasis-budget class="forma-component-tag">
<main class="forma-emphasis-budget" data-emphasis-budget="one-primary" aria-labelledby="emphasis-budget-title">
  <header>
    <p class="forma-component-kicker">Deployment review</p>
    <h2 id="emphasis-budget-title">Release decision</h2>
  </header>
  <section data-emphasis="primary" aria-labelledby="emphasis-primary">\n    <p class="forma-emphasis-label">Primary</p>
    <span class="forma-status-lozenge" data-state="unknown">Unknown consumer outcome</span>
    <h3 id="emphasis-primary">Reconcile before publishing</h3>
    <p>The consuming application has not supplied current verification evidence.</p>
    <button type="button">Reconcile consumer</button>
  </section>
  <section data-emphasis="secondary" aria-labelledby="emphasis-secondary">\n    <p class="forma-emphasis-label">Secondary</p>
    <h3 id="emphasis-secondary">Verification evidence</h3>
    <p>Package build and repository checks passed. Consumer verification remains unresolved.</p>
  </section>
  <div class="forma-emphasis-budget__support">
    <section data-emphasis="supporting"><p class="forma-emphasis-label">Supporting</p><h3>History</h3><p>The previous release completed successfully.</p></section>
    <section data-emphasis="supporting"><p class="forma-emphasis-label">Supporting</p><h3>Package</h3><p>Version 1.4.0 with provenance enabled.</p></section>
    <section data-emphasis="supporting"><p class="forma-emphasis-label">Supporting</p><h3>Activity</h3><p>Recent repository work includes presentation and browser-test changes.</p></section>
  </div>
</main>
</forma-emphasis-budget>

Click or tap the code once to select all of it, then copy.

Examples

Scenario

Access request decision

A single budget for an access request: the primary region holds the decision, the secondary region the requester's justification, and three supporting facts sit in the support grid. Only the primary region contains actions.

Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.

Access requests

Production database access

Primary

Grant read access to prod-billing for 8 hours?

Requested by Luis Ferreira for incident INC-3312.

Secondary

Justification

Needs to confirm whether duplicate invoices were written during the 09:12 outage.

Supporting

Previous grants

2 in the last 90 days, both expired normally.

Supporting

Scope

Read only. No export permission.

Supporting

Policy

Production access needs one approver from Platform.

HTML · Access request decision Raw HTML for HTML · Access request decision
<forma-emphasis-budget class="forma-component-tag">
  <section class="forma-emphasis-budget" data-emphasis-budget="one-primary" aria-labelledby="emphasis-budget-access-request-title">
    <header>
      <p class="forma-component-kicker">Access requests</p>
      <h2 id="emphasis-budget-access-request-title">Production database access</h2>
    </header>
    <section data-emphasis="primary" aria-labelledby="emphasis-budget-access-request-primary">
      <p class="forma-emphasis-label">Primary</p>
      <h3 id="emphasis-budget-access-request-primary">Grant read access to prod-billing for 8 hours?</h3>
      <p>Requested by Luis Ferreira for incident INC-3312.</p>
      <div class="forma-cluster"><button type="button">Grant for 8 hours</button><button type="button">Decline</button></div>
    </section>
    <section data-emphasis="secondary" aria-labelledby="emphasis-budget-access-request-secondary">
      <p class="forma-emphasis-label">Secondary</p>
      <h3 id="emphasis-budget-access-request-secondary">Justification</h3>
      <p>Needs to confirm whether duplicate invoices were written during the 09:12 outage.</p>
    </section>
    <div class="forma-emphasis-budget__support">
      <section data-emphasis="supporting"><p class="forma-emphasis-label">Supporting</p><h3>Previous grants</h3><p>2 in the last 90 days, both expired normally.</p></section>
      <section data-emphasis="supporting"><p class="forma-emphasis-label">Supporting</p><h3>Scope</h3><p>Read only. No export permission.</p></section>
      <section data-emphasis="supporting"><p class="forma-emphasis-label">Supporting</p><h3>Policy</h3><p>Production access needs one approver from Platform.</p></section>
    </div>
  </section>
</forma-emphasis-budget>

Click or tap the code once to select all of it, then copy.

Scenario

Nested independent budgets

The page-level decision has one primary region. A supporting region contains its own independent budget, with its own single primary for a separate sub-decision. Each budget is counted against its direct children only, so this is valid.

Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.

Quarter close

Primary

Insufficient data

Close Q3 once the EMEA ledger reports

The EMEA ledger has not supplied September totals. Closing now would record an incomplete quarter.

Supporting

EMEA ledger

Primary

Request the September totals from the EMEA controller.

Secondary

Last report received 3 October.

HTML · Nested independent budgets Raw HTML for HTML · Nested independent budgets
<forma-emphasis-budget class="forma-component-tag">
  <section class="forma-emphasis-budget" data-emphasis-budget="one-primary" aria-labelledby="emphasis-budget-nested-title">
    <h2 id="emphasis-budget-nested-title">Quarter close</h2>
    <section data-emphasis="primary" aria-labelledby="emphasis-budget-nested-primary">
      <p class="forma-emphasis-label">Primary</p>
      <span class="forma-status-lozenge" data-state="unknown">Insufficient data</span>
      <h3 id="emphasis-budget-nested-primary">Close Q3 once the EMEA ledger reports</h3>
      <p>The EMEA ledger has not supplied September totals. Closing now would record an incomplete quarter.</p>
    </section>
    <section data-emphasis="supporting" aria-labelledby="emphasis-budget-nested-sub">
      <p class="forma-emphasis-label">Supporting</p>
      <h3 id="emphasis-budget-nested-sub">EMEA ledger</h3>
      <div class="forma-emphasis-budget" data-emphasis-budget="one-primary">
        <section data-emphasis="primary"><p class="forma-emphasis-label">Primary</p><p>Request the September totals from the EMEA controller.</p><button type="button">Send request</button></section>
        <section data-emphasis="secondary"><p class="forma-emphasis-label">Secondary</p><p>Last report received 3 October.</p></section>
      </div>
    </section>
  </section>
</forma-emphasis-budget>

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.

Mobile example

Mobile decision

At phone width all levels stack in source order and the primary action becomes a wrapping, full-height button.

Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.

Viewport width

Frames narrower than the selected width show the component at the width available.

What changes at narrow widths

  • The support grid uses minmax(min(100%, 15rem), 1fr), so supporting regions stack into one column on phones.
  • At 30rem and below a button directly inside the primary region wraps its text and grows in height while keeping a 2.75rem minimum.
  • Status lozenges inside the budget wrap at 30rem and below instead of widening the page.
  • Every region and label wraps with overflow-wrap: anywhere, so long identifiers and 200% text stay within 320px in any orientation.
HTML · Mobile decision Raw HTML for HTML · Mobile decision
<forma-emphasis-budget class="forma-component-tag">
  <section class="forma-emphasis-budget" data-emphasis-budget="one-primary" aria-labelledby="emphasis-budget-mobile-title">
    <h2 id="emphasis-budget-mobile-title">Refund request R-5520</h2>
    <section data-emphasis="primary" aria-labelledby="emphasis-budget-mobile-primary">
      <p class="forma-emphasis-label">Primary</p>
      <h3 id="emphasis-budget-mobile-primary">Refund $84.00 to the original card?</h3>
      <button type="button">Refund $84.00 to card ending 4412</button>
    </section>
    <section data-emphasis="secondary" aria-labelledby="emphasis-budget-mobile-secondary">
      <p class="forma-emphasis-label">Secondary</p>
      <h3 id="emphasis-budget-mobile-secondary">Reason</h3>
      <p>Item arrived damaged; photo attached.</p>
    </section>
    <div class="forma-emphasis-budget__support">
      <section data-emphasis="supporting"><p class="forma-emphasis-label">Supporting</p><h3>Customer</h3><p>First refund in 2 years.</p></section>
    </div>
  </section>
</forma-emphasis-budget>

Click or tap the code once to select all of it, then copy.

Baseline

Mobile · 320px

The canonical pattern in a true 320px viewport, the minimum width every Forma component must support without page-level horizontal scrolling.

Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.

Viewport width

Frames narrower than the selected width show the component at the width available.

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.

Native and ARIA attributes
AttributeOnValuesDefaultDescription
data-emphasis-budgetrootone-primaryabsentDeclares the budget: exactly one direct child region may claim primary. Checked by tests and review; CSS does not enforce it.
data-emphasisregions inside the budgetprimary | secondary | supportingabsentThe region's claimed emphasis level. Chosen by the application from domain state; never implies severity, authority or legality.
aria-labelledbyroot and regionsid of a heading—Names the budget and its main regions by their headings.
data-state.forma-status-lozengeok | attention | blocked | unknownabsentAdds a status symbol to a text status inside a region.
CSS hooks (derived from dist/all.css)
HookKindValues or defaultDescription
.forma-emphasis-budgetBlock class—Root grid. Styles any descendant [data-emphasis] region by its level; can be nested for independent sub-decisions.
.forma-emphasis-budget__supportElement class—Auto-fit grid (regions at least 15rem) for supporting regions.
.forma-emphasis-labelBlock class—Small mono uppercase text label stating the region's level. Place it as the first child of each region so the level survives visual-channel removal.
[data-emphasis]Attribute hook—Level hook read by the CSS: primary (framed), secondary (inline-start rule), supporting (top rule).
[data-emphasis-budget]Attribute hook—Declarative budget marker read by conformance tests; it has no styling.
Keyboard interaction
KeysResult
Tab / Shift+TabMoves through actions in source order. Emphasis never changes focus order.

Form behavior

Not a form control.

States

Emphasis budget states
StateHow it is expressedPresentation
Primarydata-emphasis="primary"2px border, surface background, full padding.
Secondarydata-emphasis="secondary"0.2rem inline-start rule, lighter padding.
Supportingdata-emphasis="supporting"Thin top rule and small block padding.
Forced colors@media (forced-colors: active)All levels use CanvasText borders on Canvas; the text labels distinguish them.

Accessibility

Forma provides

  • Gives each level a distinct structural treatment (frame, side rule, top rule) rather than a color difference.
  • Provides a text label class so the level is readable in grayscale, forced colors and with borders removed.
  • Wraps text anywhere and keeps regions within 100% width at 320px and 200% text.

Your application supplies

  • Put exactly one primary among the direct regions of each budget.
  • Include an .forma-emphasis-label in every region; do not rely on the frame alone.
  • Keep headings, text states and source order correct; emphasis does not replace them.
  • Derive emphasis from application state, and never use it to express severity, permission or legality.

Responsive behavior

  • Root, regions and support grid set min-inline-size: 0 and max-inline-size: 100%; every [data-emphasis] region wraps anywhere.
  • Support grid: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)), one column on phones.
  • At 30rem and below: status lozenges wrap, and a button directly inside the primary region wraps and grows in height.

Motion

  • No animation: emphasis is expressed only through static structure and text. Nothing pulses, moves or fades to claim attention.

Usage guidance

Do

  • Start a new nested budget when a sub-area is a genuinely separate decision.
  • Keep the primary region focused on the single decision or action that matters now.

Avoid

  • Making two direct regions primary because both feel important; demote one to secondary.
  • Styling your own "extra primary" regions outside the budget to work around it.

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.