This quick start uses ShellUI 0.4.0-alpha.3, a prerelease, with Tailwind CSS 4.3.2. The CLI runs on .NET 8 or later and works in Blazor projects on .NET 8, 9 and 10.
- .NET 8 SDK or later
- A Blazor project
- The
ShellUI.CLItool - Node.js and npm only when choosing
--tailwind npm
Check the SDK with:
dotnet --versionA global tool is invoked as shellui:
dotnet tool install -g ShellUI.CLI --version 0.4.0-alpha.3
shellui --versionIf the project has a .NET tool manifest, use dotnet shellui instead. See CLI installation.
dotnet new blazor -n MyBlazorApp
cd MyBlazorApp
shellui init --yes --tailwind standaloneinit detects the project type and sets up:
Components/UI/wwwroot/input.cssandwwwroot/app.csstailwind.config.jsBuild/ShellUI.targetsshellui.jsonComponents/_Imports.razorwhen it is present- The host file used by the project
Standalone mode downloads Tailwind 4.3.2 once per machine, into ~/.shellui/bin, and does not require Node.js. To use npm instead:
shellui init --yes --tailwind npmnpm mode requires Node.js and npm. The current CLI invokes npm through cmd, so use standalone mode on non-Windows systems or run the npm commands manually.
Add one target, several space-separated targets, or comma-separated targets:
shellui add button
shellui add button input card
shellui add button,input,cardDependencies are copied automatically. Use --force to overwrite an existing component source file:
shellui add button --forceUse the exact names shown by shellui list. There are 93 direct targets; dependency-only registry entries are not direct targets.
After init, the project imports YourProject.Components.UI. For a project named MyBlazorApp:
@using MyBlazorApp.Components.UI
<Card Class="max-w-md">
<h2 class="text-lg font-semibold">Welcome</h2>
<Input Placeholder="Enter your email" Type="email" />
<Button>Click me</Button>
</Card>card installs its component parts automatically. button and input are separate targets, so add them explicitly when using them.
Edit wwwroot/input.css, not the generated wwwroot/app.css. The current v4 input begins with:
@import "tailwindcss";
@custom-variant dark (&:is(.dark *));
:root {
--primary: oklch(0.55 0.22 264.53);
--primary-foreground: oklch(1 0 0);
}
@theme inline {
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
}For an npm-based Tailwind workflow, use the v4 CLI package:
npm install -D tailwindcss@^4.3.2 @tailwindcss/cli@^4.3.2
npx @tailwindcss/cli -i ./wwwroot/input.css -o ./wwwroot/app.css --watchshellui init --tailwind npm --yes performs the package installation and creates the build integration. A normal build also runs Tailwind:
dotnet buildshellui list
shellui list --installed
shellui list --available
shellui update button
shellui update button card
shellui update --all
shellui remove button cardupdate rewrites the selected source files and skips any you have changed (use --force to overwrite those). Commit before running it.
remove accepts component names separated by spaces and has no options. It removes the named files, but it does not perform reverse-dependency cleanup. For layout blocks such as dashboard-02, remove lists the files that still use the layout. Check references before removing a component that another component may use.
The CLI supports tweakcn themes:
shellui theme init <url-or-id> --yes --tailwind standalone
shellui theme apply <url-or-id>
shellui theme apply <url-or-id> --emit-override wwwroot/theme.css
shellui theme updatetheme apply updates wwwroot/input.css by default and writes shellui.theme.lock. Use --emit-override for a separate CSS file. Run theme update from the project root to re-fetch the recorded theme.
- Use
shelluifor a global tool anddotnet shelluifor a local manifest. - Run
shellui listto verify a target name. - Check that
wwwroot/input.csscontains@import "tailwindcss";. - Check
~/.shellui/binfor standalone mode or runnpm installfor npm mode. - Run
dotnet buildto invoke the generated Tailwind target.