Filters

Filters narrow a set of data, such as a table, a list of cards or a chart, to the items a reader wants. When each filter takes one choice, such as one status, the filters are selects in a row. When a filter takes several choices at once, such as three categories, the filters go in a panel behind a Filters button. Both go in the header bar of the set they change.

Single-choice filters

Each filter takes one choice, so each is a select. Two or three selects sit in a row in the header bar of the set they change, with one Apply button. Each is always set, with an inclusive default such as “All”, so the row shows every choice in force.

Note

Meets accessibility guideline WCAG 2.2 SC 3.3.2 Labels or Instructions (Level A)

Selects in a row

CategoryNew submissionsOpen holds
cond-mat.str-el2146
cond-mat.soft1322
Relevant code
<div class="ds-card">
  <div class="ds-card-bar">
    <form class="ds-form--compact" method="get" action="…" aria-label="Filter categories">
      <label>Group <select class="ds-input" name="group">…</select></label>
      <label>Archive <select class="ds-input" name="archive">…</select></label>
      <label>Category <select class="ds-input" name="category">…</select></label>
      <button class="ds-btn ds-btn-compact" type="submit">Apply</button>
    </form>
  </div>
  <div class="ds-table-scroll" …><table class="ds-table">…</table></div>
</div>
.ds-card-bar
The header bar of the set, with the filters at its start. A total ends it only when the reader cannot see the whole set; here every category is in view, so there is none. See Cards with a header bar.
.ds-form--compact
The filters, as a compact form: one row, each select inside its label. It is a <form method="get">, so the choices go in the page address and a filtered view can be linked.
<button type="submit">
Apply: a compact secondary button (.ds-btn-compact), at the end of the row.
Note

Meets accessibility guidelines WCAG 2.2 SC 1.3.1 Info and Relationships (Level A) and WCAG 2.2 SC 3.3.2 Labels or Instructions (Level A)

A date range

Submitted

1,669 submissions

The submissions in the range.

Relevant code
<form class="ds-form--compact" method="get" action="…" aria-label="Filter submissions by date">
  <fieldset>
    <legend>Submitted</legend>
    <label>from <input class="ds-input" name="from" type="date"></label>
    <label>to <input class="ds-input" name="to" type="date"></label>
  </fieldset>
  <button class="ds-btn ds-btn-compact" type="submit">Apply</button>
</form>
<fieldset>, <legend>
The two dates of a range are one fieldset, so they stay together on the row and a screen reader reads each with the range's name: “Submitted, from”.

Multiple-choice filters

A filter that takes several choices at once is a group of checkboxes, in a filter panel opened by a Filters button. The panel holds every filter for the set, including single-choice ones, so it is also the home for more filters than fit in a row. The filters that are applied show beside the button as tags, with Clear all after them.

Note

Meets accessibility guidelines WCAG 2.2 SC 2.1.1 Keyboard (Level A) and WCAG 2.2 SC 4.1.2 Name, Role, Value (Level A)

A Filters button and its panel

3 of 120 holds

SubmissionCategoryHeld since
submit/9614203cs.LG2026-09-02
submit/9617750cs.AI2026-09-05
submit/9620418cs.LG2026-09-11
Relevant code
<div class="ds-card-bar">
  <div class="ds-btn-group" role="group" aria-label="Filters on recent holds">
    <button type="button" class="ds-btn ds-btn-compact ds-filter-button" popovertarget="holds-panel" aria-expanded="false">
      <svg …the list-filter icon… aria-hidden="true">…</svg>
      Filters
    </button>
    <span class="ds-tag ds-tag--keep-case">Status: On hold<a class="ds-tag-remove" href="…"><span aria-hidden="true">✕</span><span class="is-sr-only">Remove the filter Status: On hold</span></a></span>
    …
    <a href="…">Clear all</a>
  </div>
  <p>3 of 120 holds</p>
</div>
<div class="ds-filter-panel" id="holds-panel" popover role="dialog" aria-label="Filters on recent holds">
  <form class="ds-form--compact" method="get" action="…">
    <label>Status <select class="ds-input" name="status" autofocus>…</select></label>
    <fieldset>
      <legend>Category</legend>
      <label class="ds-check"><input type="checkbox" name="category" value="cs.AI"><span>cs.AI</span></label>
      …
    </fieldset>
    …
    <fieldset>
      <legend>Settings</legend>
      <label>Threshold days <input class="ds-input" name="threshold" type="number"></label>
    </fieldset>
    <button class="ds-btn ds-btn-compact" type="submit">Apply</button>
  </form>
</div>
<script src="filter-panel.js" defer></script>
.ds-filter-button
A compact secondary button with the filter icon (list-filter) and no chevron. popovertarget names its panel. While the panel is open the button shows its pressed state.
.ds-filter-value
Optional, inside the button: what is applied, after the button's name. It shortens with an ellipsis when the row is narrow.
.ds-filter-panel
The filter panel, a popover with role="dialog" and a name. It opens in the background of the row its button sits in, such as the card's header bar, so the reader sees which area opened it, and attaches to that row's bottom edge. From the dark site header it opens dark, in dark mode, so its labels and fields read on that ground. filter-panel.js does all three. It holds a compact form, one short column. --ds-panel-width sets its width.
<fieldset> with checkboxes
A filter that takes several values, such as categories, is a fieldset of .ds-check checkboxes.
<fieldset> with the legend Settings
A setting, such as threshold days, changes a calculation and is not a filter. It goes after the filters, in a fieldset of its own, and is not shown as a tag.
.ds-tag, .ds-tag-remove
One tag for each applied filter, after the button. Its remove control is a link to the page without that filter. See Tags.
<a> Clear all
A link to the page without filters, after the tags, while a filter is applied.
<script src="filter-panel.js" defer>
Places the panel at the button's edge and keeps aria-expanded current. Without it the panel opens in the center of the window.

Accessibility essentials

Rules

  • One set of filters for each set of data, in the set's header bar. A filter applies to everything in the set.
  • A total ends the header bar only when the reader cannot see the whole set: the set runs over more than one page, as in “1,669 submissions”, or the filters hide part of it, as in “3 of 120 holds”. A set with every item in view needs no total. When the controls do not fit on one line, the bar wraps and the total takes a line of its own.
  • One Apply button for each set of filters.
  • Keep Apply when a change reloads the page. See Compact form.
  • After Apply, the page shows what was applied: the server writes the chosen values back into the fields, and into the tags.
  • Sorting is not filtering. A Sort by select can end the row of filters; a table sorts from its column headers.
  • Filters whose levels narrow each other are one control, such as group, archive and category. It shows one path, broad to narrow, and it is changed, never removed. Filters that do not depend on each other each get a tag the reader can remove.