shadcn.io is not affiliated with official shadcn/ui
Sitemap Filter Footer Block for Radix UI
A sitemap footer for a documentation host: a search field that filters 36 links across six columns as you type, with a live count and a clear button.
Installation
Overview
A sitemap footer for React with Radix UI. A lean band holds the wordmark and one sentence; under it, a band with a search field and a live count; under that, a nav labelled Footer with six columns (Platform, Authoring, Integrations, Learn, Company, Trust) of six pages each. Type in the field and the links that don't match disappear, the matched letters are marked in the ones that stay, a column with no match drops out, and the count reads "24 of 36 pages". If nothing matches, a message and a Clear filter button take the place of the columns. The / key focuses the field from anywhere on the page, and Escape clears it. The page's rails and top rule come from the Guides spine. It's built from Input Group, Kbd, Search Highlight Text, Guides and your theme's tokens.
FAQ
How do I change the pages?
Edit GROUPS at the top of the file: each group is a title and its links (an href and a label). The count is worked out from the data, so it never needs editing. Every link is an anchor with href="#": point each at its page or use your router's link. The filter compares labels only; to also match a description or a section name, change matches to read it.
How does the filter match?
It ignores case and accents, so "api" finds "API pages" and "resume" finds "Résumé", and it matches anywhere in the label, not only at the start. A blank field shows everything. Matching letters are marked with the catalog's Search Highlight Text, in a light tint of your foreground colour.
Is the count announced to screen readers?
Yes. The count is a status line that is polite, so a screen reader reads the new number after you pause typing, without interrupting. The field has its own name, Filter the sitemap, and the clear button is named Clear the filter. When nothing matches, the status reads "No pages match" and the message below says so too.
What does the / key do?
It moves focus to the field, as in many docs sites, unless you are already typing in a field, an editable area or a menu, and unless Ctrl, Command or Alt is held. The key is announced to assistive technology as the field's shortcut. If your page already uses / for its own search, remove the effect that listens for it and the hint beside the field.