# Flowbite Blazor WASM .NET Template Documenation
## Overview
This .NET Template is based off of the .NET 8.0 Blazor WASM Standalonde template but has been
enhanced as follows:
- Use the tailwindcss-based Flowbite Blazor UI library for all of its Layout, Componets, and Icons
- Executes the tailwind standalone executable process the tailwind configuration
- When publishing, the BlazorWasmPreRendering.Build is used to generate the static HTML for the side to be
To quickly scaffold a new project using the using the CLI. The following project types include:
### Scaffold a Blazor WebAssembly Standalone App
- __For Window Platform:__
```powershell
dotnet new install Flowbite.Blazor.Templates
dotnet new flowbite-blazor-wasm -o {{PROJECT_NAME}};
cd {{PROJECT_NAME}}
mkdir .\tools -Force
cd .\tools
Invoke-WebRequest -Uri https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-windows-x64.exe -OutFile tailwindcss.exe -UseBasicParsing
cd ..
dotnet build
```
- __For Mac OSX Arm64:__
```zsh
dotnet new install Flowbite.Blazor.Templates
dotnet new flowbite-blazor-wasm -o {{PROJECT_NAME}};
cd {{PROJECT_NAME}}
mkdir ./tools
cd ./tools
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-macos-arm64
chmod +x tailwindcss-macos-arm64
mv tailwindcss-macos-arm64 tailwindcss
cd ..
dotnet build
```
## Project Structure
{{PROJECT_NAME}}
├── App.razor
├── Components
│ └── AppVersion.razor
├── Layout
│ ├── AppFooter.razor
│ ├── AppNavBar.razor
│ ├── AppSidebar.razor
│ └── MainLayout.razor
├── {{PROJECT_NAME}}.csproj
├── {{PROJECT_NAME}}.sln
├── Pages
│ ├── Counter.razor
│ ├── Home.razor
│ ├── Icons.razor
│ └── Weather.razor
├── Program.cs
├── Properties
│ └── launchSettings.json
├── README.md
├── _Imports.razor
├── postcss.config.js
├── tailwind.config.js
└── wwwroot
├── css
│ ├── app.css
│ └── app.min.css
├── favicon.png
├── index.html
├── js
│ └── app.js
└── sample-data
└── weather.json
## Important File Contents
### {{PROJECT_NAME}}.csproj
```xml
net8.0enableenabletruefalsepostcss.config.jstailwind.config.js0.0.1-alpha.1truetrue
```
### Program.cs
```csharp
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using PROJECT_NAME;
using Flowbite.Services;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add("#app");
builder.RootComponents.Add("head::after");
// Required for prerendering (BlazorWasmPreRendering.Build)
ConfigureServices(builder.Services, builder.HostEnvironment.BaseAddress);
await builder.Build().RunAsync();
// Required for prerendering (BlazorWasmPreRendering.Build)
// extract the service-registration process to the static local function.
static void ConfigureServices(IServiceCollection services, string baseAddress)
{
services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(baseAddress) });
services.AddFlowbite();
}
```
### wwwroot/index.html
```html
PROJECT_NAME
@code
{
///
/// Boolean parameter to determine if the header shows the collapsible menu
///
[Parameter]
public bool ResponsiveMenuEnabled { get; set; } = true;
///
/// Event callback that fires when the responsive menu toggle button is clicked
///
[Parameter]
public EventCallback OnResponsiveMenuToggle { get; set; }
///
/// Boolean parameter to determine if the responsive menu is open
///
[Parameter]
public bool IsOpen { get; set; }
}
```
### Layout/AppSidebar.razor
```razor
@using Microsoft.AspNetCore.Components.Routing