ClickorKeyboard shortcut Alt + L

Dragto resize

Nord Design System SearchDeveloperDeveloperGetting startedUsing Web ComponentsWebfontsCDNLocalizationCSS Framework Legacy ESLint PluginWorking with AIFAQDesignDesignGetting startedFoundationsAccessibilityColor SystemColor UtilitiesPrinciplesFigma ToolkitGridIconographyNamingNordhealth BrandTypographyThemesBrand assetsToolsComponentsComponentsAccordion New Aside New Autocomplete New AvatarBadgeBannerButtonButton GroupCalendarCard Updated Chart New Chat New Chat AttachmentChat ComposerChat Composer DrawerChat Composer InputChat Dictation ButtonChat Layout Scroll ButtonChat MessageChat Message BubbleChat Message ListChat Message MetadataChat Send ButtonChat System MessageChat TokenChat Tokenized TextChat Tool CallsCheckboxCollapsible New Combobox New Command MenuData Table New Date PickerDate Range Picker New DividerDrawer Updated DropdownEmpty StateField New FieldsetFilter Bar New FooterHeaderIconInputInput Group New Item New Kbd New LayoutMessageMeter New Modal Updated NavigationNotificationNumber Field New Otp Field New Outline New Overflow List New Pagination New PopoutProgressProgress BarQrcodeRadioRangeResizable New Rich Text Editor New Scroll Area New Segmented ControlSelectSkeletonSpinnerStackTabTableTagTextareaTime Picker New Timestamp New ToastToggleTooltipTop BarTruncate New Visually HiddenDesign TokensDesign TokensTailwind CSSTailwind CSSBlocksBlocksTemplatesTemplatesIconsIconsPlaygroundPlaygroundLatest UpdatesLatest UpdatesChangelogChangelogMigration guidesMigration guides
GitHub

Clickto expandKeyboard shortcut Alt + L

Header

Open in Storybook

The header is a block of designated space for labelling the current context and providing primary actions.

Loading...

Usage

Header labels the currently viewed context and hosts its primary actions. Place the title (and any inline content) in the default slot, and put buttons, toggles or other controls in the end slot to align them to the trailing edge.

import "@nordhealth/components/lib/Header"

Examples

Title only

The simplest header is a heading in the default slot.

Actions

Use the end slot for primary actions aligned to the trailing edge.

Size

Set size="s" for a more compact header.

Filter and tooltip

Combine a filter control with a tooltip in the end slot to add contextual actions to the header.

RTL

Headers follow the document or container direction. Toggle the direction to see the layout mirror.

Accessibility

  • Header is a layout container with no implicit landmark role. Put a real heading element (<h1>, <h2>) in the default slot so the current context is exposed in the document outline.
  • The end slot keeps actions in the normal tab order; the visual trailing-edge placement does not change source order, so verify the focus order reads logically.
  • Wrap the header in a labelled landmark (such as a <header> element or role="banner" region) when it represents page-level context, so assistive technology can navigate to it directly.

API reference

Header

The header is a block of designated space for labelling the currently viewed context as well as providing primary actions.

<nord-header></nord-header>

Props

PropertyAttribute Description TypeDefault
sizesizeControls the size of the header component.'m' | 's' | 'xs''m'

Slots

Slot name Description
Default slotThe header content.
endOptional slot for buttons, toggles, etc.

CSS Properties

CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.

PropertyDescriptionDefault
--n-header-background-colorBackground color of the header.var(--n-color-surface)
Design guidelinesFor designers

Usage

This section includes guidelines for designers and developers about the usage of this component in different contexts.

Do

  • Use the header component to show a heading to describe the current view.
  • Use the header component to hold primary actions.
  • Use the header component at a visual high position at full width.
  • Utilise the n-truncate CSS helper to prevent long headings from wrapping.

Don’t

  • Don’t overcrowd the header component with too many actions or information.
  • Don’t nest the header component too deeply and restrict its available space.
  • Don’t add large amounts of content or long headings. Aim for headings that are short and concise.

Content guidelines

The header component should be a containing element placed high on the page to present high level controls and to describe the page itself. It shouldn’t be overcrowded with controls or information.

[Menu] Dashboard [Account] [Log out]
[Menu] Use the cards below to view various information [Export] [Save] [Edit Profile] [Log out] [Preferences]