header-2
fulldev-ui/header-2FreeBlock
fulldev/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by fulldev/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.full.dev/r/header-2.jsonSource
1---2import { cn } from "@/lib/utils"3import { Button } from "@/components/ui/button"4import { Header, HeaderContainer, HeaderGroup } from "@/components/ui/header"5import { Icon } from "@/components/ui/icon"6import { Logo, LogoImage, LogoText } from "@/components/ui/logo"7import {8 NavigationMenu,9 NavigationMenuItem,10 NavigationMenuLink,11 NavigationMenuList,12} from "@/components/ui/navigation-menu"13import {14 Sheet,15 SheetClose,16 SheetContent,17 SheetDescription,18 SheetHeader,19 SheetTitle,20 SheetTrigger,21} from "@/components/ui/sheet"2223type Props = {24 class?: string25 logo: {26 label: string27 href: string28 src?: any29 srcLight?: any30 srcDark?: any31 alt?: string32 }33 navigation: {34 label: string35 href: string36 links?: {37 label: string38 href: string39 }[]40 }[]41 buttons: {42 label: string43 href: string44 icon?: string45 variant?: "default" | "outline" | "secondary" | "ghost"46 }[]47}4849const { class: className, logo, navigation, buttons } = Astro.props50---5152<Header variant="floating" class={cn("", className)}>53 <HeaderContainer class="justify-between">54 <HeaderGroup>55 <Logo href={logo.href}>56 <LogoImage57 src={logo.src}58 srcLight={logo.srcLight}59 srcDark={logo.srcDark}60 alt={logo.alt}61 />62 {logo.label && <LogoText>{logo.label}</LogoText>}63 </Logo>64 </HeaderGroup>65 <NavigationMenu66 class="absolute left-1/2 hidden max-w-none -translate-x-1/2 lg:flex"67 >68 <NavigationMenuList>69 {70 navigation.map((item, index) => (71 <NavigationMenuItem value={`nav-${index}`}>72 <NavigationMenuLink href={item.href}>73 {item.label}74 </NavigationMenuLink>75 </NavigationMenuItem>76 ))77 }78 </NavigationMenuList>79 </NavigationMenu>80 <HeaderGroup class="ml-auto hidden justify-end lg:flex">81 <slot />82 {83 buttons.map(({ label, icon, ...button }) => (84 <Button85 as="a"86 size={icon && !label ? "icon-sm" : "sm"}87 aria-label={label}88 target={button.href.startsWith("http") ? "_blank" : undefined}89 rel={button.href.startsWith("http") ? "noreferrer" : undefined}90 {...button}91 >92 {icon && <Icon name={icon} />}93 {label}94 </Button>95 ))96 }97 </HeaderGroup>98 <Sheet class="lg:hidden">99 <SheetTrigger100// … truncated
What it pulls in
Other registry items
Files it writes
More from fulldev/ui
All 144 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| article-1article-1 | fulldev/ui | Blocks | Free | no deps | |
| article-2article-2 | fulldev/ui | Blocks | Free | no deps | |
| articles-1articles-1 | fulldev/ui | Blocks | Free | no deps | |
| articles-2articles-2 | fulldev/ui | Blocks | Free | no deps | |
| articles-3articles-3 | fulldev/ui | Blocks | Free | no deps | |
| articles-4articles-4 | fulldev/ui | Blocks | Free | no deps | |
| banner-1banner-1 | fulldev/ui | Blocks | Free | no deps | |
| banner-2banner-2 | fulldev/ui | Blocks | Free | no deps |
