Community forum for knowledge and support

Updated 2 months ago

Sidebar 6 component: Collapsing by default

At a glance

The community member is using the sidebar 6 component and wants to start it as collapsed instead of expanded. Another community member provided a video showing how to do this. The community members then discussed how to change the collapsed and expanded widths of the sidebar, but ran into issues with the icons not being centered. After some back-and-forth, they determined that increasing the padding for the menu-top and menu-bottom elements could help center the icons, though they were not able to fully resolve the issue.

Useful resources

I'm using the sidebar 6 component. How would I get that to start as collapsed in stead of expanded?
https://library.relume.io/components/sidebar-6

C
M
S
15 comments

Excellent. Worked for me, thanks.

@Matt I have one more question and hopefully this is easy. What if I wanted to change the collapsed width to 6.5rem and the expanded width to 15rem? I see when I change the collapsed width to 6.5rem from 4.5rem the icons are no longer centered and I'm not sure how to fix that?

hmm yeah, definitely not simple actually, I mean...it should be...

I'll have to circle back to it, I wasn't able to make anything happen in the last 10 mins looking into it

got pretty close but not 100%

Well that makes me feel a little bit better because I couldn't really figure it out

yeah, its complex because of the interactions

I can get the icons centered, but then on expansion, all the nav items are also centered

Yep, same thing I ran into

ah maybe this is it - for menu-top and menu-bottom, try increasing the padding to center it.

I was just doing that

so yeah, I guess it was simple actually haha

we were just over thinking it! Not a surprise for me

Add a reply
Sign up and join the conversation on Slack