Lab

An accessible river report filter

This is a working demo of an inline filter over a short list of dated sample reports. A visitor can narrow the list by sample river and by date, and the list stays on the same page. That is the kind of index a guide or trip site uses when reports pile up and someone wants one water, or one stretch of dates, without opening a new page.

Sample data, not real conditions. The names, dates, and notes below are fictional. They are not current, they do not describe real water, and they should not be read as a fishing report.

It is modeled on the dated weekly reports index used for the Cal Fly Guy site. It is not that index, it does not use that site's wording or river names, and it is not a client result. This pattern is part of the Steelbridge Lab. It is a different pattern from the off-canvas "Filter the sample list" demo already on the Lab page, which hides filters in a drawer beside a generic list. To talk about a real project, use the contact form or call or text 541-602-0978.

The demo

Sample data, not real conditions.

Sample data, not real conditions.

Jump to a sample river (these links are for the no-JavaScript view, and remain useful as in-page headings): North Sample Water, East Sample Water, West Sample Water.

North Sample Water

  • Sample weekly note, 4 March 2019. A short fictional note for this demo.
  • Sample weekly note, 11 February 2019. A short fictional note for this demo.

East Sample Water

  • Sample weekly note, 18 March 2019. A short fictional note for this demo.
  • Sample weekly note, 21 January 2019. A short fictional note for this demo.

West Sample Water

  • Sample weekly note, 25 February 2019. A short fictional note for this demo.
  • Sample weekly note, 7 January 2019. A short fictional note for this demo.

The complete HTML, CSS, and JavaScript for this pattern are in the panels below. That is the full working source, not a snippet.

View code
<p class="rv-note"><strong>Sample data, not real conditions.</strong></p>
<div id="rv-filters" hidden>
  <fieldset>
    <legend>Sample river</legend>
    <label><input type="checkbox" name="river" value="north"> North Sample Water</label>
    <label><input type="checkbox" name="river" value="east"> East Sample Water</label>
    <label><input type="checkbox" name="river" value="west"> West Sample Water</label>
  </fieldset>
  <p class="rv-hint">Leave all boxes unchecked to see every sample river.</p>
  <label class="rv-date" for="rv-date">Date
    <select id="rv-date" name="date">
      <option value="">Any date</option>
      <option value="2019-01">January 2019</option>
      <option value="2019-02">February 2019</option>
      <option value="2019-03">March 2019</option>
    </select>
  </label>
</div>
<p class="rv-count" id="rv-count" aria-live="polite"></p>

<p class="rv-note"><strong>Sample data, not real conditions.</strong></p>
<p>Jump to a sample river (these links are for the no-JavaScript view, and remain useful as in-page headings): <a href="#north-sample-water">North Sample Water</a>, <a href="#east-sample-water">East Sample Water</a>, <a href="#west-sample-water">West Sample Water</a>.</p>
<noscript><p><strong>Sample data, not real conditions.</strong></p></noscript>
<section class="rv-group" id="north-sample-water" data-river="north">
  <h3>North Sample Water</h3>
  <ul>
    <li data-month="2019-03">Sample weekly note, 4 March 2019. A short fictional note for this demo.</li>
    <li data-month="2019-02">Sample weekly note, 11 February 2019. A short fictional note for this demo.</li>
  </ul>
</section>
<section class="rv-group" id="east-sample-water" data-river="east">
  <h3>East Sample Water</h3>
  <ul>
    <li data-month="2019-03">Sample weekly note, 18 March 2019. A short fictional note for this demo.</li>
    <li data-month="2019-01">Sample weekly note, 21 January 2019. A short fictional note for this demo.</li>
  </ul>
</section>
<section class="rv-group" id="west-sample-water" data-river="west">
  <h3>West Sample Water</h3>
  <ul>
    <li data-month="2019-02">Sample weekly note, 25 February 2019. A short fictional note for this demo.</li>
    <li data-month="2019-01">Sample weekly note, 7 January 2019. A short fictional note for this demo.</li>
  </ul>
</section>

What problem this solves

A reports index gets long. People often want one river, or one stretch of dates, and they want to keep their place on the page while they look. Sending them to a new URL for every combination works, but it is heavy for a short list. An inline filter keeps the list in view and lets them change the question without starting over.

This is not a live conditions tool, and it is not a search engine for a large archive. It is a way to scan a small, dated set of notes. The visible line "Sample data, not real conditions" is there so no one treats this demo as a report they could fish by.

Why it's built this way

The river choices are native checkboxes in a fieldset, with the legend "Sample river." The date filter is a native select. Each has a visible label, and the browser then provides the keyboard behavior and the accessible name. A custom checkbox or dropdown is usually where that support has to be rebuilt from scratch.

The list is ordinary headings and lists, grouped by sample river, so a screen-reader user can move by heading and a no-JavaScript user still has a complete, scannable page. In-page links jump to each group. Filtering hides unmatched notes in place. If a river group has no matching notes, its heading is hidden too, so an empty heading is never left behind (the other option is to keep the heading and show "No sample reports for this river"). The list is not given a reserved height. The page should not shift when it first loads. A change in height after someone uses a filter does not count toward cumulative layout shift, because it happens within 500 milliseconds of that input. When the system asks for reduced motion, notes appear and disappear at once, with no staggered enter animation.

The count is announced in a polite, debounced live region, for example "6 reports shown". It waits until the filters have settled, so someone moving through the checkboxes is not told a new number after every tick. The announcement is the count, not a reread of every remaining note.

This pattern stays on the page, beside the list. That is the difference from the Lab's existing "Filter the sample list" demo, which opens a drawer, then updates a generic sample list next to the button. A reports index is easier to use when the filters and the dated notes stay visible together.

The filter fields are in the HTML with the hidden attribute, and the script reveals them. Without JavaScript they stay hidden, so they never appear as filters that do not work. Every sample report stays on the page, grouped by river, and the jump links still work. A noscript note repeats "Sample data, not real conditions."

How a pattern like this is scoped, tested on staging, and launched on a real site is described on How we work.

Accessibility decisions and how they will be tested

These are the rules the build should follow. They have not been tested yet. Testing happens on staging, before any request to publish.

  • The words "Sample data, not real conditions" are visible above the filters, once at the top of the list, and in the noscript note. They are not repeated on every note.
  • The river checkboxes are in a fieldset whose legend is "Sample river." Every filter has a visible label. Checkboxes and the date select are native.
  • The list uses headings for each sample river and lists for the notes. In-page links point to those headings. When a filter leaves a group empty, that heading is hidden too, or the heading stays and the text "No sample reports for this river" is shown. No empty heading is left behind.
  • The result count updates in a polite, debounced live region, for example "6 reports shown" or "No reports shown". It does not fire on every rapid change, and it does not reread the list.
  • Focus is never trapped. Filtering does not move focus. The page should not shift on load.
  • The filter fields use the hidden attribute in the HTML and are revealed by the script, so they do not appear broken when JavaScript is off.
  • Copy buttons on the code panels have clear names, such as "Copy HTML". Scrollable code blocks can be focused with the keyboard (tabindex="0") and have an accessible label.
  • Contrast should meet WCAG AA in the Lab's light and dark themes, without using color alone to show that a filter is on or that a note is hidden. Targets are 44 pixels, the same size used sitewide.
  • The system reduced-motion setting is honored. Matching notes appear and disappear at once, with no staggered motion.

Test plan (to be run on staging, not claimed as done): a keyboard-only pass through the filters, the jump links, the list, and the code panels; the same pass with VoiceOver in Safari and with NVDA in a common Windows browser, checking that the count is announced once after the filters settle and is not noisy, and that empty river groups do not leave a bare heading; the page with JavaScript turned off, confirming the filters stay hidden, every note is still visible and grouped by river, and the noscript note is present; the page with reduced motion on; and both Lab themes. Watch for layout shift on load, not after a filter change. A Lighthouse accessibility score can be recorded as a check. It is not the pass.

Known limits

This demo filters a short, static list in the browser. It is not a search box, it does not page through hundreds of notes, and it does not load results from a server. A real archive that size needs a different approach, usually a search or a filter that runs on the server.

The date filter is a small set of months in 2019, plus "Any date." It does not handle time zones, a free-form date range, or "latest first" beyond the order already on the page. The river names and dates are invented for the demo, and the notes have no flow figures or current-looking conditions on purpose, so they cannot be mistaken for a real report.

Without JavaScript, the visitor sees every note and can jump to a river group, but the filters stay hidden and will not narrow the list. This page does not publish speed scores for the demo, and it does not claim results from any client site.

When you wouldn't use it

Do not use this pattern when the list is large enough that hiding items in the browser would be slow or hard to scan. Do not use it when the visitor needs live conditions or a real report; this demo is sample data, and a live index should not borrow its fictional notes. Do not present a filter like this without a clear label if the underlying data is also sample or delayed.

If all you need is a few categories beside a short list, the Lab's existing drawer filter may be enough, and this dated, grouped index would be more than the job requires. And do not replace a simple heading-and-list page with a filter that only works in JavaScript, unless the no-JavaScript view still shows every note, as this one does.

Questions about this demo

Are these real river reports?

No. The list is labeled "Sample data, not real conditions." The river names, dates, and notes are fictional, the dates are from 2019, and there are no real flow figures. It is not a current conditions page, and it is not the reports index on the Cal Fly Guy site. That index is only the model for the pattern.

Is this the same as the Lab's "Filter the sample list" demo?

No. That demo opens a drawer and filters a generic sample list. This one keeps native filters beside a dated list grouped by sample river, announces how many reports are shown, and is meant for a reports index. Both are demos in the Lab. This pattern lives in the Lab. The process around a pattern like this on a real site is on How we work.