Blazor/bootstrap basic samples & cheat sheet?

David Thielen 2,231 Reputation points
2023-03-01T20:15:14.21+00:00

Hi all - I'm new here and new to Blazor (I do have past experience with ASP.NET MVC programming). I have a getting started question:

For Blazor server side, are there any good cheat sheets, very basic sample templates, etc. For both Blazor and bootstrap as they're so inter-twined.

For example, I want to do a nav bar across the top. So a sample Blazor app that is nothing but a top nav bar and 3 views that only contain the text "View #1", etc.

Example 2, a Blazor app that implements authentication & authorization and has 2 simple views, one allowing any user and one allowing only admin users.

Example 3, a quick & easy way to find the appropriate bootstrap class(es) for any common need.

The list goes on and on... I'm hoping there's a combination of simple samples & cheat sheets that show the best practices for implementing an app.

My big worry is I get an app that works, but I have done things that will break on a Blazor or bootstrap update. I also worry when an answer on StackOverflow has 4 replies all strongly disagreeing with each other and each reply having comments saying that approach didn't work for others.

So any suggestions appreciated.

thanks - dave

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,116 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,371 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 54,621 Reputation points
    2023-03-02T17:08:59.4766667+00:00

    blazer is component based html render engine. it about responding to browser events, and modifying the html. it is not tied to bootstrap, just the sample templates use bootstrap because its popular. newer templates typically use less bootstrap.

    the docs cover authentication and authorization:

    https://learn.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-7.0

    bootstrap is one of many css frameworks. materialize (android style), tailwind, semantic ui, and office ui fabric core (for an office 365/online look).

    https://materializecss.com
    https://tailwindcss.com
    https://semantic-ui.com
    https://github.com/OfficeDev/office-ui-fabric-core

    once you pick a CSS framework, you will find lots of documentation on using the frameworks. Most are now SASS based, and require some html/css expertise.

    https://sass-lang.com

    0 comments No comments