BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/efferd/header-2

header-2

efferd/header-2
FreeBlock

Elegant responsive header with scroll-based styling, mobile drawer menu, and smooth transitions.

Install it

npx shadcn@latest add https://legacy.efferd.com/r/header-2.json

Source

registry/blocks/header/2/header.tsxlegacy.efferd.com/r/header-2.json
1"use client";
2import React from "react";
3import { createPortal } from "react-dom";
4import { Logo } from "@/components/logo";
5import { MenuToggleIcon } from "@/components/menu-toggle-icon";
6import { Button, buttonVariants } from "@/components/ui/button";
7import { useScroll } from "@/hooks/use-scroll";
8import { cn } from "@/lib/utils";
9
10export function Header() {
11 const [open, setOpen] = React.useState(false);
12 const scrolled = useScroll(10);
13
14 const links = [
15 {
16 label: "Features",
17 href: "#",
18 },
19 {
20 label: "Pricing",
21 href: "#",
22 },
23 {
24 label: "About",
25 href: "#",
26 },
27 ];
28
29 React.useEffect(() => {
30 if (open) {
31 // Disable scroll
32 document.body.style.overflow = "hidden";
33 } else {
34 // Re-enable scroll
35 document.body.style.overflow = "";
36 }
37
38 // Cleanup when component unmounts (important for Next.js)
39 return () => {
40 document.body.style.overflow = "";
41 };
42 }, [open]);
43
44 return (
45 <header
46 className={cn(
47 "sticky top-0 z-50 mx-auto w-full max-w-4xl border-transparent border-b md:rounded-md md:border md:transition-all md:ease-out",
48 {
49 "border-border bg-background/95 backdrop-blur-lg supports-[backdrop-filter]:bg-background/50 md:top-4 md:max-w-3xl md:shadow":
50 scrolled,
51 }
52 )}
53 >
54 <nav
55 className={cn(
56 "flex h-14 w-full items-center justify-between px-4 md:h-12 md:transition-all md:ease-out",
57 {
58 "md:px-2": scrolled,
59 }
60 )}
61 >
62 <a className="rounded-md p-2 hover:bg-accent" href="#">
63 <Logo className="h-4" />
64 </a>
65 <div className="hidden items-center gap-2 md:flex">
66 {links.map((link, i) => (
67 <a
68 className={buttonVariants({ variant: "ghost" })}
69 href={link.href}
70 key={i}
71 >
72 {link.label}
73 </a>
74 ))}
75 <Button variant="outline">Sign In</Button>
76 <Button>Get Started</Button>
77 </div>
78 <Button
79 className="md:hidden"
80 onClick={() => setOpen(!open)}
81 size="icon"
82 variant="outline"
83 >
84 <MenuToggleIcon className="size-5" duration={300} open={open} />
85 </Button>
86 </nav>
87
88 <MobileMenu className="flex flex-col justify-between gap-2" open={open}>
89 <div className="grid gap-y-2">
90 {links.map((link) => (
91// … truncated

What it pulls in

Other registry items

  • button

Files it writes

  • registry/blocks/header/2/header.tsx
  • components/logo.tsx
  • components/menu-toggle-icon.tsx
  • hooks/use-scroll.ts

Facts

Registry
efferd
Type
registry:block
Access
Free
Files written
4
Licence
NOASSERTION
First indexed
2026-08-01
Last confirmed
today

Go to the source

legacy.efferd.com shabanhr/efferd-ui on GitHub Raw registry item This item as JSON

More from efferd

All 40 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
auth-1auth-1efferdBlocksFreeno deps · 2 files
auth-2auth-2efferdBlocksFree1 dep · 3 files
contact-1contact-1efferdBlocksFreeno deps
contact-2contact-2efferdBlocksFreeno deps
cta-1cta-1efferdBlocksFreeno deps
cta-2cta-2efferdBlocksFreeno deps
cta-3cta-3efferdBlocksFreeno deps
cta-4cta-4efferdBlocksFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex