Real collapse animation
Click Collapse in the preview to see a genuine CSS width transition, not a mockup.
Design a collapsible app sidebar that animates between a full label view and an icon-only rail. Edit the nav items, colors and position, then copy HTML, CSS and JS.
A working collapse toggle, correct icon-rail collapsing, and clean exportable code.
Click Collapse in the preview to see a genuine CSS width transition, not a mockup.
Type icon and label pairs, one per line, and pick which item is active.
Mirror the whole layout to place the sidebar on either edge.
A collapsible sidebar is one of the most common patterns in dashboards and admin tools: a full-width panel with icons and labels that can shrink to a narrow icon-only rail, giving users more room for content without losing quick access to navigation. The mechanic behind it is simpler than it looks — a CSS transition on the sidebar's width, combined with a class toggled by a small JavaScript click handler, and labels that fade or truncate as the container narrows. This generator produces exactly that pattern as plain, dependency-free HTML, CSS and JS, so it can sit inside any app shell, whether you're using a framework or plain server-rendered pages, without pulling in a component library just for navigation.
A single CSS transition on width (or max-width) animates the collapse smoothly across modern browsers.
At the collapsed width, labels are hidden via overflow while icons stay centered, keeping navigation usable in less space.
An accent-colored background on the active link gives users a persistent sense of where they are in the app.
Some products, especially RTL-friendly ones, place primary navigation on the right; this generator supports both.
Type one item per line in the nav items textarea using the format "icon | label", for example "š | Home". Each line becomes one sidebar link.
Yes. Clicking Collapse in the live preview toggles a real CSS class that animates the sidebar width with a CSS transition, and labels fade out to leave an icon-only rail.
Yes. Use the position control to switch the sidebar between the left and right edge of the layout.
A combined block with the sidebar HTML markup, the CSS including the collapse transition, and the small vanilla JavaScript toggle script, ready to paste into your project.
Keep building navigation and layout components with these free tools.