Navigation
Filter chips and tags
Filter chips narrow one list by category; tags show static labels such as a skill or a language.
- Block
.hs-chips- CSS
components/chips.css(in/brand.css)- JS
components/chips.js: load it only on a page with this component- Status
- Decided
- Markdown
- /components/chips.md
What it is
A filter chip filters one list: 40px pill, 16px/600 sentence case, 1px line-strong border. The current chip fills navy. A tag is a static label, not a link.
When to use
- Filter chips: categories over one list, such as benefit categories on
/benefitsor article topics on/articles. - Filter chips: the Articles filter on the member profile.
- Tags: static facts on a profile, such as skills and languages, with an optional level.
When not to use
- To switch between sibling views at their own URLs, use Tabs.
- For a status on a card (“Optional upgrade”), use the card tag
.hs-card__tagin Card. - For an action, use a Button. A chip only filters.
Rules
- Filter chips:
ul.hs-chips>li>a.hs-chiporbutton.hs-chip. Wrap link chips in anavwith anaria-label. - Mark the current link chip with
aria-current="page", and a button chip witharia-pressed. The current chip fills navy. Never gold. - Write chip labels in sentence case, as the editors wrote the category names. No uppercase.
- Add
.hs-chips--scrollfor one line that scrolls sideways. Add.hs-chips--wrap-wideas well when the row may wrap from 62rem. - Add
.hs-chips--one-rowwith.hs-chips--scroll, in place of.hs-chips--wrap-wide, when the row stays one line at every width. Loadchips.js: it scrolls the current chip into view and setsdata-morewhile chips sit past the end edge, anddata-morefades the end edge. Use it for a catalog's main filter that sits in a sticky bar, as on/benefitsand/scholarship-directory. The bar sticks only while a chip other than the first ("All") is current: with "All" nothing is filtered, so the bar scrolls away with the page. - A catalog's main filter is a
nav.hs-filter-chipsabove the filter panel: one chip per value withsvg.hs-chip__icon(grey line icon) before the label andspan.hs-chip__countafter it. The panel keeps the other filters. - Tags:
ul.hs-chipswith anaria-label>li.hs-tag. Put a level inspan.hs-tag__meta. A tag is never a link and has no hover. - The colours follow the ground through the
--hs-ctx-*properties. On.hs-band--navythe current chip label turns navy.
Accessibility
- The current state hangs on
aria-currentoraria-pressed, so it reaches the accessibility tree. - Contrast: chip label ink 13.0:1, current chip white on navy 12.4:1, tag ink on soft 12.2:1, tag level slate 5.9:1. The icon is slate-500, 3.7:1 on white and soft (non-text 3:1).
- A chip is 40px tall, a full tap target. A tag is not interactive, so it has no 40px height.
- Link chips are real URLs (
?category=careers) and work without JavaScript. - The scrolling row has padding for the focus outline. Transitions stop under
prefers-reduced-motion: reduce. - The end fade of a one-row row is a mask only. Every chip stays in the tab order and in the accessibility tree.
Variants
Filter chips
A link chip uses aria-current="page"; a button chip uses aria-pressed. Add hs-chips--scroll for one line that scrolls.
Preview on white
<nav aria-label="Benefit categories">
<ul class="hs-chips">
<li><a class="hs-chip" href="?category=all">All benefits</a></li>
<li><a class="hs-chip" href="?category=careers" aria-current="page">Careers</a></li>
<li><a class="hs-chip" href="?category=education">Education</a></li>
</ul>
</nav>Catalog filter chips
The main filter of a catalog: icon, label and count. One row that scrolls on a phone and wraps from 62rem.
Preview on white
<nav class="hs-filter-chips" aria-label="Category">
<ul class="hs-chips hs-chips--scroll hs-chips--wrap-wide">
<li><a class="hs-chip" href="/benefits" aria-current="page"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M4 4h7v7H4z M13 4h7v7h-7z M4 13h7v7H4z M13 13h7v7h-7z"/></svg><span>All</span> <span class="hs-chip__count">33</span></a></li>
<li><a class="hs-chip" href="/benefits?category=careers"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M4 7h16a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1z M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2 M3 13h18"/></svg><span>Careers</span> <span class="hs-chip__count">9</span></a></li>
<li><a class="hs-chip" href="/benefits?category=education"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M2 9l10-5 10 5-10 5z M6 11v5c0 1.5 2.7 3 6 3s6-1.5 6-3v-5 M22 9v6"/></svg><span>Education</span> <span class="hs-chip__count">11</span></a></li>
</ul>
</nav>One-row chips
One row at every width. Narrow the window: chips.js brings the current chip into view and fades the end edge while more chips sit past it.
Preview on white
<nav class="hs-filter-chips" aria-label="Category">
<ul class="hs-chips hs-chips--scroll hs-chips--one-row">
<li><a class="hs-chip" href="/benefits"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M4 4h7v7H4z M13 4h7v7h-7z M4 13h7v7H4z M13 13h7v7h-7z"/></svg><span>All</span></a></li>
<li><a class="hs-chip" href="/benefits?field_category_tid=8864"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M5 8h14l-1 12H6z M9 8V6a3 3 0 0 1 6 0v2"/></svg><span>Apparel</span></a></li>
<li><a class="hs-chip" href="/benefits?field_category_tid=12"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M4 7h16a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1z M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2 M3 13h18"/></svg><span>Careers</span></a></li>
<li><a class="hs-chip" href="/benefits?field_category_tid=5436"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M7 3v8 M5 3v5a2 2 0 0 0 4 0V3 M7 11v10 M17 3c-1.7 1-3 3.5-3 6.5V13h3v8"/></svg><span>Dining</span></a></li>
<li><a class="hs-chip" href="/benefits?field_category_tid=7"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M2 9l10-5 10 5-10 5z M6 11v5c0 1.5 2.7 3 6 3s6-1.5 6-3v-5 M22 9v6"/></svg><span>Education</span></a></li>
<li><a class="hs-chip" href="/benefits?field_category_tid=39311"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z"/></svg><span>Health</span></a></li>
<li><a class="hs-chip" href="/benefits?field_category_tid=31875" aria-current="page"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="9" r="5.4"/><path d="M8.4 13.5 7 21l5-2.7L17 21l-1.4-7.5"/></svg><span>Regalia</span></a></li>
<li><a class="hs-chip" href="/benefits?field_category_tid=9"><svg class="hs-chip__icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M3 12h18 M12 3a14 14 0 0 1 0 18 M12 3a14 14 0 0 0 0 18 M12 3a9 9 0 1 1 0 18a9 9 0 0 1 0-18z"/></svg><span>Travel</span></a></li>
</ul>
</nav>Tags
14px/600 ink on soft, with an optional slate part for a level.
Preview on white
- Public speaking
- Spanish
- Data analysis
<ul class="hs-chips" aria-label="Skills">
<li class="hs-tag">Public speaking</li>
<li class="hs-tag">Spanish <span class="hs-tag__meta">Fluent</span></li>
<li class="hs-tag">Data analysis</li>
</ul>