Componentfeedback1.11 KB gzipZero dependencies
Drawer Nav
Mobile hamburger drawer sliding from the left with staggered links.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add drawer-navOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { DrawerNav } from "@/components/ui/drawer-nav"; <DrawerNav />Source code
drawer-nav.tsx + 2 helpersZero third-party dependencies (3 local files shown in tabs below).
tsxdrawer-nav.tsx89 lines
"use client"; import * as React from "react";import { getFocusable, lockBodyScroll, registerEscapeLayer, trapFocus } from "./lib/focus-trap";import { cn } from "./lib/utils"; export interface DrawerNavItem { id: string; label: string; href?: string;} export interface DrawerNavProps extends React.HTMLAttributes<HTMLDivElement> { items: DrawerNavItem[]; open: boolean; onOpenChange: (open: boolean) => void; title?: string;}Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { DrawerNav } from "@/components/ui/drawer-nav"; <DrawerNav />| Prop | Type | Description |
|---|---|---|
| items | DrawerNavItem[] | Structured list of items rendered by the component. |
| open | boolean | Controlled open visibility state. |
| onOpenChange | (open: boolean) => void | Callback invoked on open change. |
| title | string | Primary heading or title text. (Default: "Menu") |