Skip to content

Site header

A website header: brand, navigation, actions, and a menu that works without JavaScript on small screens.

Header

Installation

Everything ships in one stylesheet. There is nothing to import per component.

<link rel="stylesheet" href="https://mian.ro/dist/mian.css">

Prefer to own the files? /r/site-header.json is a registry item with this component's CSS and example markup, ready to copy into your project with any tool that reads the open registry-item format.

Class reference

Class / attributeDescription
mn-headerThe header. Blurred page colour with a hairline. mn-header-sticky · mn-header-plain (no background) · mn-header-center (centred nav).
mn-header-inInner row; put it on the mn-container.
mn-header-brandLogo link (an SVG and a name).
mn-header-navMain links, shown when the header is at least 54rem wide. aria-current="page" marks the current one.
mn-header-actionsButtons on the right. mn-header-wide hides an action when the header is narrow.
mn-header-menuA <details> with a <summary> button and mn-header-panel: the small-screen menu. Hidden on wide headers.
mn-header-open · mn-header-closeIcons inside the summary for the closed and open state.

Accessibility

  • Both navs need aria-label (e.g. “Main” and “Menu”). The summary needs an aria-label such as “Menu”.
  • <details> is a native disclosure: Enter and Space open it, and screen readers announce expanded/collapsed.
  • Keep the brand link’s accessible name (the visible name or aria-label).
  • Layout answers to the section’s own width (container queries), so it works the same in a page, a sidebar or a preview.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page