Android app bar

A Material app bar with a title, navigation action and trailing actions in Vlak tones.

Messages

Document browser

Documents

Navigation and actions keep their own touch targets as the title changes.

Use it for

  • Top-level Android screens with a title and a small set of actions.
  • A medium app bar when the screen needs a larger title.

Not for

  • Page navigation with more destinations than fit in an app bar.

Three ways in. They share one source, so the pixels match whichever you pick.

1. Import the package

npm install @noorddev/vlak-react

// once, next to your app's root
import "@noorddev/vlak-react/css";

import { AndroidAppBar, AndroidAppBarAction, Icon } from "@noorddev/vlak-react";

Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/android-app-bar.

2. Vendor the source

npx @noorddev/vlak-cli add android-app-bar

The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.

3. Through shadcn

npx shadcn add https://vlak.dev/r/android-app-bar.json

The same registry item, installed by shadcn's CLI.

CSS only

<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />

No React. Link vlak.css and use the markup and classes below.

import { AndroidAppBar, AndroidAppBarAction, Icon } from "@noorddev/vlak-react";

<AndroidAppBar title="Documents" navigation={<AndroidAppBarAction aria-label="Go back" onClick={goBack}><Icon name="arrow-left" /></AndroidAppBarAction>} />

AndroidAppBar

PropTypeDefaultDescription
titlerequiredReactNode
navigationReactNode
actionsReactNode
variant"small" | "medium""small"

Also accepts Omit<HTMLAttributes<HTMLElement>, "title">.

AndroidAppBarAction

Also accepts ButtonHTMLAttributes<HTMLButtonElement>.

KeysDoes
TabMoves between enabled actions.
Enter or SpaceActivates the focused action.
<header class="rs-android-app-bar"><div class="rs-android-app-bar-navigation"><button class="rs-android-app-bar-action" type="button" aria-label="Go back">←</button></div><h2 class="rs-android-app-bar-title">Documents</h2><div class="rs-android-app-bar-actions"><button class="rs-android-app-bar-action" type="button" aria-label="More actions">⋯</button></div></header>
.rs-android-app-bar.rs-android-app-bar-medium.rs-android-app-bar-navigation.rs-android-app-bar-title.rs-android-app-bar-leading-title.rs-android-app-bar-medium-title.rs-android-app-bar-actions.rs-android-app-bar-action