Ask Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Search or ask anythingAsk Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Colour mode: System

Top app bar

The header of a mobile screen

A leading menu, back or close button, the screen title with an optional subtitle, and up to three trailing icon actions, with any more listed behind a More button. The bar sticks to the top of its scroll container and watches the window’s scroll, or the element passed as scrollTarget, or takes a scrolled prop from the host, so it can switch to its scrolled surface as content passes under it.

Platforms

The platform prop draws the same bar three ways. Default is the Rift bar, built from the system’s tokens. The ios variant matches the iOS 26 navigation bar, with a glass circle for the leading control and one glass capsule for the trailing actions; the android variant matches the Material 3 Expressive top app bar. The platform variants are for mocks and prototypes that should read as the real system chrome, and a shipped native app should use the native component. Scroll a stage to see each bar’s scrolled state.

Messages

Default

Messages

iOS

Messages

Android

Collapsing titles

Medium and large sizes add an expanded title under the bar that folds away as content scrolls under it, while the bar’s own title fades in. Only one of the two copies is the heading at any moment. On iOS both sizes are the large title, which collapses to the centred inline title. Scroll inside each stage to collapse it, and back to the top to open it again. The iOS scroll edge blurs on the web rather than refracting: Apple’s lensing needs shader access to the content behind it, which no browser gives a stylesheet.

Inbox12 unread

Default, large with a subtitle

Library

iOS, large title

Photos

Android, medium

Actions and overflow

The bar shows up to three trailing actions and lists the rest in a menu behind a More button. An action’s badge is a dot, announced to screen readers as new. The close control suits a screen that dismisses rather than going back, such as a compose sheet.

Home

Badge and overflow menu

New message

Close with a centred title

Props

Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.

TopAppBar props
PropTypeDefaultDescription
title*
string
The screen's title. Note: this shadows the native `title` tooltip attribute, which TopAppBar does not expose.
subtitle
string
A second line under the title, e.g. a count or a date range
platform
"default" | "ios" | "android"
'default'
Which platform's bar to draw. `default` is the Rift bar; `ios` is the iOS 26 navigation bar, with glass circle buttons over content and a soft blurred edge; `android` is the Material 3 Expressive top app bar.
size
"small" | "large" | "medium"
'small'
`small` puts the title in the bar. `medium` and `large` add an expanded title under it that collapses into the bar as the page scrolls; on iOS both are the large title.
align
"center" | "start"
Title alignment in the bar. Defaults to centred on iOS and to the start edge elsewhere
navigation
"menu" | "close" | "back"
The leading control: a menu button, a back button, or a close button
onNavigate
(() => void)
Called when the leading control is pressed
navigationLabel
string
Accessible label of the leading control; defaults to "Open menu", "Back" or "Close"
actions
TopAppBarAction[]
[]
Trailing actions. The first three show as icon buttons; any more join the overflow menu, ahead of `overflowActions`, where they render as plain rows (a menu row draws no badge and routes from `onClick`, not `href`)
overflowActions
TopAppBarOverflowAction[]
[]
Actions listed in a menu behind a trailing "More" button
overflowLabel
string
'More'
Accessible label of the button that opens the overflow menu
badgeLabel
((label: string) => string)
(label: string) => `${label}, new`
The accessible name of an action that carries a `badge`, given the action's `label`. Defaults to "<label>, new", e.g. "Notifications, new".
scrolled
boolean
Whether content has scrolled under the bar, which collapses an expanded title and switches the bar to its scrolled surface. Leave unset to have the bar watch `scrollTarget` itself.
scrollTarget
HTMLElement | null
The element whose scroll the bar watches when `scrolled` is unset. Defaults to the window
headingLevel
1 | 2 | 4 | 3 | 5 | 6
1
Level of the title's heading element
sticky
boolean
true
Keeps the bar stuck to the top of its scroll container
className
string
''
Additional CSS classes
linkComponent
LinkComponent
The component its links render with, such as Next.js's `Link`, so they navigate through the app's router. Wins over a LinkProvider's; a plain `<a>` when neither is set.

Tested keys

An automated test presses every row below, in a left-to-right and a right-to-left layout.

The buttons follows the WAI-ARIA button pattern.

Keys the buttons is tested against
KeyWhat it does
Enter
Activates the button.
Space
Activates the button.
tsx
// From the npm package
import { TopAppBar } from 'rift-ds/components/TopAppBar/TopAppBar';

// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/top-app-bar.json

10.1 kB gzipped, with everything it imports. Peer dependencies are not counted.

For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.