---
title: Header Blocks for Astro
description: "Astro header and navigation blocks with desktop links and mobile menus. Compare layouts and install editable source with the shadcn CLI."
seo:
    title: "Astro Header blocks: examples and source"
related:
    - /components/navigation-menu
    - /blocks/mobile-menu
    - Header component: /components/header
mode: wide
sidebar:
    label: "Header"
---

Header blocks render their default slot once, in the desktop actions area.
Use `slot="mobile"` for actions that should appear inside the mobile menu.
Navigation items are rendered as real links in both layouts.

Set `mobileMenu="drawer"` to use the [Mobile Menu](/blocks/mobile-menu) drawer
in any header. It includes child links, actions, and the mobile slot.
The default is `mobileMenu="sheet"`. The drawer closes when the viewport reaches
the desktop breakpoint at `1024px`.

```astro
<HeaderJustifiedNavActions {...headerProps} mobileMenu="drawer">
  <a href="/call">Book a call</a>
  <a slot="mobile" href="/call">Book a call</a>
</HeaderJustifiedNavActions>
```

When updating an existing header, move or copy the intended mobile actions
into the named slot. Keep element IDs unique between the two slots.

:::note
On desktop, use the resize handle to adjust the container width and expose the mobile menu.
:::

## Justified Navigation & Actions

Balance the logo, main navigation, and the call to action.

```astro
---
import HeaderJustifiedNavActions from "@/components/blocks/header/header-justified-nav-actions.astro"
import Logo from "@/assets/gnostic-ai-logo.svg"
---

<HeaderJustifiedNavActions
  mobileMenu="drawer"
  logo={{
    label: "Halden",
    href: "https://example.com/halden",
    src: Logo,
  }}
  navigation={[
    { label: "Services", href: "https://example.com/halden/services" },
    { label: "Work", href: "https://example.com/halden/work" },
    { label: "Process", href: "https://example.com/halden/process" },
    { label: "About", href: "https://example.com/halden/about" },
  ]}
  actions={[
    {
      label: "See the work",
      href: "https://example.com/halden/work",
      variant: "ghost",
    },
    {
      label: "Book a call",
      href: "https://example.com/halden/call",
      variant: "default",
    },
  ]}
/>
```

```sh
bunx --bun shadcn@latest add @gnostic/header-justified-nav-actions
```

## Centered navigation

Balance the navigation with brand details and action links.

```astro
---
import HeaderCenteredNavigation from "@/components/blocks/header/header-centered-navigation.astro"
import Logo from "@/assets/gnostic-ai-logo.svg"
---

<HeaderCenteredNavigation
  mobileMenu="drawer"
  logo={{
    label: "Halden",
    href: "https://example.com/halden",
    src: Logo,
  }}
  navigation={[
    { label: "Services", href: "https://example.com/halden/services" },
    { label: "Work", href: "https://example.com/halden/work" },
    { label: "Process", href: "https://example.com/halden/process" },
    { label: "About", href: "https://example.com/halden/about" },
  ]}
  actions={[
    {
      label: "See the work",
      href: "https://example.com/halden/work",
      variant: "ghost",
    },
    {
      label: "Book a call",
      href: "https://example.com/halden/call",
      variant: "default",
    },
  ]}
/>
```

```sh
bunx --bun shadcn@latest add @gnostic/header-centered-navigation
```

## Compact navigation

Keep a short navigation list beside the site actions.

```astro
---
import HeaderCompactNavigation from "@/components/blocks/header/header-compact-navigation.astro"
import Logo from "@/assets/gnostic-ai-logo.svg"
---

<HeaderCompactNavigation
  mobileMenu="drawer"
  logo={{
    label: "Halden",
    href: "https://example.com/halden",
    src: Logo,
  }}
  navigation={[
    { label: "Services", href: "https://example.com/halden/services" },
    { label: "Work", href: "https://example.com/halden/work" },
    { label: "About", href: "https://example.com/halden/about" },
  ]}
  actions={[
    {
      label: "Email",
      href: "mailto:hello@example.com",
      icon: "mail",
      variant: "ghost",
    },
    {
      label: "Book a call",
      href: "https://example.com/halden/call",
      variant: "default",
    },
  ]}
/>
```

```sh
bunx --bun shadcn@latest add @gnostic/header-compact-navigation
```

## Media menu

Add supporting media and descriptions to a navigation panel.

```astro
---
import HeaderMediaMenu from "@/components/blocks/header/header-media-menu.astro"
import Logo from "@/assets/gnostic-ai-logo.svg"
import placeholderImage from "@/assets/placeholder.webp"
---

<HeaderMediaMenu
  mobileMenu="drawer"
  logo={{
    label: "Halden",
    href: "https://example.com/halden",
    src: Logo,
  }}
  navigation={[
    {
      label: "Services",
      href: "https://example.com/halden/services",
      description: "Automations for the repeated work in a service business.",
      image: {
        src: placeholderImage,
        alt: "Sample image of a workflow review",
      },
      links: [
        {
          label: "Workflows",
          href: "https://example.com/halden/services/workflows",
          description:
            "Connect the tools a team already uses and remove repeated steps.",
          icon: "workflow",
        },
        {
          label: "Lead response",
          href: "https://example.com/halden/services/lead-response",
          description:
            "Answer a new inquiry before it waits in a shared inbox.",
          icon: "inbox",
        },
        {
          label: "Reporting",
          href: "https://example.com/halden/services/reporting",
          description:
            "Send a weekly summary from the systems the business already runs.",
          icon: "chart-column",
        },
      ],
    },
    {
      label: "Work",
      href: "https://example.com/halden/work",
      description: "Recent automations for service teams.",
      links: [
        {
          label: "Case studies",
          href: "https://example.com/halden/work/case-studies",
          description: "Read how a service team replaced a manual handoff.",
          icon: "book-open",
        },
        {
          label: "Industries",
          href: "https://example.com/halden/work/industries",
          description: "See the service businesses Halden works with.",
          icon: "building",
        },
      ],
    },
    { label: "Process", href: "https://example.com/halden/process" },
    { label: "About", href: "https://example.com/halden/about" },
  ]}
  actions={[
    {
      label: "See the work",
      href: "https://example.com/halden/work",
      variant: "ghost",
    },
    {
      label: "Book a call",
      href: "https://example.com/halden/call",
      variant: "default",
    },
  ]}
/>
```

```sh
bunx --bun shadcn@latest add @gnostic/header-media-menu
```

## Multi column menu

Group related destinations into separate menu columns.

```astro
---
import HeaderMultiColumnMenu from "@/components/blocks/header/header-multi-column-menu.astro"
import Logo from "@/assets/gnostic-ai-logo.svg"
import placeholderImage from "@/assets/placeholder.webp"
---

<HeaderMultiColumnMenu
  mobileMenu="drawer"
  logo={{
    label: "Halden",
    href: "https://example.com/halden",
    src: Logo,
  }}
  navigation={[
    {
      label: "Services",
      href: "https://example.com/halden/services",
      description: "Automations for the repeated work in a service business.",
      image: {
        src: placeholderImage,
        alt: "Sample image of a workflow review",
      },
      links: [
        {
          label: "Workflows",
          href: "https://example.com/halden/services/workflows",
          description:
            "Connect the tools a team already uses and remove repeated steps.",
          icon: "workflow",
        },
        {
          label: "Lead response",
          href: "https://example.com/halden/services/lead-response",
          description:
            "Answer a new inquiry before it waits in a shared inbox.",
          icon: "inbox",
        },
        {
          label: "Reporting",
          href: "https://example.com/halden/services/reporting",
          description:
            "Send a weekly summary from the systems the business already runs.",
          icon: "chart-column",
        },
        {
          label: "Onboarding",
          href: "https://example.com/halden/services/onboarding",
          description:
            "Move a new client from a signed agreement to the first delivery.",
          icon: "clipboard-check",
        },
      ],
    },
    {
      label: "Work",
      href: "https://example.com/halden/work",
      description: "Recent automations for service teams.",
      links: [
        {
          label: "Case studies",
          href: "https://example.com/halden/work/case-studies",
          description: "Read how a service team replaced a manual handoff.",
          icon: "book-open",
        },
        {
          label: "Industries",
          href: "https://example.com/halden/work/industries",
          description: "See the service businesses Halden works with.",
          icon: "building",
        },
      ],
    },
    { label: "Process", href: "https://example.com/halden/process" },
    { label: "About", href: "https://example.com/halden/about" },
  ]}
  actions={[
    {
      label: "See the work",
      href: "https://example.com/halden/work",
      variant: "ghost",
    },
    {
      label: "Book a call",
      href: "https://example.com/halden/call",
      variant: "default",
    },
  ]}
/>
```

```sh
bunx --bun shadcn@latest add @gnostic/header-multi-column-menu
```

## Expandable

Expand the compact header to reveal the full navigation.

```astro
---
import HeaderExpandable from "@/components/blocks/header/header-expandable.astro"
import Logo from "@/assets/gnostic-ai-logo.svg"
---

{/*
  The bar is fixed. This box keeps that bar inside the preview.
*/}
<div class="header-expandable-example relative h-96">
  <HeaderExpandable
    logo={{
      label: "Halden",
      href: "https://example.com/halden",
      src: Logo,
    }}
    navigation={[
      { label: "Services", href: "https://example.com/halden/services" },
      { label: "Work", href: "https://example.com/halden/work" },
      { label: "Process", href: "https://example.com/halden/process" },
      { label: "About", href: "https://example.com/halden/about" },
      { label: "Industries", href: "https://example.com/halden/industries" },
      { label: "Contact", href: "https://example.com/halden/contact" },
    ]}
    description="Halden builds automations that answer leads, move client work, and report the result."
    actions={[
      {
        label: "Book a call",
        href: "https://example.com/halden/call",
      },
    ]}
  />
</div>

<style>
  /* Keep the fixed bar inside the preview instead of the docs viewport. */
  .header-expandable-example {
    position: relative;
    height: 640px;
  }
  .header-expandable-example :global([data-expandable-menu]),
  .header-expandable-example :global([data-slot="header-container"]) {
    position: absolute;
  }
  .header-expandable-example :global([data-slot="header-container"]) {
    top: 24px;
  }
</style>
```

```sh
bunx --bun shadcn@latest add @gnostic/header-expandable
```

## Props

### HeaderProps

<AutoTypeTable path="../../packages/ui/src/components/blocks/header/types.ts" name="HeaderProps" />

### HeaderLogo

<AutoTypeTable path="../../packages/ui/src/components/blocks/header/types.ts" name="HeaderLogo" />

### HeaderNavigationItem

<AutoTypeTable
    path="../../packages/ui/src/components/blocks/header/types.ts"
    name="HeaderNavigationItem"
/>

### HeaderNavigationLink

<AutoTypeTable
    path="../../packages/ui/src/components/blocks/header/types.ts"
    name="HeaderNavigationLink"
/>

### HeaderNavigationImage

<AutoTypeTable
    path="../../packages/ui/src/components/blocks/header/types.ts"
    name="HeaderNavigationImage"
/>

### HeaderAction

<AutoTypeTable path="../../packages/ui/src/components/blocks/header/types.ts" name="HeaderAction" />

## Header Portfolio

An independent section from the Portfolio template. Supply its content through props.

```astro
---
import Block from "@/components/blocks/header/header-portfolio.astro"
const content = {
  brand: "Sable",
  contact: {
    label: "Plan your visit",
    href: "#visit",
    email: "hello@example.com",
    available: "Cuts · Colour · Care",
  },
  navigation: [
    {
      label: "Services",
      href: "#services",
    },
    {
      label: "Looks",
      href: "#looks",
    },
    {
      label: "The studio",
      href: "#studio",
    },
    {
      label: "Visit",
      href: "#visit",
    },
  ],
  homeHref: "#top",
}
---

<Block {...content} />
```

```sh
bunx --bun shadcn@latest add @gnostic/header-portfolio
```

## Centered brand mark

Supply your own content. The section uses the selected project preset.

```astro
---
// @preview render=frame
import Block from "@/components/blocks/header/header-centered-mark/header-centered-mark.astro"
import type { CenteredMarkHeaderContent } from "@/components/blocks/header/header-centered-mark/types"
const content = {
  name: "Gnotch",
  href: "/",
  navigation: [
    {
      label: "Home",
      href: "/",
    },
    {
      label: "About",
      href: "/about",
    },
    {
      label: "Journal",
      href: "/blog",
    },
    {
      label: "Contact",
      href: "/contact",
    },
  ],
} satisfies CenteredMarkHeaderContent
---

<div class="relative min-h-80 w-full bg-background">
  <Block {content} />
</div>
```

```sh
bunx --bun shadcn@latest add @gnostic/header-centered-mark
```

<AutoTypeTable
    path="../../packages/ui/src/components/blocks/header/header-centered-mark/types.ts"
    name="CenteredMarkHeaderProps"
/>

## Editorial header

Use this section for desktop navigation and a mobile menu.

```astro
---
import Section from "@/components/blocks/header/header-agency.astro"
const section = {
  name: "foldline",
  description:
    "A digital design studio for architecture, interiors, and objects. Brand identities, websites, and project stories with care in every detail.",
  colorMode: "dark",
  logo: {
    src: "/media/foldline/foldline-mark.svg",
    alt: "",
  },
  navigation: [
    {
      label: "Services",
      href: "https://example.com/#service",
    },
    {
      label: "Studio",
      href: "https://example.com/about",
    },
    {
      label: "Work",
      href: "https://example.com/projects",
    },
    {
      label: "Journal",
      href: "https://example.com/blogs",
    },
    {
      label: "Contact",
      href: "https://example.com/contact",
    },
  ],
  action: {
    label: "Let’s talk",
    href: "https://example.com/contact",
  },
  footer: {
    location:
      "An independent digital studio\nArchitecture · Interiors · Objects",
    email: "hello@foldline.example",
    phone: "+1 (212) 555-0148",
    phoneHref: "tel:+12125550148",
    socials: [
      {
        label: "Studio notes",
        href: "https://example.com/blogs",
      },
      {
        label: "Selected work",
        href: "https://example.com/projects",
      },
      {
        label: "Start a conversation",
        href: "https://example.com/contact",
      },
    ],
    copyright: "© 2026 Foldline. Fictional studio · original concept work.",
  },
  homeHref: "https://example.com/",
}
---

<Section {...section} />
```

```sh
bunx --bun shadcn@latest add @gnostic/header-agency
```

<AutoTypeTable
    path="../../packages/ui/src/components/blocks/shared/agency/types.ts"
    name="AgencyHeaderProps"
/>

See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section.

## Home services header

```astro
---
import Block from "@/components/blocks/header/header-remodify.astro"
const content = {
  name: "Remodify",
  description: "Thoughtful home remodeling in Raleigh, North Carolina.",
  navigation: [
    {
      label: "About",
      href: "#about-us",
    },
    {
      label: "Services",
      href: "#services",
    },
    {
      label: "Process",
      href: "#workflow",
    },
    {
      label: "Inspiration",
      href: "#work",
    },
    {
      label: "Stories",
      href: "#testimonial",
    },
  ],
  action: {
    label: "Plan Your Remodel",
    href: "#contact",
  },
  email: "hello@remodify.example",
  phone: {
    label: "(919) 555-0142",
    href: "tel:+19195550142",
  },
  address: "Raleigh, NC and nearby Triangle communities",
  copyright: "© 2026 Remodify. All rights reserved.",
  socials: [],
}
---

<Block {...content} />
```

```sh
bunx --bun shadcn@latest add @gnostic/header-remodify
```

## Choose a header layout

Choose a header based on logo width, primary links, and the main action. A small site can use direct links; a larger one can use grouped navigation.

## Pass content from Astro

Pass logo, navigation, and actions to the selected block. Some variants support a sheet or drawer mobile menu. Use real hrefs and keep link labels consistent between desktop and mobile views.

## Responsive layout and images

Test the width at which the navigation changes layout with actual labels. Open and close the mobile menu with a keyboard and confirm focus returns to its trigger. Supply separate logo artwork for light and dark mode when the mark needs it.

## Compose the next section

Use [Mobile Menu](/blocks/mobile-menu) for a separate compact navigation composition and [Footer](/blocks/footer) for secondary links.
