# <drawer-left>

A drawer that slides in from the left edge, opened by the menu icon or #id.open.

Category: Structure. Also written `<drawer>`.

```ham
<screen>
    <app-bar title="Library"
             leading_icon="menu"/>
    <drawer-left id="nav">
        <drawer-header>
            <column style="p-16 gap-8">
                <avatar text="AR"
                        size="56"
                        color="teal"/>
                <text style="font-bold">Ana Ruiz</text>
            </column>
        </drawer-header>
        <list-tile icon="book">My loans</list-tile>
        <list-tile icon="settings">Settings</list-tile>
    </drawer-left>
    <main action-created="#nav.open">
        <column style="w-full p-16 gap-8">
            <text style="font-bold">Two books due this week</text>
            <button action="#nav.open">Open menu</button>
        </column>
    </main>
</screen>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `bg-color` | Background color (theme-aware default) |  |
| `mode` | Drawer mode: overlay (Material) or slide (Threads-style) (overlay, slide) | `overlay` |

## Commands

| Name | What it does |
|---|---|
| `close` | Close it. |
| `open` | Open the drawer. |
| `toggle` | Open/close. |

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

- [Navigation](https://hypeapps.dev/docs/guides/navigation.md)

## Related tags

- [`<app-bar>`](https://hypeapps.dev/docs/reference/app-bar.md): The bar at the top of a screen: a title, a leading menu icon, and action icons on the right.
- [`<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.
- [`<column>`](https://hypeapps.dev/docs/reference/column.md): Stacks its children top to bottom, with a gap between them and an alignment across.
- [`<avatar>`](https://hypeapps.dev/docs/reference/avatar.md): A round avatar from a photo, initials or an icon, in any size and color.
- [`<text>`](https://hypeapps.dev/docs/reference/text.md): A run of text; with @text it shows an expression that updates as its variables change.
- [`<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.
- [`<button>`](https://hypeapps.dev/docs/reference/button.md): A tappable button that runs an action: a fetch, a navigation or a statement.
- [`<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.

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