App Header
The top of a screen: back, the screen's title and a few actions. Small keeps the title inline; Medium and Large put a bigger title below the actions for top-level screens.
Ritla scan of this preview: 41 of 41 checks3 breakpointsScanned
Preview
Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.
Installation
Add the component
npx ritla add app-headerAlso works with shadcn:
npx shadcn@latest add @ritla/app-headerOr copy by hand
Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.
Usage
import { AppHeader } from "@/components/ui/app-header";<AppHeader title="Transfer money" leading={<IconButton variant="ghost" shape="square" size="md" icon={ArrowLeftIcon} label="Back" />} actions={<IconButton variant="ghost" shape="round" size="md" icon={DotsThreeVerticalIcon} label="More" />}/>Examples
Medium, Large and actions only
For top-level screens: the title below the actions, with an avatar. "Actions only" has no title.
Centred title and the slot
align="center" keeps the title in the middle of the bar whatever the widths on either side, and back is a <Link>. Children fill the slot under the bar (a search field or tabs).
API reference
AppHeader
| Prop | Type | Default | Description |
|---|---|---|---|
type | "small" | "medium" | "large" | "actions-only" | "small" | Figma's Type. |
title | ReactNode | None | The screen's title: the page heading. |
subtitle | ReactNode | None | Figma's Supporting text. |
align | "default" | "center" | "default" | Figma's Alignment. |
leading | ReactNode | None | The start control, usually a back IconButton. |
actions | ReactNode | None | Two or three actions, an avatar or a menu. |
headingLevel | 1 | 2 | 3 | 1 | The title's heading level. |
children | ReactNode | None | Figma's slot: a search field or tabs under the bar. |
Usage guidelines
The app header names the screen and holds back and its frequent actions. Which size to pick, how to write the title, how many actions to show, how back works in Arabic, and the checks before handoff.
1. Which size
Small keeps the title in the bar next to back, for screens inside a flow. Medium and Large put a bigger title under the actions, for top-level screens people land on. Actions only drops the title when the screen shows it elsewhere, such as over a photo.
| Type | Use |
|---|---|
| Small | Detail and step screens inside a flow; back is the main action. |
| Medium | Top-level screens from the navigation bar. |
| Large | The first screen of a section, when there is room for a big title. |
| Actions only | Screens that show their own title, such as a product photo or a map. |
2. The title
The title names the screen in two or three words, the same words as the item that led here. It is the page heading for screen readers. Supporting text adds one piece of context, such as the account the screen belongs to.
Short, matching titles
A transfer details screen.
Do
- Match the title to the navigation item or button that opened the screen.
- Keep it to one line; long titles wrap or truncate.
- Use supporting text for context: the account, the date, a count.
Don't
- Write the title as a sentence or instruction.
- Put the app's name in every title.
- Repeat the title in the supporting text.
3. Actions
Keep one to three trailing actions for things people do often on this screen: search, share, edit. Put the rest in a More menu. Primary form actions (Save, Submit) belong at the bottom of the form, where people finish.
Few, frequent actions
A transfers list.
Do
- Show at most three actions, the most used ones.
- Move the rest into a More menu at the inline end.
- Label every icon action: Search, Share, More.
Don't
- Fill the header with four or more icons.
- Put Save or Submit only in the header.
- Use the avatar and three actions together on small screens.
4. Back and Arabic
Back points toward where people came from: left in English, right in Arabic. The RTL variant mirrors the whole bar: back and the title on the right, actions on the left, and the back arrow uses its RTL icon. In code the arrow flips by itself; don't hard-code a left arrow.
Back points to where you came from
A transfers screen in Arabic.
5. Scrolling
The header stays at the top while content scrolls. Medium and Large collapse into Small as people scroll, so the title stays visible without taking space. The slot under the title holds a search field or tabs that belong to the whole screen.
Do
- Keep the header pinned on long screens.
- Collapse Medium and Large into Small on scroll.
- Use the slot for screen-wide search or tabs.
Don't
- Hide the header on scroll when back is the only way out.
- Put page content, like a form, in the slot.
Before handoff
- The size matches the screen's level.
- The title matches what opened the screen.
- At most three actions, each named.
- Arabic screens use the RTL variant with back pointing right.
Accessibility
Keyboard
Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.
| Key | Action |
|---|---|
| Tab | Through the controls in reading order: back, then the actions. |
ARIA
- The bar is a
header, and the title is the page heading (h1by default). - Every icon button has a name: Back, Search, Notifications, More. Touch targets are 48px.
- Don't put Save or Submit only in the header.
Do
- The title is the page heading (
h1). - Name every icon button in the page language: Back, Search, More.
- 48 px touch targets on every button.
Don't
- Generic or wrong names on icon buttons.
- The header title as an image or logo only.
Arabic and RTL notes
Mirrors
- Back sits on the right and points right; the actions move to the left.
- The title starts on the right; a centred title stays centred.
Does not mirror
- The search, notification and more icons, and the avatar.
- Numerals
- Numbers in the subtitle (Step 2 of 3) are as you pass them.
- Arabic typography
- Small
body-16, Mediumbody-20, Largeheading-36, Medium weight; the heights are minimums, since Arabic titles run taller. - Mixed-direction text
- Never hard-code a left arrow:
ArrowLeftIconmirrors on its own in Arabic.
Do
- The RTL variant on every Arabic screen.
- Write titles natively in Arabic; they often need more width.
- Keep icons with no direction, such as search and the bell, as they are.
Don't
- The English bar on an Arabic screen, where back points forward.
- Flip the whole bar image by hand.
- Mirror the search or notification icon.
Checks it passes
The Ritla checks this component satisfies by construction. Used as documented, it does not bring these defects onto your page.
- Clipped text: content wider than its box with overflow hidden and no ellipsis
- Fixed-pixel-width container whose Arabic text exceeds the space
- Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
- letter-spacing applied to Arabic text (breaks the connected script)