Staaarter

Product Dropdown Icons

A nav item labeled with a chevron that, on click, opens a wide panel below the header showing a grid of product links. Each entry pairs a small icon with a title and a one-line description, the standard mega-menu style product picker.

By Staaarter Team
Navbar
Docs
Live preview

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/product-dropdown-icons.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/navbar/navbar10.tsx instead.

Usage

The file also exports navbar10Demo, 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 { Navbar10, navbar10Demo } from "@/components/blocks/navbar/navbar10";

export default function Page() {
  return <Navbar10 {...navbar10Demo} />;
}

Props

PropTypeDefaultDescription
wordmarkstring"Meridian"Logo text rendered as a bold wordmark.
triggerLabelstring"Products"Label for the dropdown trigger nav item.
productsProductItem[]noneGrid entries shown in the dropdown panel, rendered in order.
links{ label: string; href: string }[]noneAdditional plain nav links shown next to the dropdown trigger.
classNamestringnoneExtra classes for the outer header element.

Types

type ProductItem = {
  title: string;
  description: string;
  href: string;
};

Behavior notes

  • Real client-side state: clicking the trigger toggles a useState boolean that conditionally renders the product grid panel.
  • Icons are not passed through props: a fixed array of six lucide-react icons is hardcoded inside the component and indexed by each product's array position, because a "use client" block can never accept a component reference (e.g. an icon) as prop data.
  • The chevron next to the trigger rotates based on the same open state to hint at the expanded/collapsed direction.