Skip to content

SiteHeader

The top bar on every page: logo, main navigation, language switch and the quote button.

Below 72rem of its own width, the navigation and the button move into a menu. The menu is a native <details> element, so it works without JavaScript; the language switch stays visible.

Provide the logo linking home (26px tall; the component uses the theme-following logo, logo-on-dark inks on dark and logo-on-light inks on light); up to seven nav links in sentence case; the current page marked with aria-current="page", which draws the K mark under it (current: 'true' marks the section a page belongs to); the language switch (PT / EN) in mono; and one primary button, “Pedir orçamento”. The bar is header-height tall with a border hairline below.

Do

  • Mark the current page (current: true) or its section (current: 'true').
  • Keep nav labels short and in sentence case.
  • Describe the other-language link for screen readers ("Read this page in English").

Don't

  • Add a second button.
  • Put the language switch inside the menu only.
  • Use icons for nav items.
---
import SiteHeader from '@monk-business/astro/SiteHeader.astro';
---
<SiteHeader
items={[
{ label: 'Serviços', href: '/servicos/' },
{ label: 'Telecom', href: '/telecom/', current: true },
{ label: 'Produtos', href: '/produtos/' },
]}
languages={[
{ label: 'PT', href: '/telecom/', lang: 'pt-BR', current: true },
{ label: 'EN', href: '/en/telecom/', lang: 'en', description: 'Read this page in English' },
]}
cta={{ label: 'Pedir orçamento', href: '/contato/' }}
/>
<header class="mb-header">
<a class="mb-header__logo" href="/" aria-label="Monk Business, página inicial">
<img src="/logo-on-dark.svg" alt="" width="251" height="26" />
</a>
<nav class="mb-header__nav" aria-label="Principal">
<ul class="mb-nav" role="list">
<li><a href="/servicos/">Serviços</a></li>
<li><a href="/telecom/" aria-current="page">Telecom</a></li>
</ul>
</nav>
<div class="mb-header__actions">
<div class="mb-lang" role="group" aria-label="Idioma">
<b lang="pt-BR" aria-current="true">PT</b>
<span aria-hidden="true">/</span>
<a href="/en/telecom/" hreflang="en" lang="en">EN<span class="mb-sr-only"> Read this page in English</span></a>
</div>
<a class="mb-btn mb-btn--primary mb-header__cta" href="/contato/">Pedir orçamento</a>
<details class="mb-header__menu">
<summary class="mb-header__toggle">
<span class="mb-header__burger" aria-hidden="true"><span></span><span></span></span>
<span class="mb-header__toggle-label">Menu</span>
</summary>
<nav class="mb-header__panel" aria-label="Principal">
<ul role="list">
<li><a class="mb-header__panel-link" href="/servicos/">Serviços</a></li>
<li><a class="mb-header__panel-link" href="/telecom/" aria-current="page">Telecom</a></li>
<li class="mb-header__panel-cta">
<a class="mb-btn mb-btn--primary mb-btn--block" href="/contato/">Pedir orçamento</a>
</li>
</ul>
</nav>
</details>
</div>
</header>
SiteHeader props
PropTypeDefaultDescription
homeHrefstring'/'Home link of the logo.
homeLabelstring'Monk Business, página inicial'Accessible name of the logo link.
itemsNavItem[]—Main navigation, up to seven links.
navLabelstring'Principal'Accessible name of the navigation.
languagesLanguageLink[]—Language switch: one entry per language, the current one marked current.
languagesLabelstring'Idioma'Accessible name of the language switch.
ctaHeaderAction—The one primary button, e.g. "Pedir orçamento".
menuLabelstring'Menu'Text of the menu button on phones and tablets.
logoToneExclude<LogoTone, 'mono'>'auto'Logo tone. auto follows the surface (on-dark on dark, on-light inside .theme-light).
classstring—Extra classes.
NavItem
PropTypeDefaultDescription
label *string—Link text in sentence case. No icons.
href *string—Link target.
currentboolean| 'page'| 'true'| 'location'—Marks the item current: true or 'page' for the page itself, 'true' for the section the page belongs to. Draws the K mark under the link.
LanguageLink
PropTypeDefaultDescription
label *string—Short label in mono, e.g. "PT" or "EN".
href *string—The current page in this language.
lang *string—BCP 47 language tag, e.g. "pt-BR" or "en".
currentboolean—The language of the current page (shown in fg, not linked).
descriptionstring—Visually hidden description of the link, e.g. "Read this page in English".
HeaderAction
PropTypeDefaultDescription
label *string—Button label, e.g. "Pedir orçamento".
href *string—Link target.

* required.