BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/uifoundry/custom-header

Custom Header

uifoundry/custom-header
UnverifiedBlock

Fully customizable header component with nested blocks for brand logo, menu items, and buttons

Install it

npx shadcn@latest add https://raw.githubusercontent.com/UIFoundry/uifoundry/master/custom-header.json

Source

registry/payload/blocks/custom-header/index.tsxraw.githubusercontent.com/UIFoundry/uifoundry/master/custom-header.json
1"use client";
2
3import type { CustomHeaderBlock } from "~/payload-types";
4import RenderBlocks from "@/registry/default/components/RenderBlocks";
5import { useEffect, useState } from "react";
6import { cn } from "@/registry/default/utils";
7import { blockComponents } from "./blocks";
8import { Menu, X } from "lucide-react";
9import { BLOCK_SLUG_HEADER_MENU_ITEMS } from "@/registry/default/lib/constants/blocks";
10
11export default function Header({
12 preview = false,
13 items,
14}: {
15 preview?: boolean;
16} & CustomHeaderBlock) {
17 const [menuState, setMenuState] = useState(false);
18 const [isScrolled, setIsScrolled] = useState(false);
19
20 useEffect(() => {
21 const handleScroll = () => {
22 setIsScrolled(window.scrollY > 50);
23 };
24 window.addEventListener("scroll", handleScroll);
25 return () => {
26 window.removeEventListener("scroll", handleScroll);
27 };
28 });
29
30 return (
31 <header>
32 <nav
33 data-state={menuState && "active"}
34 id="header"
35 className={cn("fixed z-20 w-full px-2", preview && "relative")}
36 >
37 <div
38 className={cn(
39 "mx-auto mt-4 mb-8 max-w-6xl px-6 transition-all duration-300 lg:px-12",
40 isScrolled &&
41 "bg-background/50 max-w-4xl rounded-2xl border backdrop-blur-lg lg:px-5",
42 )}
43 >
44 <div className="relative flex flex-wrap items-center justify-between gap-6 px-4 py-3 lg:gap-0 lg:py-4">
45 <div className="flex w-full items-center justify-between">
46 <div className="flex justify-between lg:hidden lg:w-auto">
47 <button
48 onClick={() => setMenuState(!menuState)}
49 aria-label={menuState == true ? "Close Menu" : "Open Menu"}
50 className="relative z-20 -m-2.5 -mr-4 block cursor-pointer p-2.5 lg:hidden"
51 >
52 <Menu className="m-auto size-6 duration-200 in-data-[state=active]:scale-0 in-data-[state=active]:rotate-180 in-data-[state=active]:opacity-0" />
53 <X className="absolute inset-0 m-auto size-6 scale-0 -rotate-180 opacity-0 duration-200 in-data-[state=active]:scale-100 in-data-[state=active]:rotate-0 in-data-[state=active]:opacity-100" />
54 </button>
55 </div>
56 <div className="relative flex items-center">
57 <RenderBlocks
58 blocks={(items ?? []).filter((i) => i.alignment === "left")}
59 blockComponents={blockComponents}
60 className={cn("w-full")}
61 />
62 </div>
63 <div className="relative flex items-center">
64 <RenderBlocks
65 blocks={(items ?? []).filter((i) => i.alignment === "center")}
66// … truncated

What it pulls in

npm packages

  • react
  • next
  • payload
  • lucide-react

Other registry items

  • @uifoundry/style-utils
  • @uifoundry/renderblocks
  • @uifoundry/header-brand-logo
  • @uifoundry/header-menu-button
  • @uifoundry/header-menu-items

Files it writes

  • registry/payload/blocks/custom-header/config.ts
  • registry/payload/blocks/custom-header/index.tsx
  • registry/payload/blocks/custom-header/blocks.ts

Facts

Registry
uifoundry
Type
registry:block
Access
Unverified
Files written
3
Licence
NOASSERTION
In the index
at or before 2026-08-01
Last confirmed
3 days ago

Go to the source

uifoundry.dev UIFoundry/uifoundry on GitHub Raw registry item This item as JSON

More from uifoundry

All 54 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Color Fieldcolor-fielduifoundryBlocksUnverified4 deps · 2 files
Coming Soon 1coming-soon-1uifoundryBlocksUnverified3 deps · 2 files
CTA 1cta-1uifoundryBlocksUnverified3 deps · 2 files
CTA 2cta-2uifoundryBlocksUnverified3 deps · 2 files
CTA 3cta-3uifoundryBlocksUnverified3 deps · 2 files
Features 1features-1uifoundryBlocksUnverified3 deps · 2 files
Features 2features-2uifoundryBlocksUnverified4 deps · 2 files
Features 3features-3uifoundryBlocksUnverified4 deps · 2 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex