Store Header
Logo, primary navigation with hover dropdown panels, an icon action row with count badges and a slide-down mobile menu. Shrinks when scrolled.
npx shadcn@latest add https://ui.develop-better-solutions.com/r/store-header.jsonDependencies:
lucide-reactUsage
store-header-example.tsx
"use client";
import { useState } from "react";
import { Heart, Search, ShoppingBag, User } from "lucide-react";
import { StoreHeader } from "@dbs/ui";
export default function StoreHeaderExample() {
const [bag, setBag] = useState(2);
const icon = "h-[18px] w-[18px]";
return (
<div className="min-h-[420px] w-full">
<StoreHeader
sticky={false}
logo={<span className="text-xl font-semibold tracking-tight">Atelier</span>}
nav={[
{ label: "Home", href: "#" },
{
label: "Products",
items: [
{ label: "Seating", href: "#", note: "12 pieces" },
{ label: "Lighting", href: "#", note: "9 pieces" },
{ label: "Storage", href: "#", note: "7 pieces" },
],
},
{
label: "Collections",
items: [
{ label: "Living room", href: "#", note: "New" },
{ label: "Bedroom", href: "#", note: "Calm" },
],
},
{ label: "About", href: "#" },
]}
actions={[
{ id: "search", label: "Search", icon: <Search className={icon} strokeWidth={1.5} /> },
{ id: "saved", label: "Saved", icon: <Heart className={icon} strokeWidth={1.5} />, count: 3, hideOnMobile: true },
{ id: "account", label: "Sign in", icon: <User className={icon} strokeWidth={1.5} />, hideOnMobile: true },
{ id: "cart", label: "Open cart", icon: <ShoppingBag className={icon} strokeWidth={1.5} />, count: bag, onClick: () => setBag((n) => n + 1) },
]}
/>
</div>
);
}