LobeChatLobeHub
UI
Components
Chat
Mobile
Awesome
Brand
Mdx
Icons
Color
Changelog
Ctrl
K
General
ActionIcon
ActionIconGroup
Block
Button
Icon
Data Display
Accordion
Avatar
Collapse
Empty
FileTypeIcon
FluentEmoji
GroupAvatar
GuideCard
Highlighter
Hotkey
Image
List
Markdown
MaterialFileTypeIcon
Mermaid
Segmented
Skeleton
Snippet
SortableList
Tag
Tooltip
Video
Data Entry
AutoComplete
CodeEditor
ColorSwatches
CopyButton
DatePicker
DownloadButton
EditableText
EmojiPicker
Form
FormModal
HotkeyInput
ImageSelect
Input
SearchBar
Select
SliderWithInput
ThemeSwitch
Feedback
Alert
Drawer
Modal
Layout
DraggablePanel
Footer
Grid
Header
Layout
MaskShadow
ScrollShadow
Navigation
Burger
DraggableSideNav
Dropdown
Menu
SideNav
Tabs
Toc
Theme
ConfigProvider
FontLoader
ThemeProvider
Typography
Text

DraggableSideNav

A generic resizable side panel container with collapse/expand functionality. Supports custom header, body, and footer content with smart drag-to-collapse behavior.

import { DraggableSideNav } from '@lobehub/ui';
NPM
UNPKG
BundlePhobia
PackagePhobia
Anvaka Graph
Source
Edit
Previous
Burger
Next
Dropdown

Resources

Lobe UI-AIGC Components
Lobe Icon-AI / LLM Icon Collection
Lobe Charts-Modern Charts
Lobe TTS-TTS / STT Library

Community

Report Bug
Request Feature

Help

GitHub
Changelog

More Products

🀯 Lobe Chat-AI / LLM Chat Framework
🧸 Lobe Vidol-Virtual Idols for EveryOne
πŸ…°οΈ Lobe Theme-Stable Diffusion Extension
🌐 Lobe i18n-AI i18next CLI
Copyright Β© 2022-2025
Copyright Β© 2025 | Powered by dumi
LobeHub

Default

APIs

PropertyDescriptionTypeDefault
childrenBody content (main content area)ReactNode | ((expand: boolean) => ReactNode)-
headerHeader contentReactNode | ((expand: boolean) => ReactNode)-
footerFooter contentReactNode | ((expand: boolean) => ReactNode)-
expandWhether the panel is expanded (controlled)boolean-
defaultExpandWhether the panel is expanded by defaultbooleantrue
expandableWhether the panel can be expanded/collapsedbooleantrue
widthExpanded width (controlled). This represents the width when expanded, not the current displayed widthnumber-
defaultWidthDefault width when expandednumber280
placementPlacement of the side nav'left' | 'right''left'
resizableWhether to enable resizingbooleantrue
minWidthMinimum width (also the collapsed width)number64
maxWidthMaximum widthnumber-
showHandleWhether to show handle for togglingbooleantrue
showHandleWhenCollapsedWhether to show handle when collapsedbooleanfalse
animationAnimation configuration. Set to false to disable all animationsfalse | { blur?: boolean, fade?: boolean, header?: boolean, body?: boolean, footer?: boolean }-
onExpandChangeCallback when expand state changes(expand: boolean) => void-
onWidthChangeCallback when width changes(delta: NumberSize, width: number) => void-
onWidthDraggingCallback when actively resizing width(delta: NumberSize, width: number) => void-
classNamesClassnames for internal components{ container?: string; content?: string; handle?: string; body?: string; header?: string; footer?: string }-
stylesCustom styles for internal components{ container?: CSSProperties; content?: CSSProperties; handle?: CSSProperties; body?: CSSProperties; header?: CSSProperties; footer?: CSSProperties }-

Features

  • 🎯 Generic Container: Not tied to Menu - use any content you want
  • πŸ“ Smart Dragging: Drag to resize with smart auto-collapse/expand behavior and glowing indicator
  • πŸ”„ Dynamic Content: header, children, and footer can be functions receiving collapsed state
  • 🎨 Flexible Layout: Customize header, body, and footer independently
  • ⚑ Smooth Animations: 400ms width transitions with natural easing curves
  • ✨ Stunning Effects: Blur + opacity fade animations for silky content transitions
  • 🎭 Micro-interactions: Hover scale, click feedback, backdrop-blur glass effect
  • πŸŽ›οΈ Full Control: Controlled or uncontrolled mode

Notes

  • Generic Container: DraggableSideNav is a generic resizable container, not limited to navigation menus
  • Dynamic Rendering: Use function props to render different content based on expand state
  • minWidth serves as both the minimum draggable width and the collapsed width (default 64px)
  • Only horizontal resizing is supported (width adjustment)
  • Smart Collapse: Dragging below the collapse threshold triggers auto-collapse with animation
  • Performance Optimization: Set animation={false} to disable all animations and remove animation wrappers, reducing overhead for better performance
  • Enhanced Animations:
    • Width transition: 400ms with natural cubic-bezier easing
    • Fade effects: 300ms enter / 200ms exit with optional blur
    • Handle: Hover scale (1.05x), rotate animation
    • Resize indicator: Glowing theme color with smooth transitions
  • Fade Animations: Enable fade effects for header, body, or footer individually with optional blur effect for stunning content transitions using framer-motion
  • Visual Polish: Backdrop blur, smooth scrollbar, subtle shadows, micro-interactions
  • Use with any content: Menu, custom navigation, sidebars, panels, etc.
avatar
Canis workspace
  • Home
  • Integrations
  • Community
  • Repositories
    • Repo 1
    • Repo 2
  • Agents
    • πŸ‘¨β€πŸ’Ό
      LiJian
    • πŸ‘©β€πŸ’Ό
      Rene Wang
      正在玩 Cursor
    • πŸ€–
      Carl-bot
      正在玩 /games | carl.gg
    • πŸ‘”
      Arvin Xu
    • 🎨
      cy948
    • πŸ’»
      Wuxh
      Coding
    • 🎬
      Brandon Studio
    • πŸŒ™
      Tsuki

DraggableSideNav Demo

A workspace-style side panel with draggable resize

Active: home
✨ Features:
  • Smart Handle: Hover to reveal toggle button
  • Flexible Resize: Drag to adjust panel width
  • Auto-collapse: Drag below threshold for smart collapse
  • Performance: No animation overhead for better performance
πŸ’‘ Try dragging the panel edge and using the toggle button β†’