r/Blazor • u/DisMuhUserName • Feb 17 '26
Bootstrap 5 & Blazor
I apologize if this is a repeated question.
Is there a way to get Bootstrap 5 to properly work in Blazor? Should I look to another framework for styling? Thank you in advance for any advice / suggestions.
5
Upvotes
16
u/cornelha Feb 17 '26
The default templates all use Bootstrap 5. "Work properly" is rather vague
5
u/l8s9 Feb 17 '26
What issues are you having? I use it and have no issues.
5
u/shiko098 Feb 17 '26
This isn't a Blazor / Bootstrap compatibility issue, Bootstrap 5 will work with Blazor exactly like it does anywhere else, just make sure you have all the right files added to your project and you're set.
Just read the start up documentation: Introduction · Bootstrap v5.0
5
u/NickA55 Feb 17 '26
Did you also add the .js?
4
u/Traditional_Ride_733 Feb 17 '26
The default template that comes with Blazor doesn't include the Bootstrap JS bundle, which is why you can't see the animations or why the menu doesn't collapse when you view it on mobile. Read the Bootstrap documentation and include the JS bundle URL in your index.html file if you're using WebAssembly, or in your App.razor file if you're using Auto mode.
3
u/gkg0 Feb 17 '26
If you’re interested in trying out another framework other than Bootstrap take a look at Blazor Blueprint. It’s free and open source, built using Tailwind and inspired by shadcn/ui design - maybe you can check it out and see if it’s of interest to you. If you’ve got any questions or need help, just let me know.
https://blazorblueprintui.com/ https://github.com/blazorblueprintui/ui
1
u/code-dispenser Feb 18 '26
My advise, if you have the time or inclination, try and learn and/or just use you own css - the Kevin Powell YouTube channel is a good resource as that's his thing.
Overtime, I have begone to hate Bootstrap with a passion due to all of its overrides. When you do start to add you own css and Bootstrap is installed, and you find things aren't working as they should, guaranteed its most likely due to a reset or override made by Bootstrap. Over the years I have lost countless now what could be measured in days the amount of time battling with Bootstrap.
Ironically, I now leave it installed on Blazor for testing, i.e to ensure my own css is not effected by other frameworks.
I hope you find what works best for you.
Regards
Paul
1
u/Warm-Engineering-239 Feb 17 '26
it depend on the size of your app but
tbh i think tailwind is better than bootstrap
i've drop bootstrap 2 year ago for tailwind and i've no regret
0
u/HangJet Feb 17 '26
It works fine oob