# <app-bar>

The bar at the top of a screen: a title, a leading menu icon, and action icons on the right.

Category: Structure.

```ham
<screen>
    <app-bar title="Inbox"
             bg_color="teal-600"
             leading_icon="menu">
        <icon name="search"
              action="/search"/>
        <badge count="2">
            <icon name="notifications"/>
        </badge>
    </app-bar>
    <main>
        <column style="w-full p-16 gap-8">
            <text style="font-bold">Maya Chen</text>
            <text style="muted">Dinner on Friday still works for me.</text>
        </column>
    </main>
</screen>
```

How Hype Apps draws it on a phone: [light](https://hypeapps.dev/img/tags/app-bar-light.webp), [dark](https://hypeapps.dev/img/tags/app-bar-dark.webp).

## Attributes

| Name | What it does | Default |
|---|---|---|
| `bg_color` (also `background_color`) | Bar background color (also bg-color, background-color) |  |
| `elevation` | Shadow elevation (0 if transparent) |  |
| `leading_icon` | Leading icon name (menu, hamburger, etc.) |  |
| `text_color` (also `fg_color`, `foreground_color`) | Title and icon color. |  |
| `title` | AppBar title text; none without it |  |
| `title_image` | Image shown instead of the title text (server path, file:, or http; light:/dark: prefixes pick per theme). title stays as the accessibility label; a broken image falls back to the text |  |
| `title_reveal` | scroll: hide the title at the top of the page and fade it in as the content scrolls; a number is the px offset at full visibility (default 160) |  |
| `title_style` | Style tokens for the title text (font-* families, font-size-*, font-weight-*, tracking-*, light:/dark: colors). Use this, never style= on the bar |  |
| `transparent` | Make AppBar transparent | `false` |

Any tag also takes gestures: `@on.tap`, `@on.longpress`, `@on.doubletap` and `@on.swipeleft` (and right, up and down). `@click` runs on a tap too.

## Guides and recipes that use it

- [Your first screen](https://hypeapps.dev/docs/guides/first-screen.md)
- [Layout and styling](https://hypeapps.dev/docs/guides/layout.md)
- [Navigation](https://hypeapps.dev/docs/guides/navigation.md)
- [Forms and state](https://hypeapps.dev/docs/guides/forms.md)
- [Lists and loops](https://hypeapps.dev/docs/guides/lists.md)
- [Data and databases](https://hypeapps.dev/docs/guides/data.md)
- [A poll that syncs](https://hypeapps.dev/docs/guides/sync.md)
- [Who's using the app ($me)](https://hypeapps.dev/docs/guides/me.md)
- [Gestures](https://hypeapps.dev/docs/guides/gestures.md)
- [Animations and effects](https://hypeapps.dev/docs/guides/animations.md)
- [Drawing and media](https://hypeapps.dev/docs/guides/media.md)
- [Your own tags](https://hypeapps.dev/docs/guides/own-tags.md)
- [A seat picker](https://hypeapps.dev/docs/cookbook/seat-picker.md)
- [A cart with quantities](https://hypeapps.dev/docs/cookbook/cart.md)
- [A chat thread](https://hypeapps.dev/docs/cookbook/chat.md)
- [An hourly forecast](https://hypeapps.dev/docs/cookbook/forecast.md)
- [Rows the server updates (MoviePlz)](https://hypeapps.dev/docs/cookbook/movieplz-watchlist.md)
- [Pick the right match (MoviePlz)](https://hypeapps.dev/docs/cookbook/movieplz-match.md)
- [Search on the server (MoviePlz)](https://hypeapps.dev/docs/cookbook/movieplz-search.md)

## Related tags

- [`<icon>`](https://hypeapps.dev/docs/reference/icon.md): A Material Symbols icon, with its style, weight, size and color set in its name.
- [`<badge>`](https://hypeapps.dev/docs/reference/badge.md): A small count or dot pinned to the corner of an icon or any other element.
- [`<column>`](https://hypeapps.dev/docs/reference/column.md): Stacks its children top to bottom, with a gap between them and an alignment across.
- [`<text>`](https://hypeapps.dev/docs/reference/text.md): A run of text; with @text it shows an expression that updates as its variables change.
- [`<drawer-header>`](https://hypeapps.dev/docs/reference/drawer-header.md): The header at the top of a side drawer, such as the signed-in person's photo and name.
- [`<drawer-left>`](https://hypeapps.dev/docs/reference/drawer-left.md): A drawer that slides in from the left edge, opened by the menu icon or #id.open.
- [`<drawer-right>`](https://hypeapps.dev/docs/reference/drawer-right.md): A drawer that slides in from the right edge, for filters or details; open it with #id.open.
- [`<list-tile>`](https://hypeapps.dev/docs/reference/list-tile.md): A Material list row with an icon, a title, a subtitle and an optional switch, checkbox or radio.

All tags: https://hypeapps.dev/docs/reference.md · The full reference: https://hypeapps.dev/llms.txt
