A searchable, filterable, sortable collection that keeps its state in the address with no script.
<p>Server-rendered into the page. Every control is a form field or a link, so it works with no script; the behavior swaps the changed regions in place and writes the address.</p>
<div id="catalog-wide" data-catalog-demo></div>
What queryCatalog returned for this request's address.
title
(item: T) => ReactNode
Yes
The first column's cell: the item's name, usually a link to it.
cells
Partial<Record<string, (item: T) => ReactNode>>
A field's cell, when its plain words (the values joined) are not enough.
labelledBy
string
Yes
The page's heading id, which names the results region.
emptyText
{ nothingYet?: ReactNode; noMatch?: ReactNode }
What to say when the collection itself is empty, and the sentence under "No articles match".
actions
ReactNode
Beside the count: downloads, a view switch.
Functions
Function
Signature
Does
formHref
(form: HTMLFormElement): string
The form's state as an address: every named control with a value, in the order the form lists them. The server reads it with parseCatalogParams, so a control that is not in the address is at its default.
attachCatalog
(form: HTMLFormElement): () => void
enhance
(root?: ParentNode): () => void
Attaches to every catalog under root that is not attached yet. Returns a function that detaches them all.
Parts and data attributes
Class
Is
.cap-catalog
the root
.cap-catalog-actions
a part
.cap-catalog-apply
a part
.cap-catalog-body
a part
.cap-catalog-chip
a part
.cap-catalog-chips
a part
.cap-catalog-clear
a part
.cap-catalog-count
a part
.cap-catalog-facet
a part
.cap-catalog-filters
a part
.cap-catalog-group
a part
.cap-catalog-main
a part
.cap-catalog-more
a part
.cap-catalog-n
a part
.cap-catalog-sort
a part
.cap-catalog-status
a part
.cap-catalog-tray-head
a part
.cap-catalog-tray-open
a part
.cap-catalog-tray-title
a part
Attribute
Values
data-catalog-region
results
data-enhanced
present or absent
data-reflow
present or absent
data-tray
open
State
Read from
:focus-visible
the platform
:target
the platform
[aria-busy="true"]
an attribute
Accessibility
Key
Does
Tab
Search, sort, Filters (on a phone), each facet's options, then the chips, the results and the pages
Type in search
Updates the results after a short pause; Enter updates at once
Space on a check or radio
Chooses it; the results, counts and chips follow
Enter on a chip or Clear all
Removes that filter, or all; focus moves to the count
Escape, with the tray open
Closes it and returns focus to "Filters"
A labeled form; each facet is a fieldset with a legend; every control has a visible label.
The count is a polite live region. The results region is aria-busy while it updates.
A removable chip's name says it removes ("Topic: Pricing (remove this filter)").
The card layout of the table is the table component's opt-in reflow; it has not yet been checked with a screen reader, so the catalog says so here and an app should check it before relying on it (DEFAULTS.md).