# App Bar

> The top bar on tablets and phones, with the menu button, workspace, search and user.

- Category: Navigation
- Import: `import { AppBar } from "@sagui/ui";`
- Page: /components/app-bar

```tsx
import { AppBar, Avatar, SearchTrigger } from "@sagui/ui";

export function Hero() {
  return (
    <AppBar className="w-full" hideOnDesktop={false} brand={<span className="type-label">Acme MDM</span>} onMenuClick={() => {}} search={<SearchTrigger variant="icon" onOpen={() => {}} shortcut={false} />} actions={<Avatar name="Sagnik Dey" size="sm" />} />
  );
}
```

## When to use

- Below 1024px in a signed-in app, paired with MobileNavigation.

## When not to use

- AppShell already includes its own bar. Use AppBar when you compose the layout yourself.

## Installation

Install the package and import the styles once. The [installation guide](/docs/installation) covers the Tailwind setup.

```bash
npm install @sagui/ui
```

## Usage

```tsx
import { AppBar, MobileNavigation, SearchTrigger, Avatar } from "@sagui/ui";

<AppBar brand="Acme" onMenuClick={() => setOpen(true)} menuOpen={open} search={<SearchTrigger variant="icon" onOpen={openSearch} />} actions={<Avatar name="Sagnik Dey" size="sm" />} />
```

## Accessibility

- The menu button has `aria-expanded` and opens a dialog.
- Hidden from 1024px by default, where the Sidebar takes over.
