Overview

The Header component renders the top navigation bar that persists across all documentation pages. It contains the site title, search widget, theme selector, and social icons.

Look at the top of this page to see the header in action.

Structure

The header is divided into three sections:

┌─────────────────────────────────────────────────────┐
│  [Site Title]     [Search]     [Social] [Theme] [≡] │
│  └─ left          └─ center    └─ right group ──────│
└─────────────────────────────────────────────────────┘

Composed Components

The header automatically includes:

ComponentPositionDescription
SiteTitleLeftSite name and optional logo
SearchCenterPagefind search trigger
SocialIconsRightSocial media links
ThemeSelectRightDark/light/auto theme picker
MobileMenuToggleRight (mobile)Hamburger menu button

Framework Header vs. Mitosis Header

There are two header implementations:

  1. Framework Header (packages/framework/src/components/Header.tsx) — Auto-composes all sub-components from RouteData context
  2. Mitosis Header (packages/components/src/Header.lite.tsx) — Slot-based version for custom layouts

The framework version is what gets used by default in the Page component.

Responsive Behavior

Screen SizeBehavior
MobileSocial icons and theme select are hidden; hamburger menu shown
Medium+ (md:)Full header with all elements visible
PrintHeader is hidden via .print:hidden

CSS Classes

  • .header — Main container
  • .title-wrapper — Site title area
  • .right-group — Right-aligned section with social/theme
  • .sl-flex — Flexbox layout
  • .sl-hidden / .md:sl-flex — Responsive visibility