# Mobile Navigation

> The Sidebar’s pages in a left drawer for tablets and phones.

- Category: Navigation
- Import: `import { MobileNavigation } from "@sagui/ui";`
- Page: /components/mobile-navigation

```tsx
import { useState } from "react";
import { Button, MobileNavigation } from "@sagui/ui";
import { Menu } from "lucide-react";

export function Hero() {
  const [open, setOpen] = useState(false);
  return (
    <>
      <Button variant="secondary" leadingIcon={<Menu />} onClick={() => setOpen(true)}>Open navigation</Button>
      <MobileNavigation open={open} onOpenChange={setOpen} title="Acme MDM" description="10 stores" currentHref="/vendors" nav={nav} />
    </>
  );
}
```

## When to use

- Opened from AppBar’s menu button below 1024px.

## When not to use

- AppShell already includes it. Use it directly only with a custom layout.

## 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 { MobileNavigation } from "@sagui/ui";

<MobileNavigation open={open} onOpenChange={setOpen} title="Acme" nav={nav} currentHref={pathname} />
```

## Accessibility

- A modal drawer: focus is trapped inside and returns to the menu button on close.
- Escape, the close button, a tap outside or choosing a page closes it.
