shadcn.io is not affiliated with official shadcn/ui
Centered Category Grid Hero Block for React
A centred showcase hero over a grid of eight category links, each its own hairline cell with an icon, a short description and a template count.
Installation
Overview
A centred hero with a grid of browsable categories under it, for a fictional template marketplace. Between solid page rails, an announcement pill links to the full library, then a large two-line headline, one sentence and two calls to action: a ShineButton that sweeps a light across it on hover, and an outline Button, both links. Below them, eight category links sit in cells of their own, each drawing hairlines that run a little past its corners with a + on its start corner, and holding a Lucide icon, its name, a one-line description and how many templates it holds, two to a row on a phone and four from md. It's built from Announcement, Badge, Status, Shine Button, Button, Item and Guides, with a CSS entrance that brings the cells in one after another and stays still under reduced motion. For template marketplaces, directories, app stores, course catalogs and any site where visitors would rather browse than search.
FAQ
How do I change the categories?
Edit CATEGORIES at the top of the file. Each category has a title, a short description, a count shown as written (2,400+), an href and a Lucide icon. Eight fill two rows of four; four or twelve also make full rows, and an odd count leaves a gap on the last row on a phone. Keep the descriptions to a few words so the cells stay the same height.
Are the category cells real links?
Yes. Each one is our Item rendered as a link, so it opens with a click, Enter or a middle click, shows the item's focus ring and gets a subtle background on hover, with its icon darkening as the pointer comes over it. Point each href at the category's page.
On Base UI the item takes render={<a href="/templates/developer-tools" />}.
How are the cells' lines drawn?
With Guides, the component that draws the page rails. Each cell is relative with extend="sm" and a start mark, and the cells sit 1rem apart, exactly twice the overshoot, so neighbouring lines meet without crossing. The cell itself has no border: the item's own border is transparent, so the lines are the only edge.
How do screen readers read the category grid?
The grid is a list named Template categories, so a screen reader announces eight items before reading them. Each cell is one link whose name is its whole text, such as Developer tools, APIs, CLIs and SDKs, 2,400+ templates. The icons and the lines are hidden from assistive technology, and the headline is the page's one h1: the category names are not headings, so the page outline doesn't jump levels.
How does the grid fit on a phone?
The cells sit two to a row below the md breakpoint and four to a row above it. A long name or description wraps instead of being cut off, and the cells in a row keep the same height. The headline wraps, balanced, and the two actions wrap onto two lines when they don't fit side by side, with the first action on the first screen.
When should I use a category grid instead of a search bar hero?
Use the category grid when your library falls into a handful of clear groups and visitors may not know yet what they want: browsing by industry gets them started in one click. Use a search bar hero when the collection is large and most visitors arrive knowing what they're looking for.
Related
- Pro
Centered Search with Product Card Grid Hero
Interactive demosA centered showcase hero for a marketplace: a search form with the Shine Button and category pills that really filter a shelf of eight product cards in hairline cells.
- Pro
Split Search Bar Hero
Interactive demosA split hero whose call to action is a large search field with a Shine Button, popular searches, and, across a solid divider, a results panel that filters as you type.
- Pro
Centered Feature Cards Grid Hero
Features and tablesA showcase hero between solid rails: an announcement link, a centred headline and a Shine Button, over three feature cells with overshooting hairlines, each led by a greyscale vignette of the feature.
- Pro
Centered Integration Grid Hero
Logos and social proofA centered showcase hero for a workflow tool: an announcement link, two calls to action and the integration directory as a framed panel of twelve tiles that share their hairlines.
- Pro
Bento Grid Feature Showcase Hero
Features and tablesA showcase hero with the headline on one side and the pitch on the other, over a bento of six labelled product views in cells that share hairlines.
- Pro
Tabbed Feature Showcase Hero
Interactive demosA split hero for a code assistant: a headline, a Shine Button and an outline action at the start, and at the end a framed card with underline tabs for features, integrations and pricing.