{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "header-2",
"type": "registry:block",
"description": "Elegant responsive header with scroll-based styling, mobile drawer menu, and smooth transitions.",
"registryDependencies": [
"button"
],
"files": [
{
"path": "registry/blocks/header/2/header.tsx",
"content": "\"use client\";\nimport React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Logo } from \"@/components/logo\";\nimport { MenuToggleIcon } from \"@/components/menu-toggle-icon\";\nimport { Button, buttonVariants } from \"@/components/ui/button\";\nimport { useScroll } from \"@/hooks/use-scroll\";\nimport { cn } from \"@/lib/utils\";\n\nexport function Header() {\n const [open, setOpen] = React.useState(false);\n const scrolled = useScroll(10);\n\n const links = [\n {\n label: \"Features\",\n href: \"#\",\n },\n {\n label: \"Pricing\",\n href: \"#\",\n },\n {\n label: \"About\",\n href: \"#\",\n },\n ];\n\n React.useEffect(() => {\n if (open) {\n // Disable scroll\n document.body.style.overflow = \"hidden\";\n } else {\n // Re-enable scroll\n document.body.style.overflow = \"\";\n }\n\n // Cleanup when component unmounts (important for Next.js)\n return () => {\n document.body.style.overflow = \"\";\n };\n }, [open]);\n\n return (\n