Skip to content

Catalog Grid

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
Used for
  • Browse a component catalogue
  • Template gallery
  • Model or agent directory
  • Category-filtered cards
  • Live preview wall

Examples

Installation

npx knowns-ui@latest add catalog-grid
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

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
Defaulttrue
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
Defaultfalse / "all"
Pills for All, New, Free and Pro with counts, read from each item's isNew and pro.
search / query / onQueryChange
boolean / string
Defaultfalse
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
Defaultfalse
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
Defaultfalse
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.

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.

Preview

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 05Keeps the poster instead of a live preview on touch screens, narrow viewports, Save-Data and reduced motion, so the grid stays cheap there.
  6. 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

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

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" }).

Need help?

Stuck on Catalog Grid, or found something off? We read every message.