Category Cards Grid
A grid of category cards with overlay photos; each card reveals a "Shop now" link on hover, built for a storefront's top-level navigation section. Every card is itself a link, so "Shop now" is a visual cue rather than the only clickable target.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/category-cards-grid.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/ecommerce/ecommerce30.tsx instead.
Usage
The file also exports ecommerce30Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Ecommerce30, ecommerce30Demo } from "@/components/blocks/ecommerce/ecommerce30"; export default function Page() { return <Ecommerce30 {...ecommerce30Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Shop by category" | Heading above the category grid. |
| description | string | "Browse the full catalog, organized the way you actually shop." | Supporting sentence under the heading. |
| categories | CategoryCard[] | [] | Category cards to render in the grid. |
| className | string | none | Extra classes for the outer section element. |
Types
type CategoryCard = { name: string; itemCount: number; href: string; image?: { src: string; alt: string }; };
Behavior notes
- Fully static server component: the entire card is a real Next.js Link to href, the name and item count are always visible, and only the "Shop now" label and arrow fade/slide in on hover via pure CSS (group-hover), no JavaScript involved.
- A category without an image falls back to a centered Package icon on a muted background instead of a broken image.
- The dark gradient overlay is always present (not just on hover) so the name and count stay legible against any photo.
- itemCount is rendered as a plain number ('42 items'); it is not recalculated from any live inventory source.
More Ecommerce Blocks
View all →wishlist-manager
Wishlist Manager
Saved-items list with stock-status badges, move-to-cart and remove actions, and a real empty state.
product-information-tabs
Product Information Tabs
Tabbed product details with Description, Features, Specifications, Reviews, and Shipping panels.
collection-showcase-grid
Collection Showcase Grid
A large featured-collection hero card alongside a grid of smaller supporting collection tiles.
shop-by-brand-grid
Shop by Brand Grid
A grid of bordered brand tiles with a wordmark-style name, product count, and a hover affordance.
sale-countdown-timer
Sale Countdown Timer
A live days/hours/minutes/seconds countdown in default, compact, or full-width banner layouts.
gift-card-redemption-form
Gift Card Redemption Form
A code-entry form that validates against a fixed list of demo gift cards and shows a real success or error state.