Header 4
uifoundry/header-4FreeBlock
Header 4 Block with dashed border and light background
Live preview
live · rendered by the registry
Rendered by uifoundry on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uifoundry.dev/r/header-4.jsonSource
1/**2 * Header 4 Component3 *4 * Source: https://tailark.com/r/hero-section-6.json (nav extracted from main component)5 * License: Free Tier6 * Adapted from: Tailark Hero Section 6 - Navigation Component7 *8 * Modifications:9 * - Integrated with PayloadCMS block system10 * - Replaced hardcoded menuItems with dynamic props from Header_4_Block11 * - Replaced Logo component with Home icon from lucide-react12 * - Added preview prop support for admin panel rendering13 * - Extracted header navigation from full hero component14 */1516"use client";1718import { Menu, X } from "lucide-react";19import { Button } from "@/registry/ui/button";20import Link from "next/link";21import { useState } from "react";22import { cn } from "@/registry/default/utils";23import type {24 Header_4_Block,25 MediaField as MediaFieldProps,26} from "~/payload-types";27import type { ComponentPropsWithRef } from "react";28import MediaField from "@/registry/default/lib/fields/media";2930export * from "./config";3132export default function Header_4({33 preview = false,34 brandLogo,35 logoHref,36 menuItems,37 actionButtons,38 ...navProps39}: { preview?: boolean } & Header_4_Block & ComponentPropsWithRef<"nav">) {40 const [menuState, setMenuState] = useState(false);4142 return (43 <header className="border-b border-dashed">44 <nav45 data-state={menuState && "active"}46 className={cn(47 "fixed z-20 w-full bg-white backdrop-blur md:relative dark:bg-zinc-950/50 lg:dark:bg-transparent",48 preview && "relative",49 )}50 {...navProps}51 >52 <div className="m-auto max-w-5xl px-6">53 <div className="relative flex flex-wrap items-center justify-between gap-6 py-3 lg:gap-0 lg:py-4">54 <div className="flex w-full items-center justify-between lg:w-auto">55 {brandLogo && (56 <Link57 href={logoHref}58 aria-label="home"59 className="relative h-8 w-24 lg:w-32"60 >61 <MediaField62 media={brandLogo as MediaFieldProps}63 fill64 className="object-contain object-left"65 />66 </Link>67 )}6869 <button70 onClick={() => setMenuState(!menuState)}71 aria-label={menuState == true ? "Close Menu" : "Open Menu"}72 aria-expanded={menuState}73 aria-controls="mobile-menu"74 className="relative z-20 -m-2.5 -mr-4 block cursor-pointer p-2.5 lg:hidden"75 >76 <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" />77// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from uifoundry
All 54 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Color Fieldcolor-field | uifoundry | Blocks | Free | 4 deps · 2 files | |
| Coming Soon 1coming-soon-1 | uifoundry | Blocks | Free | 3 deps · 2 files | |
| CTA 1cta-1 | uifoundry | Blocks | Free | 3 deps · 2 files | |
| CTA 2cta-2 | uifoundry | Blocks | Free | 3 deps · 2 files | |
| CTA 3cta-3 | uifoundry | Blocks | Free | 3 deps · 2 files | |
| Custom Headercustom-header | uifoundry | Blocks | Free | 4 deps · 3 files | |
| Features 1features-1 | uifoundry | Blocks | Free | 3 deps · 2 files | |
| Features 2features-2 | uifoundry | Blocks | Free | 4 deps · 2 files |
