DEV Community

Cover image for Built a Dashboard Sidebar with Tailwind & Alpine.js
Zack Webster
Zack Webster

Posted on

15 1

Built a Dashboard Sidebar with Tailwind & Alpine.js

I came across Alpine.js while on my journey of learning Laravel. And it has been a blessing.
In order to learn more about it, I've been building random things. This week, I tried building a dashboard sidebar. The design and functionality are inspired by that of CoreUI.

Here's how it looks like and works:
Alt Text
I wanted the sidebar to be open by default on Desktops. And the rest of the page accessible to the right.
Alt Text
When closed, I wanted the content to take over the full width of the window.
Alt Text
For mobile, I wanted to do the opposite. It has to be closed by default.
Alt Text
And when toggled open. I wanted it to be fixed. And the content outside it to be partly visible (opacity) but inaccessible. Additionally, clicking outside the sidebar should close it.

Interested in seeing this in action? You can do so here: https://tailpine.netlify.app/sidebar-2.html

And if you'd like to see how this was built you can do so here: https://github.com/zaxwebs/tailwind-alpine/blob/main/sidebar-2.html

Thanks for reading. Signing out.

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (3)

Collapse
 
core_ui profile image
CoreUI

"This week, I tried building a dashboard sidebar. The design and functionality are inspired by that of CoreUI." - use CoreUI every week! ;) cheers, yours truly CoreUI

Collapse
 
zaxwebs profile image
Zack Webster

Wow, I did not expect to see your comment. Delighted. Thanks, team!

Collapse
 
aribudin profile image
Ari Budin

Good luck Zack
Very helpful for Tailwind css beginners

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay