P Primer · 01

Site header

사이트 머리

A dark charcoal bar across the top; the topic you are on shows as a slightly lighter rounded pill inside it. stacked adds a white tab row underneath.

RuleThe menu opens and closes without scripts, and the topic you are on is announced as the current page to screen readers too.

Also known as: SiteHeaderUnderlineNavActionMenu
···
usage (Astro)
---
// src/layouts/Base.astro
import { SiteHeader } from '../components/registry';
---
<SiteHeader site={site} nav={nav} />
site.json
// sites/<사이트>/site.json — 적지 않으면 사이트 이름으로 자동으로 고른다
{
  "variants": { "SiteHeader": "bar" }
}
props (TypeScript)
export interface SiteHeaderProps {
  site: SiteConfig;
  /** 주제(카테고리) + 소개. 허브는 소개만 */
  nav: NavLink[];
  variant?: VariantOf<'SiteHeader'>;
}

A blue square mark and a white site name sit on a dark charcoal bar. The topic you are on shows as a slightly lighter pill inside the bar, and corners are only lightly rounded (about 6px). bar keeps the name on one line with the menu on the right, folding into a “Menu” button on phones. stacked adds a white row under the dark one, so topic tabs look like a repository’s tabs, each with its post count in a small grey badge. compact shows a single “Full menu” button that opens a panel with a one-line description and post count per topic.

If you want topic tabs always visible with counts, stacked is the most Primer-like; on phones the tabs scroll sideways instead of folding. The dark bar can feel stiff for a warm parenting site. In dark mode the bar gets close to the page background, so the line between header and body fades. The full-menu panel splits into two columns only when the number of topics is even; with an odd number one cell is left empty.

The GitHub logo and name are not used; the site’s own mark and name take their place.

Use it when — Variants 3

  1. barSingle bar When 3–5 topics fit on one line next to the name. On phones the menu folds open.Used by 3: babyplay, babysick, feeding
  2. stackedTwo rows When topic tabs should always be visible — on phones they scroll sideways instead of folding.Used by 4: babyfood, toddlerfood, vaccination, 허브
  3. compactFull menu When there are many topics, or each topic deserves a one-line description and post count.Used by 4: babysleep, birthprep, milestone, newborn
Open as page ↗

Suggest an entry

Tell us about a missing component or variant, or something a pack should fix. We read every suggestion.