A blog index: a featured post and a grid of cards with cover, tags, title, excerpt, author, date and reading time. Tag chips filter it, and Load more or numbered pages page through it.
Used for
- Engineering blog index
- Release posts archive
- Tagged post lists
- Featured article
Examples
List layout
Preview
Installation
npx knowns-ui@latest add blog-gridFor Claude Code, Cursor or Codex: installs it and wires the props to your own data.
Paste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install prompt
Install Blog 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/blog-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 blog-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/spinner.tsx
- components/ui/knowns/button.tsx
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/code-block/code-block.tsx
- components/ui/knowns/code-block/code-block-utils.ts
- components/ui/knowns/blocks/content/prose.tsx
- components/ui/knowns/blocks/content/content-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
- 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/select.tsx
- components/ui/knowns/pagination.tsx
- components/ui/knowns/toggle-group.tsx
- components/ui/knowns/blocks/content/blog-grid.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/blog-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: "blog-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
- posts
BlogPostSummary[]- { id, title, excerpt?, href?, tags?, author: { name, avatar? }, date, minutes?, cover?: { src?, alt?, hue? }, featured? }. Without src, the cover is a pattern in the given hue.
- title / description
ReactNode- The header.
- featured
boolean- Default
true - The featured (or first) post as a large card. Hidden while a tag is selected.
- filter
boolean- Default
true - Tag chips with counts.
- layout
"grid"|"list"- Default
"grid" - Grid: a featured card and cards. List: compact rows with a small cover, for archives.
- pageSize / paging
number / "load-more"|"pagination"- Default
6 / "load-more" - How the grid pages.
- onSelect
(post) => void- For cards without href, or to track clicks.
- empty
ReactNode- Default
built-in - Shown when a tag has no posts.
| Prop | Type | Default | Description |
|---|---|---|---|
| posts | BlogPostSummary[] | - | { id, title, excerpt?, href?, tags?, author: { name, avatar? }, date, minutes?, cover?: { src?, alt?, hue? }, featured? }. Without src, the cover is a pattern in the given hue. |
| title / description | ReactNode | - | The header. |
| featured | boolean | true | The featured (or first) post as a large card. Hidden while a tag is selected. |
| filter | boolean | true | Tag chips with counts. |
| layout | "grid" | "list" | "grid" | Grid: a featured card and cards. List: compact rows with a small cover, for archives. |
| pageSize / paging | number / "load-more" | "pagination" | 6 / "load-more" | How the grid pages. |
| onSelect | (post) => void | - | For cards without href, or to track clicks. |
| empty | ReactNode | built-in | Shown when a tag has no posts. |
What it handles
- 01Shows a large featured card, the first post or the one marked featured, above a grid of cards with cover, tags, title, excerpt, author, date and reading time.
- 02Builds tag chips from the posts with a count each, and hides the featured card while a tag filter is active.
- 03Pages the rest with a Load more button or numbered Pagination, set by paging and pageSize with a default of 6.
- 04Renders every card as a link when it has an href and as a button that calls onSelect when it does not.
- 05Switches layout to list for compact archive rows with a small cover that appears from 520px.
- 06Shows an empty state with a Show all posts button when a tag leaves nothing, and announces the filtered count for screen readers.
States
- First render
- Nothing. The cards paint as they are
- none
- Card hover
- The cover scales up slightly
- 280ms, ease out
- Tag filter
- The list changes at once and the page resets to 1
- none
- Load more
- The next page of cards is added to the grid
- none, at once
- Reduced motion
- The cover stays still
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The cards paint as they are | none |
| Card hover | The cover scales up slightly | 280ms, ease out |
| Tag filter | The list changes at once and the page resets to 1 | none |
| Load more | The next page of cards is added to the grid | none, at once |
| Reduced motion | The cover stays still | 0ms |
Works with
When to use
When to use
- A blog or news index with a featured post and filters by tag.
- Any card grid of articles: guides, case studies, release notes.
When not to use
- One article's page: use Blog Post.
- Dated product updates: use Changelog Feed.
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 Blog Grid to my app and wire it to my own data.
- I need a blog or news index with a featured post and filters by tag. Set that up with the Knowns UI Blog Grid.
- Which Blog Grid props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "blog-grid" }) and search_docs({ query: "blog grid" }).