How jiaweing/dropdrawer works
Project type and purpose
• This is a Next.js-based React component library and demo/documentation site for a single responsive UI component called “DropDrawer.”
• It ships as a drop-in replacement for shadcn/ui’s DropdownMenu, automatically swapping to a drawer on mobile. The repo contains:
• A Next.js app (under app/) for docs and live demo
• A folder of React UI components (components/) including the DropDrawer implementation
• Utility code (hooks/, lib/) and static assets (public/, docs/)
• Examples of usage (examples/) and a registry JSON for shadcn CLI (public/r/registry.json)
File structure
• Top-level directories:
• app/ – Next.js App Router: global styles, layout, home page, structured-data metadata
• components/ – UI building blocks:
○ ui/ – shadcn/Radix-based primitives (button.tsx, drawer.tsx, dropdown-menu.tsx, etc.)
○ mode-toggle.tsx, post-actions-dropdown.tsx, structured-data.tsx, theme-provider.tsx
○ The DropDrawer component lives under components/ui/dropdrawer.tsx (as “dropdrawer”)
• hooks/ – use-mobile.ts: breakpoint detection hook
• lib/ – miscellaneous utilities (e.g. utils.ts)
• public/ – static assets, images, docs screenshots, registry JSON (r/dropdrawer.json)
• examples/ – usage snippets (TSX files)
• Config/build files: next.config.ts, tsconfig.json, postcss.config.mjs, eslint.config.mjs, lockfiles
README for additional insights
• DropDrawer is purely a UI component library, no backend or database.
• Exposes a parallel API to DropdownMenu, plus mobile drawer modes.
• Demo site shows light/dark and mobile/desktop screenshots.
Elements
• Clear, rectangular nodes for each module (Next.js App, Layout, DropDrawer, Hook, Primitives, Public Assets)
• Framework & Routing (Next.js) – green
• Reusable Components (DropDrawer, UI primitives) – blue
• Hooks & Utils – orange
• Static Assets & External – purple/red
Detail
• That useIsMobile toggles the rendering branch inside DropDrawer