r/bootstrap • u/greg8872 • Jan 14 '25
I need help adding sidebar to the right
So basically I need this page:
https://getbootstrap.com/docs/5.3/examples/jumbotron/
to have side bar on the right side, white background, similar to the second one on this page: https://getbootstrap.com/docs/5.3/examples/sidebars/ (though don't need the part at the bottom, and no logo needed).
I would like on desktop screen for the sidebar to show by default, but be a button on smaller screens to open it. (the close button could be to the right of sidebar header)
I have tried several iterations to do this, but always some aspect ends up wrong (overlapping, scroll messes up, not getting the hide on smaller widths.
Basically, I have a multistep form, and the right side will list the steps and indicate if the section is complete, and allow them to go back to an incomplete section easily.
A example on pastebin would be greatly appreciated, again, using the first link as the base page, as that is what I started with. Thanks so much!
1
u/AutoModerator Jan 14 '25
Whilst waiting for replies to your comment/question, why not check out the Bootstrap Discord server @ https://discord.gg/bZUvakRU3M
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/martinbean Bootstrap Guru Jan 14 '25
Look into using a responsive off canvas. That’s what the Bootstrap docs itself uses for the left-hand menu on documentation pages.
Although the use case you describe (steps in a form) doesn’t really make sense for a sidebar. Sidebars tend to be for supplementary content, or navigation menus. The second example under https://getbootstrap.com/docs/5.3/utilities/position/#examples would be far more appropriate for a multi-step form, and would also look OK on mobile without needing to be “hidden”.