Docs

Main site

Installation Browser support Extend config MCP server
Validation Page speed testing Responsive design
Accordion Aspect Ratio Avatar Badge Banner Bento Grid Blockquote Breadcrumbs Button Callout Card Drawer Dropdown Link Modal Navbar Navblock Pagination Popover Progress Separator Tabs Timeline Toast Tooltip
Checkbox Datepicker File upload Form field Input Label OTP Radio Range Select Textarea Toggle
Header Footer
Accordion Auth Checkbox & Radio Content Drawers Features Modals Statistics & Metrics Teams
Address Contact number Currency symbol Date Emirates ID Name
Close
Home Documentation Components Header

Header

The Header is the standardised top-of-page region for UAE Federal Government websites — the official top bar, the entity's logo and primary navigation, and a menu drawer for small screens.

Navigation Layout
Status
Active
Introduced
4.0.x
View source code

Introduction

aegov-header is the standard top-of-page header for UAE Federal Government websites. It ties the page to the official government identity — the top bar, the "Learn more" verification panel and, for authorities, the UAE emblem — and carries the site's logo and primary navigation.

You configure it in two ways:

  • Attributes set how the header behaves: who the entity is, which variant, where the navigation collapses, whether it sticks.
  • Slots decide what content goes where: you add your own elements with a slot="…" attribute, and the header places them in the right region.

Only entity-name and entity-domain are required. With just those two, you already get the full official top bar.

Attributes

Attribute What it does
entity-name, entity-domain Required. Who the entity is. Used in the "Learn more" panel; entity-domain is also where the logo links to. If either is missing, the top bar shows an inline error so the mistake is obvious during development.
variant ministry (default) for federal ministries — the end of the logo row holds your search slot. authority for authorities, councils and regulators — the UAE emblem takes that place instead.
emblem-color Colour of the UAE emblem on the authority variant: aeblack (default), whitely or aegold. See Emblem colour below.
collapse-at Where the navigation row gives way to the menu button: md (768px), lg (1024px, default), xl (1280px) or 2xl (1536px). Pick a later breakpoint if your navigation is long — around five items fit at lg.
skip-content-container Adds a "Skip to content" link pointing at your main content — set it on every page. Takes the element's ID (#main or main), not a CSS selector.
logo-label Accessible name for the logo link.
is-sticky Keeps the navigation row pinned to the top while scrolling, from collapse-at up; the top bar and logo row scroll away. It stops working if any ancestor has overflow: hidden, auto or scroll.
drawer-size, label-menu, label-menu-close Fine-tune the menu drawer's width and its accessible names. The labels already default to English or Arabic, so you rarely need them.

The full list with types and defaults is in the API reference tab.

Emblem colour

On the authority variant, emblem-color sets the colour of the UAE emblem at the end of the logo row. The emblem is an official mark, so it takes one of three palette colours only:

Value Use it when
aeblack (default) The header sits on a light background.
whitely The header sits on a dark background, for example in dark mode.
aegold Your entity shows the emblem in gold.
<aegov-header variant="authority" emblem-color="whitely" entity-name="…" entity-domain="…">
  …
</aegov-header>

The emblem renders inside the header's Shadow DOM, so page CSS — including a .dark class on :root — can't recolour it. If your site switches to dark mode, set emblem-color="whitely" on the header from the same script that switches the theme. On the ministry variant the attribute is ignored.

Slots

Add a slot="…" attribute to any element inside aegov-header, and the header moves it to that region. The order you write the slots in doesn't matter — the slot name decides where content appears.

Slot Where it appears Visible
actions Official top bar, at the end Always
logo Logo row, at the start Always
search Logo row, at the end (ministry only) From collapse-at up
navigation Navigation row, at the start From collapse-at up
secondary-actions Navigation row, at the end From collapse-at up
mobile-content Inside the menu drawer Below collapse-at, when opened

Two rules make the header work on every screen size:

  1. Repeat your navigation in mobile-content. A slot's content can only appear in one place, so the drawer can't reuse the navigation slot. Copy the links in — and anything essential from search or secondary-actions. If mobile-content is empty, the menu button opens an empty drawer.
  2. Let the navigation own its landmark. aegov-navbar renders its own <nav> (named with label-nav), so don't wrap it in another one. If you use plain links instead, wrap them in your own <nav aria-label="…">.

Navigation with dropdowns

Each aegov-navbar-item can open a dropdown. Put an aegov-dropdown inside the item with slot="dropdown", and your content inside the dropdown with slot="dropdown-content":

<aegov-navbar-item href="/services">
  Services
  <aegov-dropdown slot="dropdown" trigger="hover" position="bottom" align="center">
    <ul slot="dropdown-content" role="list" class="w-64 p-4 space-y-2.5">
      <li><aegov-link href="/services/individuals" extra-class="text-sm font-medium">Services for individuals</aegov-link></li>
      <li><aegov-link href="/services/businesses" extra-class="text-sm font-medium">Services for businesses</aegov-link></li>
    </ul>
  </aegov-dropdown>
</aegov-navbar-item>
  • The item stays a link. Clicking "Services" still goes to /services; the dropdown is an extra layer, not a replacement.
  • trigger="hover" still works from the keyboard. The navbar item adds a chevron button that opens the dropdown with Enter or Space, and Tab moves through the links inside.
  • Give the panel a width class such as w-64. A dropdown can hold anything — a simple link list as in the example, or several columns with headings for a larger menu.
  • Keep the main destination on the item. Every dropdown in the example sits on an item that still has its own href.

Add an icon to a navbar item with slot="icon-start" on the svg, as on "Home" in the example.

Secondary actions with tooltips

The secondary-actions slot holds the compact actions at the end of the navigation row — in the example: search, sign in, U.ASK AI and a dark-mode switch. Wrap them in one div with slot="secondary-actions". Each is an icon-only aegov-button (is-icon="true", appearance="link") with an aria-label for screen readers, wrapped in an aegov-tooltip that shows the same label on hover and focus.

Like the navigation, this row is hidden below collapse-at — so put the same actions in mobile-content.

Complete example

A complete authority header: navigation with a dropdown under About, icon actions with tooltips, the menu drawer, and the top bar links. Hover or focus About to open its dropdown, and resize your browser below 1024px to see the menu button take over.

The live preview leaves out is-sticky (a preview box can't show sticking) and skip-content-container (this page already has its own "Skip to content" link). Keep both in your own pages, as in the code below.

Example Federal Authority logo Home Services Digital participation Open data About
  • Overview
  • Leadership
  • Strategy
  • Careers
<aegov-header
  variant="authority"
  is-sticky="true"
  entity-name="Example Federal Authority"
  entity-domain="https://www.example.gov.ae"
  logo-label="Example Federal Authority home"
  skip-content-container="#main"
>
  <!-- logo: always visible, linked to entity-domain -->
  <img slot="logo" src="https://designsystem.gov.ae/assets/site-logo/AEGov-DesignSystem-Logo-Color.svg" alt="Example Federal Authority logo" />

  <!-- navigation: second row, from collapse-at up. Any item can open a dropdown -->
  <aegov-navbar slot="navigation" label-nav="Main navigation" gap="gap-1 xl:gap-2">
    <aegov-navbar-item href="/" is-active="true">
      <svg slot="icon-start" width="20" height="20" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><path d="M104,216V152h48v64h64V120a8,8,0,0,0-2.34-5.66l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,40,120v96Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/></svg>
      Home
    </aegov-navbar-item>
    <aegov-navbar-item href="/services">
      Services
    </aegov-navbar-item>
    <aegov-navbar-item href="/digital-participation">
      Digital participation
    </aegov-navbar-item>
    <aegov-navbar-item href="/open-data">
      Open data
    </aegov-navbar-item>
    <aegov-navbar-item href="/about">
      About
      <aegov-dropdown slot="dropdown" trigger="hover" position="bottom">
        <ul slot="dropdown-content" role="list" class="w-64 p-4 space-y-2.5">
          <li><aegov-link href="/about/overview" extra-class="text-sm font-medium">Overview</aegov-link></li>
          <li><aegov-link href="/about/leadership" extra-class="text-sm font-medium">Leadership</aegov-link></li>
          <li><aegov-link href="/about/strategy" extra-class="text-sm font-medium">Strategy</aegov-link></li>
          <li><aegov-link href="/about/careers" extra-class="text-sm font-medium">Careers</aegov-link></li>
        </ul>
      </aegov-dropdown>
    </aegov-navbar-item>
  </aegov-navbar>

  <!-- secondary-actions: end of the second row, from collapse-at up -->
  <div slot="secondary-actions" class="flex items-center justify-end gap-0">
    <aegov-tooltip content="Search" position="bottom">
      <aegov-button size="sm xl:base" is-icon="true" aria-label="Search" appearance="link">
        <svg width="20" height="20" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><circle cx="112" cy="112" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/><line x1="168.57" y1="168.57" x2="224" y2="224" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/></svg>
      </aegov-button>
    </aegov-tooltip>
    <aegov-tooltip content="Sign in" position="bottom">
      <aegov-button size="sm xl:base" is-icon="true" aria-label="Sign in" appearance="link">
        <svg width="20" height="20" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><circle cx="128" cy="96" r="64" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/><path d="M32,216c19.37-33.47,54.55-56,96-56s76.63,22.53,96,56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/></svg>
      </aegov-button>
    </aegov-tooltip>
    <aegov-tooltip content="U.ASK AI" position="bottom">
      <aegov-button size="sm xl:base" is-icon="true" aria-label="Ask U.ASK AI" appearance="link">
        <svg width="20" height="20" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><path d="M124,100a24,24,0,1,1,24-24A24,24,0,0,1,124,100Z"/><path d="M144,160a24,24,0,1,1,24-24A24,24,0,0,1,144,160Z"/><path d="M120,216H72a8,8,0,0,1-8-8V171.81L36.42,159.18a8,8,0,0,1-3.77-10.3L56,104a80,80,0,1,1,128,64l8,64" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/><polyline points="214.38 88 184 88 144 136" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/><line x1="124" y1="76" x2="124" y2="24.89" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/></svg>
      </aegov-button>
    </aegov-tooltip>
    <aegov-tooltip content="Switch to dark mode" position="bottom">
      <aegov-button size="sm xl:base" is-icon="true" aria-label="Switch to dark mode" appearance="link">
        <svg width="20" height="20" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="208" y1="120" x2="208" y2="72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/><line x1="232" y1="96" x2="184" y2="96" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/><line x1="160" y1="32" x2="160" y2="64" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/><line x1="176" y1="48" x2="144" y2="48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/><path d="M210.69,158.18A96.78,96.78,0,0,1,192,160,96.08,96.08,0,0,1,97.82,45.31,88,88,0,1,0,210.69,158.18Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/></svg>
      </aegov-button>
    </aegov-tooltip>
  </div>

  <!-- mobile-content: the menu drawer, below collapse-at -->
  <div slot="mobile-content">
    <nav aria-label="Main navigation (menu)">
      <ul class="flex flex-col gap-2 list-none m-0 p-0">
        <li><a href="/" aria-current="page">Home</a></li>
        <li><a href="/services">Services</a></li>
        <li><a href="/digital-participation">Digital participation</a></li>
        <li><a href="/open-data">Open data</a></li>
        <li><a href="/about">About</a></li>
        <li><a href="/search">Search</a></li>
      </ul>
    </nav>
    <aegov-button size="base" is-full="true" class="mt-4">Sign in</aegov-button>
  </div>

  <!-- actions: the official top bar -->
  <nav slot="actions" class="hidden sm:inline" aria-label="Accessibility and language">
    <ul class="flex justify-end items-center gap-6 list-none m-0 p-0">
      <li><a href="/accessibility" class="text-sm! text-aeblack-100! focus-visible:text-aeblack-800! no-underline">
        <svg class="w-5 h-5" width="20" height="20" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><polyline points="104 72 104 136 192 136 224 200 248 192" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="104" cy="48" r="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M168,96H112a64,64,0,0,0,0,128c29.82,0,56.9-20.4,64-48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
        <span class="hidden lg:inline">Accessibility</span>
      </a></li>
      <li><a href="/ar" lang="ar" class="text-sm! text-aeblack-100! focus-visible:text-aeblack-800! no-underline">
        <svg class="w-5 h-5" width="20" height="20" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><circle cx="128" cy="128" r="96" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M168,128c0,64-40,96-40,96s-40-32-40-96,40-96,40-96S168,64,168,128Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="37.46" y1="96" x2="218.54" y2="96" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="37.46" y1="160" x2="218.54" y2="160" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
        <span class="hidden lg:inline">العربية</span>
      </a></li>
    </ul>
  </nav>
</aegov-header>

<main id="main">
  <!-- Page content -->
</main>

Controlling the menu from script

The header has openMenu(), closeMenu() and toggleMenu() methods, and emits aegovHeaderMenuOpen when the drawer starts opening and aegovHeaderMenuClose once it has finished closing. With is-sticky, it also emits aegovHeaderStuck / aegovHeaderUnstuck.

<script>
  const header = document.querySelector('aegov-header');

  // Close the menu after a link inside it is followed.
  header.addEventListener('click', (event) => {
    if (event.target.closest('[slot="mobile-content"] a')) header.closeMenu();
  });
</script>

The drawer's own events (aegovDrawerOpen, …) don't leave the header — listen for the aegovHeaderMenu* events instead.

RTL support

The header reads the direction from the closest dir ancestor or the html element, and updates if it changes. In RTL, the layout mirrors (logo on the right, drawer sliding in from the left) and the default menu labels switch to Arabic. The top bar text ("Learn more" and its panel) and the "Skip to content" link follow dir on the html element only — the top bar sits inside the header's Shadow DOM, so a dir on a wrapper does not reach it — so set dir="rtl" on html for Arabic pages.

<html lang="ar" dir="rtl">
  <body>
    <aegov-header entity-name="جهة اتحادية تجريبية" entity-domain="https://www.example.gov.ae" skip-content-container="#main">
      …
    </aegov-header>
  </body>
</html>

Usage

Here is the recommended usage of a header on any website or application. These are recommended usage guides, however the developer must use the best practices of web and application development.

Use exactly one header per page, at the very start of the body
It renders the page's banner landmark. Two headers, or a header nested inside main, confuse screen-reader navigation.

Set skip-content-container to your main content
Keyboard users can then jump past the header and navigation in one keystroke (WCAG 2.4.1, Bypass Blocks).

Repeat the navigation inside mobile-content
Below collapse-at the navigation, search and secondary-actions slots are hidden. Whatever users need on small screens must also be in the drawer.

Use formal government navigation labels
"Services", "About", "Contact", "Frequently asked questions" — not informal labels like "What we do" or "Get in touch".

Do not set your own height on the logo
The component sizes the slotted logo for every breakpoint. Your own height classes override that sizing and break the header's proportions.

Use icon-only buttons with a tooltip in secondary-actions
The slot shares the second row with the navigation. Compact icon buttons (is-icon + appearance="link") fit several actions; give each an aria-label and wrap it in aegov-tooltip so sighted users see the label too.

Do not rely on hover alone to reach dropdown links
Keep every dropdown's main destination as the navbar item's own href, and repeat key links in mobile-content — touch screens have no hover.

API reference

The following are the properties and references of a header

aegov-header properties

AttributeDescriptionTypeDefault

entity-name

Required. The entity's official name. Shown in the top bar's "Learn more" panel. If it (or entity-domain) is missing, the top bar renders an inline error instead.

string

undefined

entity-domain

Required. The entity's website address. Shown in the "Learn more" panel and used as the link target of the logo.

string

undefined

variant

ministry shows the search slot at the end of the logo row. authority shows the UAE emblem there instead, and the search slot is not rendered.

ministry | authority

ministry

emblem-color

Colour of the UAE emblem. aeblack for light backgrounds, whitely for dark backgrounds (dark mode), aegold for entities that show the emblem in gold. authority variant only — ignored on ministry, which has no emblem. Any other value falls back to aeblack with a console warning.

aeblack | aegold | whitely

aeblack

logo-label

Accessible name for the logo link (applied as aria-label). Use it when the logo has no meaningful alt text.

string

undefined

skip-content-container

The ID of the page's main content element, with or without # ("#main" or "main"). A missing # is prepended, so class or other selectors do not work. Adds a "Skip to content" link as the first element of body; read once when the header connects, so changing it later has no effect.

string

undefined

collapse-at

Breakpoint where the navigation row appears and the menu button disappears. Below it, the menu button opens the drawer.

md | lg | xl | 2xl

lg

drawer-size

Width of the menu drawer. Below 640px every size becomes full width.

xs | sm | base | lg | xl | full

base

label-menu

Accessible name of the menu button and of the drawer it opens.

string

"Menu" / "القائمة"

label-menu-close

Accessible name of the drawer's close button.

string

"Close menu" / "إغلاق القائمة"

is-sticky

Pins the navigation row to the top of the viewport on scroll. The top bar and the logo row scroll away; once pinned, the navigation row gets a blurred, translucent background and a shadow. Applies only from collapse-at up — below it nothing pins.

boolean

false

aegov-header slots

SlotDescription

logo

Entity logo (an img or inline svg). Always visible at the start of the logo row, wrapped in a link to entity-domain. The component sizes it — don't add your own height.

search

Search control at the end of the logo row. ministry variant only. Hidden below collapse-at.

navigation

Primary navigation (usually aegov-navbar). Second row, visible from collapse-at up. Must carry its own <nav> landmark — aegov-navbar does this via label-nav.

secondary-actions

One or two action buttons (for example "Sign in") at the end of the second row. Hidden below collapse-at, together with the navigation.

mobile-content

Everything inside the menu drawer, opened by the menu button below collapse-at. Repeat the navigation here, plus anything from search or secondary-actions that users need on small screens.

actions

Links in the official top bar, typically Accessibility and Language. Forwarded to the embedded aegov-header-banner. There is no fallback content — when empty, the top bar shows no links. The bar is dark, so give your links a light text colour.

aegov-header events

EventDescriptionType

aegovHeaderMenuOpen

The menu drawer has started opening (re-emitted from the internal drawer's open event, before the slide-in completes).

CustomEvent<void>

aegovHeaderMenuClose

The menu drawer has finished closing and focus has returned to the menu button.

CustomEvent<void>

aegovHeaderStuck

The navigation row has pinned to the top of the viewport. Only with is-sticky.

CustomEvent<void>

aegovHeaderUnstuck

The navigation row has returned to its resting position — including when is-sticky is turned off or the viewport shrinks below collapse-at while pinned. Only with is-sticky.

CustomEvent<void>

aegov-header methods

MethodDescriptionReturns

openMenu()

Opens the menu drawer.

Promise<void>

closeMenu()

Closes the menu drawer.

Promise<void>

toggleMenu()

Toggles the menu drawer.

Promise<void>

CSS custom properties

PropertyDescription

--aegov-header-height

Set by the component only while is-sticky is on: the height of the pinned navigation row (0px below collapse-at). Read-only. It is written as an inline style on the aegov-header element only, so it inherits into the header's own subtree and nowhere else — copy it to :root (for example with a ResizeObserver) if in-page anchors need a scroll-margin-top offset.

--aegov-header-sticky-offset

Set by the component only while is-sticky is on: the combined height of the top bar and logo row, used as the negative sticky top. Read-only, inline on the aegov-header element.

--aegov-header-stuck-bg

Background of the pinned navigation row (is-sticky). Override on aegov-header, including a dark-mode value — the header's Shadow DOM can't see a .dark class on :root.

--aegov-header-stuck-bg-fallback

Opaque background used instead in browsers without backdrop-filter support.

aegov-header-banner properties (embedded sub-component)

AttributeDescriptionTypeDefault

entity-name

Set for you by aegov-header.

string

undefined

entity-domain

Set for you by aegov-header.

string

undefined

skip-content-container

Set for you by aegov-header.

string

undefined

Pass-through attributes

Attribute groupNotes

class, style, id

Applied to the host element as usual. The header renders in Shadow DOM, so page CSS can't restyle its internals — use the CSS custom properties above.

aria-*, data-*

Stay on the host. They are not forwarded to any internal element.

Notes

The following notes are applicable to this component.

Built-in accessibility

  • Renders the page's banner landmark, with the official top bar inside it.
  • The "Learn more" trigger has aria-expanded and aria-controls; Escape closes the panel and returns focus to the trigger.
  • The menu button has aria-expanded and aria-controls pointing at the drawer. Opening the drawer moves focus into it and traps Tab inside; closing it (button, Escape or backdrop) returns focus to the menu button.
  • Growing the viewport past collapse-at closes an open drawer, so the same links are never reachable twice.
  • With skip-content-container, a "Skip to content" link becomes the first focusable element on the page.
  • Built-in text switches between English and Arabic based on direction: the menu labels follow the closest dir ancestor or html; the top bar text ("Learn more", the panel) and "Skip to content" follow dir on html only.
  • Decorative icons are hidden from assistive technology.

Developer responsibilities

  • Use exactly one aegov-header per page, at the start of the body.
  • Give the logo an accessible name — alt on the image and/or logo-label.
  • Give the navigation content its own <nav> landmark with a name (aegov-navbar does this with label-nav), and give the drawer's copy a different name.
  • Fill mobile-content whenever the menu button can appear; the component warns in the console when it is empty.
  • Give icon-only buttons in search and secondary-actions an aria-label.
  • Set lang and dir on the html element for Arabic pages, and mark the language link with lang="ar".

Keyboard support

Key Action
Tab / Shift + Tab Move between focusable elements. Trapped inside the menu drawer while it is open.
Enter / Space Activate the focused control — menu button, "Learn more", close button, or a link.
Escape Close the menu drawer or the "Learn more" panel, returning focus to its trigger.