Created
June 29, 2023 09:33
-
-
Save nimone/9204ed6e9d725c0eef003011c9113698 to your computer and use it in GitHub Desktop.
Retractable Sidebar Component purely in ReactJS and TailwindCSS
Vite.+.React.-.Opera.2024-05-04.23-58-36.mp4
could u update the code
I just created a react app added the first thing is this.. it takes the full screen. Should I add something below it so it doesn't take full width ?
To fix the FULL SCREEN issue add w-fit to nav element.
<nav className="h-full w-fit flex flex-col bg-white border-r shadow-sm">
When adding the property overflow-y-auto to enable scrolling, the module names no longer appear when the sidebar is collapsed and the mouse hovers over a module. How can I resolve this issue without modifying the property?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Agregen al app.jsx
import { LayoutDashboard, Home, StickyNote, Layers, Flag, Calendar, LifeBuoy, Settings } from "lucide-react";
import Sidebar, { SidebarItem } from "./components/Sidebar"
function App() {
return (
<>
<SidebarItem icon={} text="Home" alert />
<SidebarItem icon={} text="Dashboard" active />
<SidebarItem icon={} text="Projects" alert />
<SidebarItem icon={} text="Calendar" />
<SidebarItem icon={} text="Tasks" />
<SidebarItem icon={} text="Reporting" />
<SidebarItem icon={} text="Settings" />
<SidebarItem icon={} text="Help" />
</>
)
}
export default App