Componentfeedback1.11 KB gzipZero dependencies

Drawer Nav

Mobile hamburger drawer sliding from the left with staggered links.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add drawer-nav

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { DrawerNav } from "@/components/ui/drawer-nav"; <DrawerNav />

Source code

drawer-nav.tsx + 2 helpers

Zero 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 />
PropTypeDescription
itemsDrawerNavItem[]Structured list of items rendered by the component.
openbooleanControlled open visibility state.
onOpenChange(open: boolean) => voidCallback invoked on open change.
titlestringPrimary heading or title text. (Default: "Menu")