A catalogue page: category tabs with counts over a grid of thumbnail cards, with New and Pro badges. Bring your own thumbnails, or draw them with the Sketch kit so they share one quiet visual language. Our /components and /blocks pages are built with it.
On this page
- Browse a component catalogue
- Template gallery
- Model or agent directory
- Category-filtered cards
- Live preview wall
Examples
Installation
npx knowns-ui@latest add catalog-gridPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Catalog grid from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/catalog-grid
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add catalog-grid
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- components/ui/knowns/kbd.tsx
- components/ui/knowns/field-class.ts
- components/ui/knowns/textarea.tsx
- components/ui/knowns/chat-composer/use-autosize.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/input.tsx
- components/ui/knowns/segmented-control.tsx
- components/ui/knowns/toggle-group.tsx
- components/ui/knowns/blocks/catalog/catalog-grid.tsx
- components/ui/knowns/blocks/catalog/catalog-utils.ts
- components/ui/knowns/blocks/catalog/placeholder.tsx
- components/ui/knowns/blocks/catalog/sketch.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/catalog-grid, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "catalog-grid" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- items
CatalogItem[]- { id, title, category, href?, description?, count?, isNew?, pro?, thumb? }. The whole card is the link.
- categories / labels
string[] / Record<string, string>- Tab order, and tab labels when they differ from the ids. All comes first, with counts.
- category / defaultCategory / onCategoryChange
string- Default
"all" - The tab (controlled or not).
- tabs
boolean- Default
true - Show the category tabs.
- countNoun
string- Default
"example" - What `count` counts. Shown from 2 up.
- onSelect / empty
(item) => void / ReactNode- For cards without href; what an empty tab says.
- tiers / tier / onTierChange
boolean / CatalogTier- Default
false / "all" - Pills for All, New, Free and Pro with counts, read from each item's isNew and pro.
- search / query / onQueryChange
boolean / string- Default
false - A search box over the titles. Controlled with query, or not.
- layout / sectionHref
"tabs"|"sections"- Default
"tabs" - sections: one titled section per category with its count, no tabs. sectionHref links a section title.
- interactive
boolean- Default
false - Live demos people can use. A live card hands the pointer to its demo and shows Pause and Open buttons over the thumbnail corner (on hover or focus with a mouse, always on touch). Runs on touch and narrow screens too, never with reduced motion or Save-Data. The grid is one column on phones, where only the card nearest the middle of the screen runs.
- pausable (item)
boolean- Default
false - The item's preview takes `paused` and freezes in place. Without it, Pause takes a page demo off the screen back to the poster and Play brings it back.
- liveNotice
ReactNode|({ live, narrow }) => ReactNode- A line above the tabs. The function form knows whether demos run on this device, so the line never promises motion that is off.
- liveOn
"view"|"hover"- Default
"view" - When a live preview mounts: as a card scrolls into view, or only while a card is hovered or focused (nothing runs at load).
- placeholder (item)
ReactNode- The poster while the card waits to go live or its preview loads, instead of thumb, e.g. <CatalogPlaceholder shape="block" />. Only where cards go live in view: devices that never go live, live={false} and liveOn="hover" keep thumb, so no card stays a skeleton. The live preview fades in over it (opacity, 120ms) with no layout shift.
| Prop | Type | Default | Description |
|---|---|---|---|
| items | CatalogItem[] | - | { id, title, category, href?, description?, count?, isNew?, pro?, thumb? }. The whole card is the link. |
| categories / labels | string[] / Record<string, string> | - | Tab order, and tab labels when they differ from the ids. All comes first, with counts. |
| category / defaultCategory / onCategoryChange | string | "all" | The tab (controlled or not). |
| tabs | boolean | true | Show the category tabs. |
| countNoun | string | "example" | What `count` counts. Shown from 2 up. |
| onSelect / empty | (item) => void / ReactNode | - | For cards without href; what an empty tab says. |
| tiers / tier / onTierChange | boolean / CatalogTier | false / "all" | Pills for All, New, Free and Pro with counts, read from each item's isNew and pro. |
| search / query / onQueryChange | boolean / string | false | A search box over the titles. Controlled with query, or not. |
| layout / sectionHref | "tabs" | "sections" | "tabs" | sections: one titled section per category with its count, no tabs. sectionHref links a section title. |
| interactive | boolean | false | Live demos people can use. A live card hands the pointer to its demo and shows Pause and Open buttons over the thumbnail corner (on hover or focus with a mouse, always on touch). Runs on touch and narrow screens too, never with reduced motion or Save-Data. The grid is one column on phones, where only the card nearest the middle of the screen runs. |
| pausable (item) | boolean | false | The item's preview takes `paused` and freezes in place. Without it, Pause takes a page demo off the screen back to the poster and Play brings it back. |
| liveNotice | ReactNode | ({ live, narrow }) => ReactNode | - | A line above the tabs. The function form knows whether demos run on this device, so the line never promises motion that is off. |
| liveOn | "view" | "hover" | "view" | When a live preview mounts: as a card scrolls into view, or only while a card is hovered or focused (nothing runs at load). |
| placeholder (item) | ReactNode | - | The poster while the card waits to go live or its preview loads, instead of thumb, e.g. <CatalogPlaceholder shape="block" />. Only where cards go live in view: devices that never go live, live={false} and liveOn="hover" keep thumb, so no card stays a skeleton. The live preview fades in over it (opacity, 120ms) with no layout shift. |
Sketch kit
Thumbnails in one visual language: a 160 by 100 drawing in the text colour at a few fixed opacities, with hairlines and small radii. Compose Box, Bar, Text, Dot, Pill and Line; mark the one active element with strong.
Placeholders
What a card shows while it waits to go live or its preview loads: a static skeleton shaped like the preview it stands for. A centred sample for a component, a panel for a block, a page for a template. Pass one as an item's placeholder.
What it handles
- 01Builds the category tabs from your items: orderCategories puts the ids you list in `categories` first, then any others in order of first use, each with its count.
- 02Lays the cards in 2, 3 or 5 columns by container width, or 1, 2 or 3 page-sized columns with size="page" for full-page items such as templates.
- 03Draws the badges for you: a New dot, a Pro badge, an outline Pro variants badge for a Free item with Pro variants, a kind label, and a count that shows from 2 examples up.
- 04Mounts the optional live `preview` of a card only when it nears the viewport, a whole row at a time, nearest the middle first, and never more than `maxLive` at once.
- 05Keeps the poster instead of a live preview on touch screens, narrow viewports, Save-Data and reduced motion, so the grid stays cheap there.
- 06Fits a preview to its card with `previewWidth`: a fixed design width scaled down from the top, or "fit" to measure the content and centre it, scaled up by at most 1.75x.
States
- First render
- Nothing. The posters paint as they are
- none
- Card goes live
- The live preview fades in over the poster once it has mounted
- 180ms, ease out
- Rows mount while scrolling
- Fresh rows go live one after the next once scrolling settles
- up to 3 steps of 40ms
- Hover a card
- The thumbnail background and inner border darken
- 180ms, ease out
- Press a card
- The whole card scales to 97%
- 180ms, ease out
- Change tab
- The grid swaps to the chosen category at once
- none
- Reduced motion
- No press scale, no fade, and no live previews
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The posters paint as they are | none |
| Card goes live | The live preview fades in over the poster once it has mounted | 180ms, ease out |
| Rows mount while scrolling | Fresh rows go live one after the next once scrolling settles | up to 3 steps of 40ms |
| Hover a card | The thumbnail background and inner border darken | 180ms, ease out |
| Press a card | The whole card scales to 97% | 180ms, ease out |
| Change tab | The grid swaps to the chosen category at once | none |
| Reduced motion | No press scale, no fade, and no live previews | 0ms |
Works with
When to use
When to use
- A page that lists your components, templates or integrations by category, with thumbnails.
- Marking what is new or paid in a catalogue at a glance.
When not to use
- Articles with authors and dates: use Blog Grid.
- Searching across many kinds of pages: use Search Results.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Catalog Grid to my app and wire it to my own data.
- I need a page that lists your components, templates or integrations by category, with thumbnails. Set that up with the Knowns UI Catalog Grid.
- Which Catalog Grid props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "catalog-grid" }) and search_docs({ query: "catalog grid" }).