Header
The header stays at the top of every screen. It holds the main sections of a website, or the actions of WerkOS you need in any module.
Website and product
On a website, the header lists the main sections. Each one opens a panel with all of its pages, so any page is two clicks away.
In WerkOS, the rail on the left does the navigating. The header holds what a recruiter needs in any module, from Add task to Sign out.
When to use it
Give each screen one header, holding only the sections people choose between and the actions they need everywhere. Keep the sections in the same order on each page.
Actions for one page, such as Publish job, go in its toolbar. The blocks of a long page go in the side navigation.
Anatomy
On a website, from left to right: the logo, the sections, the theme switch and one primary button. In WerkOS the controls are round and flat, and the ask bar sits in the center.
- Height at rest
- 72 px
- --header-h
- Height after scrolling
- 64 px
- --header-h-condensed
- Logo height
- 30 px, 22 px below 400 px
- Section button
- 40 px high, 10 px padding, 6 px radius, 2 px apart
- --radius-md
- Section label
- 14 px on 20 px, weight 500
- --type-nav
- Theme switch and menu button
- 40 by 40 px
- Primary button
- Button, medium, 44 px
- --brand-true
- WerkOS bar
- 52 px inside a 60 px band, bottom corners 24 px
- WerkOS controls
- 36 px, full radius, no border
- --radius-full
- WerkOS on a phone
- 64 px plus the top safe area
- --app-header-h
States
At the top of the page the header is opaque. Once the page scrolls under it, it turns to frosted glass and settles to its shorter height.
The section you are in has full ink and bold type. Each label keeps the width of its bold form, so nothing shifts from page to page.
- On hover
- Fill and full ink
- --surface-control
- Current
- Full ink, weight 700
- --text
- Open
- Fill held while its panel is open
- --surface-control
- Focus
- 2 px ring, 2 px offset
- --focus-ring
Section panel
A section button opens a panel under it that lists the pages of that section. A second press on the button opens the overview of the section.
- Surface
- White in light, the raised fill with its ring in dark
- --surface-1, --glass-fill-raised
- Radius
- 16 px
- --radius-2xl
- Shadow
- Level 3
- --elevation-3
- Padding
- 8 px
- --space-2
- Row
- 36 px, 44 px on a touch screen
- Columns
- One column up to seven pages, more as the list grows
- Entrance
- Fade and 6 px rise in 150 ms
- --duration-fast
- Height
- Ends 96 px above the foot of the window, then scrolls
- Avatar
- Button
- Card
- Checkbox
- Combobox
- Command palette
- Counter
- Country mark
- Date and time picker
- Dialog
- Disclosure
- Field
- Header
- Human and agent selector
- Icon button
- Inline message
- Job card
- Link
- List
- Menu
- Mobile navigation
- Notifications
- Permitted and not permitted
- Popover
- Progress
- Radio
- Search field
- Segmented control
- Select
- Sheet
- Side navigation
- Skeleton
- Stat tile
- Status
- Switch
- Tabs
- Text area
- Text field
- Toast
- Toolbar
- Tooltip
- WerkAI
Behavior
The header condenses by moving, not by resizing, so the page under it holds still. In WerkOS on a desktop, scrolling down slides the header away and the first scroll up brings it back.
Below 1280 px, the sections and the primary button move behind a menu button, into a layer with its own scroll. Below 400 px the theme switch joins them.
Keyboard and screen readers
The header is the banner of the page, and its sections form a navigation landmark named Primary. The current section carries aria-current, and each section button says whether its panel is open.
- Tab
- Moves through the logo, the sections and the buttons
- Enter or Space
- Opens the panel and moves focus to its first link. On an open section, opens its overview
- Left and Right
- Move between section buttons, and one column inside a panel
- Up and Down
- Move through the links of the open panel
- Home and End
- Jump to the first or last link
- Escape
- Closes the panel and returns focus to its button
Permitted and not permitted
Permitted
Mark the current section with ink and weight
People who cannot tell colors apart still see where they are.
Open panels on click or key press
Touch screens have no hover, and hover panels open by accident.
Not permitted
Page actions in the header
Publish job belongs in the toolbar of the job it publishes.
A header that grows or shrinks in the page
Everything below it jumps. Move the bar instead.
Menu roles on navigation links
A screen reader then expects menu keys the links do not answer.