Responsive Header
A responsive header component for React that supports drag-to-close gestures on mobile devices and functions as a dialog or drawer on desktop. Built with accessibility, responsiveness, and smooth animations in mind.
A responsive header component for React that supports drag-to-close gestures on mobile devices and functions as a dialog or drawer on desktop. Built with accessibility, responsiveness, and smooth animations in mind.
npm install motion vaul
please add this property in your layout.js or app.js
you can use state or default button to control the dialog
const [sidebarOpen, setSidebarOpen] = useState(false)
return (
<>
<HeaderDrawer
open={headerOpen}
setOpen={setHeaderOpen}
drawerBtn={()=> { return <button><MenuIcon/></button>
}}>
<DrawerContent>
</DrawerContent>
</HeaderDrawer>
)
| Prop | Type | Description |
|---|---|---|
open | boolean | The content to be displayed within the AuroraBackground component. |
setOpen | boolean | this is an function to close and open the drawer |
drawerBtn | function | this is an function for default button, when you don't to use state then you can use drawerBtn |