Skip to content

App Header

Get Ritla UI

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

Open in Figma

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add app-header

    Also works with shadcn: npx shadcn@latest add @ritla/app-header

  2. Or 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

app-header.tsx
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.

EnglishMirroredArabic
LTR →

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).

EnglishMirroredArabic
LTR →

API reference

AppHeader

PropTypeDefaultDescription
type"small" | "medium" | "large" | "actions-only""small"Figma's Type.
titleReactNodeNoneThe screen's title: the page heading.
subtitleReactNodeNoneFigma's Supporting text.
align"default" | "center""default"Figma's Alignment.
leadingReactNodeNoneThe start control, usually a back IconButton.
actionsReactNodeNoneTwo or three actions, an avatar or a menu.
headingLevel1 | 2 | 31The title's heading level.
childrenReactNodeNoneFigma'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.

TypeUse
SmallDetail and step screens inside a flow; back is the main action.
MediumTop-level screens from the navigation bar.
LargeThe first screen of a section, when there is room for a big title.
Actions onlyScreens 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: Two words and context“Transfer details” matches the list it came from; the account is the supporting text.
Don't: A sentence as a titleThe sentence wraps onto two lines, and the words that name the screen get lost.

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: Two actionsSearch and More; everything else lives in the menu.
Don't: Every action in the headerThree icons and an avatar crowd the title and are hard to tell apart.

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.

Do: RTL variantBack and the title sit on the right; the arrow points right, back toward the previous screen.
Don't: English bar on an Arabic screenBack points left, which reads as “next” to an Arabic reader.

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.

KeyAction
TabThrough the controls in reading order: back, then the actions.

ARIA

  • The bar is a header, and the title is the page heading (h1 by 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, Medium body-20, Large heading-36, Medium weight; the heights are minimums, since Arabic titles run taller.
Mixed-direction text
Never hard-code a left arrow: ArrowLeftIcon mirrors 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.

  • R042Clipped text: content wider than its box with overflow hidden and no ellipsis
  • R043Fixed-pixel-width container whose Arabic text exceeds the space
  • R050Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
  • R051letter-spacing applied to Arabic text (breaks the connected script)