Skip to content

Getting started

Prerequisites

  • .NET 10 SDK (the RCL targets net10.0)
  • Node.js + npm (Tailwind build for wwwroot/css/app.css)

Scaffold

dotnet new install <installer-package-or-path>
dotnet new connectsoft-blazor-component-library -n Acme.Ui

Useful options (see parameters for the full list):

# Minimal library: no gallery, no sample Box primitive
dotnet new connectsoft-blazor-component-library -n Acme.Ui --include-gallery false --include-sample-content false

# Keep tests, target net9.0 moniker
dotnet new connectsoft-blazor-component-library -n Acme.Ui -f net9.0

First build

cd Acme.Ui
npm install            # restores Tailwind toolchain for the RCL
dotnet build
dotnet test            # if --include-tests (MSTest + bUnit)

When generated with --include-gallery:

dotnet run --project samples/Acme.Ui.Gallery

Consume the library

Reference the RCL plus exactly one theme adapter, then register it:

// Program.cs of a consuming Blazor host
builder.Services.AddFlowbiteTheme();   // or AddTokensTheme() / AddDaisyUITheme()

Include the token CSS and compiled stylesheet from the RCL static web assets in your host layout (_content/Acme.Ui/...).

Pack to NuGet

dotnet pack src/Acme.Ui -c Release

See also