Data display

Active filter summary

<forma-active-filter-summary>

Keeps active query refinements and scope visible while filter controls recompose.

Authoring tag
<forma-active-filter-summary>
Category
Data display
Behavior owner
Application content
Canonical source
patterns/active-filter-summary.html

Purpose

An active filter summary lists every refinement currently applied to a collection, each as readable text with its own remove button, plus a Clear all action. It keeps the query state visible when the filter controls themselves are collapsed into a disclosure, Flyout or phone layout. Forma provides the heading row and the wrapping list; the application supplies the filters, the wording, which ones can be removed, and what removing one does.

Use when

  • Filters are applied from controls that can be hidden, such as a closed panel or a flyout.
  • Users need to see and undo individual refinements without reopening the filter controls.
  • A fixed scope (workspace, date range, tenant) applies and must be visible even if it cannot be removed here.

Avoid when

  • The filter controls are always fully visible next to the results: the summary would repeat them.
  • Tags describe an item rather than a query: use Badge or Status lozenge on the item.
  • The user is choosing values rather than reviewing applied ones: use Multi-choice or Combobox.

Behavior to know

  • Heading row is a wrapping flex row with the heading at the start and Clear all at the end.
  • Filters are an unstyled ul laid out as a wrapping flex row with 0.5rem gaps.
  • Each li pairs the filter text with its remove button; on phones the pair itself can wrap.
  • Every part has min-inline-size: 0, so long filter values wrap instead of overflowing.

Basic example

The smallest correct markup: the canonical pattern from patterns/active-filter-summary.html inside its public tag. Copy this first, then adapt labels, names and state.

Canonical

Minimal active filter summary

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.

Active filters

  • Status: Open
  • Owner: Me
HTML · Minimal active filter summary Raw HTML for HTML · Minimal active filter summary
<forma-active-filter-summary class="forma-component-tag">
<section class="forma-active-filter-summary" aria-labelledby="active-filters-title">
  <div class="forma-active-filter-summary__heading">
    <h2 id="active-filters-title">Active filters</h2>
    <button type="button">Clear all</button>
  </div>
  <ul class="forma-active-filter-summary__items">
    <li><span>Status: Open</span><button type="button" aria-label="Remove Status: Open filter">Remove</button></li>
    <li><span>Owner: Me</span><button type="button" aria-label="Remove Owner: Me filter">Remove</button></li>
  </ul>
</section>
</forma-active-filter-summary>

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

Examples

Scenario

Fixed scope with removable filters

The workspace scope is shown but has no remove button because it is set by the page, not by the user's query. The date range and status filters can be removed individually.

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.

Showing invoices matching

  • Workspace: Finance EU (fixed)
  • Due: 1–30 Sep 2026
  • Status: Overdue
HTML · Fixed scope with removable filters Raw HTML for HTML · Fixed scope with removable filters
<forma-active-filter-summary class="forma-component-tag">
  <section class="forma-active-filter-summary" aria-labelledby="active-filter-summary-fixed-scope-title">
    <div class="forma-active-filter-summary__heading">
      <h2 id="active-filter-summary-fixed-scope-title">Showing invoices matching</h2>
      <button type="button">Clear filters</button>
    </div>
    <ul class="forma-active-filter-summary__items">
      <li><span>Workspace: Finance EU (fixed)</span></li>
      <li><span>Due: 1–30 Sep 2026</span><button type="button" aria-label="Remove Due: 1–30 Sep 2026 filter">Remove</button></li>
      <li><span>Status: Overdue</span><button type="button" aria-label="Remove Status: Overdue filter">Remove</button></li>
    </ul>
  </section>
</forma-active-filter-summary>

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

Scenario

No filters applied

After Clear all, the summary stays in place and says that no filters are applied, rather than disappearing and shifting the results up. The Clear all button is not rendered because there is nothing to clear.

Active filters

No filters applied. Showing all 1,284 records.

HTML · No filters applied Raw HTML for HTML · No filters applied
<forma-active-filter-summary class="forma-component-tag">
  <section class="forma-active-filter-summary" aria-labelledby="active-filter-summary-no-active-filters-title">
    <div class="forma-active-filter-summary__heading">
      <h2 id="active-filter-summary-no-active-filters-title">Active filters</h2>
    </div>
    <p>No filters applied. Showing all 1,284 records.</p>
  </section>
</forma-active-filter-summary>

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 summary with many filters

Five filters on a phone. Filters wrap onto several rows and a long value wraps within its own item, next to its remove 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

  • Filters wrap onto as many rows as needed; the list never scrolls horizontally at 320px.
  • At 30rem (480px) and below each item may wrap its own text and remove button, so a long value moves the button onto the next line instead of overflowing.
  • The heading row wraps: Clear all moves below the heading when both do not fit.
  • Remove buttons keep Forma's base button sizing (at least 2.75rem tall with 1rem inline padding), so each is a comfortable touch target.
HTML · Mobile summary with many filters Raw HTML for HTML · Mobile summary with many filters
<forma-active-filter-summary class="forma-component-tag">
  <section class="forma-active-filter-summary" aria-labelledby="active-filter-summary-mobile-many-filters-title">
    <div class="forma-active-filter-summary__heading">
      <h2 id="active-filter-summary-mobile-many-filters-title">Active filters</h2>
      <button type="button">Clear all</button>
    </div>
    <ul class="forma-active-filter-summary__items">
      <li><span>Status: Awaiting reply</span><button type="button" aria-label="Remove Status: Awaiting reply filter">Remove</button></li>
      <li><span>Owner: Me</span><button type="button" aria-label="Remove Owner: Me filter">Remove</button></li>
      <li><span>Product: Reporting and analytics exports</span><button type="button" aria-label="Remove Product: Reporting and analytics exports filter">Remove</button></li>
      <li><span>Priority: High</span><button type="button" aria-label="Remove Priority: High filter">Remove</button></li>
      <li><span>Updated: Last 7 days</span><button type="button" aria-label="Remove Updated: Last 7 days filter">Remove</button></li>
    </ul>
  </section>
</forma-active-filter-summary>

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
aria-labelledbysection.forma-active-filter-summaryid of the heading—Names the summary region.
aria-labelremove button"Remove <filter> filter"—Identifies which filter a Remove button removes; the visible label alone is ambiguous.
typebuttonbutton—Remove and Clear all are native buttons handled by the application.
CSS hooks (derived from dist/all.css)
HookKindValues or defaultDescription
.forma-active-filter-summaryBlock class—Root section; a grid with 0.5rem gaps.
.forma-active-filter-summary__headingElement class—Wrapping flex row with the heading (margin removed from its h2) and the Clear all action spaced apart.
.forma-active-filter-summary__itemsElement class—Unstyled list laid out as a wrapping flex row; each li is a flex pair of filter text and remove button, allowed to wrap at 30rem and below.
Keyboard interaction
KeysResult
Tab / Shift+TabMoves through Clear all and each remove button in order.
Enter / SpaceActivates the focused button (native). The application removes the filter and re-queries.
Events
EventDescription
clickNative click on Remove or Clear all; the application updates the query, the list and the result count.

Form behavior

Not a form control. The filter values live in the application's query state.

States

Active filter summary states
StateHow it is expressedPresentation
Filters appliedli items in .forma-active-filter-summary__itemsOne item per refinement, each with a remove button when removable.
Fixed scopeli without a remove buttonVisible but not removable here; say so in the text.
No filtersapplication replaces the list with textThe summary states that no filters are applied.

Accessibility

Forma provides

  • Uses a real list, so the number of active filters is announced.
  • Keeps filter text and its remove button adjacent in DOM order.
  • Wraps rather than truncating filter text, so the full value stays readable.

Your application supplies

  • Write each filter as "Field: value" text; do not rely on chip color.
  • Give every remove button an accessible name naming its filter.
  • After removing a filter, move focus to a sensible target (the next filter's button, or the heading when the list empties) and update the result count.
  • Keep the summary in sync with the actual query, including filters set through the URL.

Responsive behavior

  • Filters wrap into rows at every width; the component never scrolls horizontally.
  • At 30rem and below individual items can wrap their text and button onto separate lines.
  • The heading row wraps Clear all under the heading when space runs out.

Motion

  • No animation: filters appear and disappear immediately when the application re-renders the list.

Usage guidance

Do

  • Place the summary between the filter controls and the results.
  • Show fixed scope alongside user filters so users understand the full query.

Avoid

  • Hiding the summary when filters are hidden on phones; that is when it matters most.
  • Visible labels such as "×" without an accessible name.

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.