# Drawer — React Native component for Expo

> A side drawer that follows your finger, or pushes the screen aside as a card.

Side navigation drawer that springs in over a fading scrim — or, with variant="push", shrinks the screen into a rounded 0.92 card and slides it aside like modern mail apps. Swipe in from the edge, drag closed from anywhere on the panel with velocity and rubber-banding, and build the panel from DrawerProfile (soft initials avatar, presence, account switcher), DrawerItems with a spring-in accent-tinted active pill and popping count badges, divided section headings and a DrawerFooter meter. Flat theme colours, hairline edges and soft shadows; haptics throughout.

- Docs: https://expokit.in/docs/components/drawer
- Tier: Free
- Also called: side menu, navigation drawer, slide-out menu
- Category: Overlays
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg, expo-haptics
- Uses ExpoKit items: kit
- Variants: App Navigation, Workspace Switcher, Right Panel, Push Layout

## Installation

Run once per project: `npx @expokit/cli@latest init` (shared theme + KitProvider). Then:

```bash
npx @expokit/cli@latest add drawer
```

The CLI copies the source into your project (you own the code) and installs react-native-svg, expo-haptics.

Import: `import { Drawer } from "@/components/ui/drawer";`

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `content` | `ReactNode` | — | Panel content (usually DrawerItems); scrolls between header and footer. |
| `header / footer` | `ReactNode` | — | Pinned above / below the content (DrawerProfile, DrawerHeader, DrawerFooter…). |
| `children` | `ReactNode` | — | The screen the drawer belongs to. Enables edge swipe and push; without children the drawer opens in a Modal. |
| `open / defaultOpen` | `boolean` | `false` | Controlled / uncontrolled visibility. |
| `onOpenChange` | `(open: boolean) => void` | — | Called on drags, scrim tap, Android back and Escape. |
| `side` | `"left" \| "right"` | `"left"` | Edge the drawer slides from. |
| `width` | `number \| `${number}%`` | `"80%"` | Panel width in points or percent of the container (max 360). |
| `variant` | `"overlay" \| "push"` | `"overlay"` | Slide over a dimmed screen, or shrink the screen to a rounded 0.92 card and slide it aside (inline only). |
| `edgeSwipe` | `boolean` | `true` | Swipe in from the edge to open (needs children). Taps in the edge zone still reach the screen. |
| `edgeWidth` | `number` | `24` | Width of the edge-swipe zone. |
| `dismissible` | `boolean` | `true` | Close on scrim tap and drag. |
| `scaleContent` | `boolean` | `true` | Overlay variant: scale the screen behind to 0.96 with rounded corners while open (inline). |
| `haptics` | `boolean` | `true` | Light impact on open; DrawerItems tick on press. |
| `topInset / bottomInset` | `number` | `platform estimate` | Space above the header / below the footer — pass safe-area insets for exact values. |
| `accessibilityLabel` | `string` | `labels.navigationDrawer` | Panel label. |
| `style / panelStyle` | `StyleProp<ViewStyle>` | — | Root container / panel style. |
| `DrawerProfile` | `{ name, email?, src?, status?, layout?: 'row' \| 'stacked', onPress?, accessory? }` | — | Account block: soft solid initials (or image) avatar with presence dot, name and email; pressable as an account / workspace switcher. |
| `DrawerHeader` | `{ title?, subtitle?, leading?, showClose?, onClose?, closeLabel? }` | — | Title chrome for the header slot. closeLabel names the close button (default labels.closeMenu). |
| `DrawerItem` | `{ label, icon?, badge?, badgeTone?, active?, tone?, onPress?, closeOnPress?, accent?, haptics?, trailing?, disabled? }` | — | Nav row with a spring-in accent-tinted active pill, popping icon and count badge (neutral plain count / accent tinted pill / danger solid pill); tone="danger" for Log out. |
| `DrawerSection` | `{ title, trailing?, divider? }` | — | Quiet heading between groups with a hairline divider above (divider={false} for the first group) and an optional trailing node. |
| `DrawerFooter` | `{ label, detail?, icon?, progress?, onPress?, trailing? }` | — | Compact footer row, e.g. a storage meter. |
| `DrawerIcon` | `{ name, size?, color?, strokeWidth? }` | — | The drawer's line icons, for menu buttons and headers. |
| `useDrawer()` | `() => { open, setOpen, toggle, close }` | — | Control the surrounding Drawer from inside it. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Touch**: Swipe in from the screen edge to open and drag the panel or scrim to close. Release velocity decides where it settles, and it rubber-bands past fully open.
- **Motion**: The panel springs in over a fading scrim; variant 'push' shrinks the screen into a rounded card and slides it aside. Active items spring in an accent pill and badges pop.
- **Reduced motion**: Opening and closing use a short timing instead of a spring, the push variant no longer scales the screen, and item and badge pops are skipped.
- **Haptics**: A light impact when the drawer opens and a selection tick when a DrawerItem is pressed.
- **Screen readers**: The open panel is marked modal and hides itself when closed. DrawerItems are menu items with selected and disabled states, and the badge is read with the label.
- **Keyboard**: Escape closes it on web; Android back closes it when it is rendered inline.

## FAQ

### How do I make a side menu in React Native?

Use ExpoKit's Drawer: run npx @expokit/cli@latest add drawer in your Expo or React Native project and it copies a ready-made side menu into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Drawer work in Expo Go?

Yes. Drawer runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg, expo-haptics) are all included in Expo Go.

### How do I add Drawer to my Expo app?

Run npx @expokit/cli@latest add drawer in your project. The CLI copies the component's source into your app and installs react-native-svg, expo-haptics, so the code is yours to change.

### Is Drawer free?

Yes. Drawer is free: its full source is on this page and the CLI installs it without an account.

### Can I change how Drawer looks?

Yes. It takes its colours, radius and light / dark mode from useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.

## More

- Live preview, variants and code: https://expokit.in/docs/components/drawer
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
