Elements

Components / Website

Site Header

The marketing website header. A logo on the left, centred dropdown navigation (built on the shadcn navigation-menu and Mode.com layout), and an auth-aware right rail: a Get Started CTA when logged out, or an account menu (avatar, name, open app, log out) when signed in. Collapses to a mobile menu below md.

Installation

bash
npx shadcn add https://raw.githubusercontent.com/levi-putna/elements/main/registry/site-header/registry.json

Logged out

Without a user, the right rail shows a Sign in link and the lime Get Started CTA. Hover a nav item with sub-links to open its panel.

Logged in

Pass a user to swap the CTA for the account menu: avatar, name, and a dropdown to open the app or log out.

Page content

Usage

tsx
import { SiteHeader } from "@/components/ui/site-header"

const items = [
  {
    title: "Product",
    links: [
      { title: "Owners portal", href: "/product/owners", description: "Self-service for every lot owner." },
      { title: "Committee tools", href: "/product/committee", description: "Run meetings, votes, and budgets." },
      { title: "Maintenance", href: "/product/maintenance", description: "Track jobs from request to invoice." },
      { title: "Reporting", href: "/product/reporting", description: "Financials your auditor will love." },
    ],
  },
  { title: "Pricing", href: "/pricing" },
  { title: "Customers", href: "/customers" },
]

{/* Logged out: shows the "Get Started" CTA */}
<SiteHeader items={items} />

{/* Logged in: shows the account menu */}
<SiteHeader
  items={items}
  user={{ name: "Levi Putna", email: "levi@instantstrata.com" }}
  appHref="/app"
  onSignOut={() => signOut()}
/>

SiteHeader Props

PropTypeDefaultDescription
itemsSiteNavItem[][]Top-level navigation entries. Provide href for a plain link, or links for a dropdown panel.
userSiteUser | null-The signed-in user. When null/omitted, the logged-out CTA is shown instead of the account menu.
getStartedHrefstring"/signup"Destination for the primary Get Started CTA (logged out).
signInHrefstring"/login"Destination for the secondary Sign in link (logged out).
appHrefstring"/app"Destination for Open app in the account menu (logged in).
onSignOut() => void-Called when the user chooses Log out.
logoReactNode-Replace the default Instant Strata logo + home link.
logoHrefstring"/"Href the logo links to. Ignored when a custom logo is supplied.
stickybooleantrueStick the header to the top of the viewport.

SiteNavItem

PropTypeDefaultDescription
titlestring-The label shown in the nav bar.
hrefstring-Destination for a plain link item. Omit when using links.
linksSiteNavLink[]-Sub-items rendered as a dropdown panel. Each has title, href, and optional description.

SiteUser

PropTypeDefaultDescription
namestring-Used for the menu label, the avatar alt text, and initials fallback.
emailstring-Secondary line shown in the account menu header.
avatarstring-Avatar image URL. Falls back to initials derived from name.