ShadCn.Blazor.Components 1.0.37

dotnet add package ShadCn.Blazor.Components --version 1.0.37
                    
NuGet\Install-Package ShadCn.Blazor.Components -Version 1.0.37
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ShadCn.Blazor.Components" Version="1.0.37" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ShadCn.Blazor.Components" Version="1.0.37" />
                    
Directory.Packages.props
<PackageReference Include="ShadCn.Blazor.Components" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ShadCn.Blazor.Components --version 1.0.37
                    
#r "nuget: ShadCn.Blazor.Components, 1.0.37"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ShadCn.Blazor.Components@1.0.37
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ShadCn.Blazor.Components&version=1.0.37
                    
Install as a Cake Addin
#tool nuget:?package=ShadCn.Blazor.Components&version=1.0.37
                    
Install as a Cake Tool

ShadCn.Blazor

ShadCn.Blazor is a Blazor component library inspired by shadcn/ui. It provides accessible, customizable, open source UI components for Blazor WebAssembly and Blazor Server, with a default theme driven by CSS variables. Components are pure Blazor and require no JavaScript/JS interop at runtime.

Live Documentation

Highlights

  • Built for .NET 8+ and both Blazor WebAssembly and Blazor Server.
  • No JavaScript/JS interop required at runtime.
  • Single package install.
  • Dark mode support via a dark class on the html element.
  • Easy customization through CSS variables and a Class parameter on components.

Prerequisites

  • .NET 8.0 or later
  • Blazor WebAssembly or Blazor Server project

Installation

1) Install NuGet package

dotnet add package ShadCn.Blazor.Components

Package Manager Console:

Install-Package ShadCn.Blazor.Components

2) Add the theme CSS

Add this to index.html (WebAssembly) or _Host.cshtml / App.razor (Server):

<link rel="stylesheet" href="_content/ShadCn.Blazor.Theme.Default/theme.css" />

The theme uses CSS variables for colors. Values are in HSL format without the hsl() wrapper.

3) Register services

Add this to Program.cs:

builder.Services.AddShadCnBlazorComponents();

Add using ShadCn.Blazor.Components; if needed.

4) Add component imports

Add component namespaces to your _Imports.razor:

@using ShadCn.Blazor.Components
@using ShadCn.Blazor.Components.Alert
@using ShadCn.Blazor.Components.Badge
@using ShadCn.Blazor.Components.Button
@using ShadCn.Blazor.Components.Card
@using ShadCn.Blazor.Components.Input
@using ShadCn.Blazor.Components.Separator

5) Use components

<Button>Click me</Button>

<Card>
    <CardHeader>
        <CardTitle>Welcome</CardTitle>
        <CardDescription>Get started with ShadCn.Blazor</CardDescription>
    </CardHeader>
    <CardContent>
        <p>Your content here</p>
    </CardContent>
</Card>

Dark mode

Add the dark class to your html element:

<html class="dark">
  ...
</html>

You can toggle dark mode by adding/removing the class (for example via JavaScript or a persisted user preference).

Customization

All components accept a Class parameter for additional Tailwind CSS classes:

<Button Class="w-full">Full Width Button</Button>
<Card Class="max-w-md mx-auto">...</Card>

Override colors by redefining the CSS variables in your own stylesheet (loaded after theme.css). Values use HSL format without the hsl() wrapper:

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;

  /* Sidebar (defaults inherit from the above) */
  --sidebar: var(--background);
  --sidebar-foreground: var(--foreground);
  --sidebar-primary: var(--primary);
  --sidebar-primary-foreground: var(--primary-foreground);
  --sidebar-accent: var(--accent);
  --sidebar-accent-foreground: var(--accent-foreground);
  --sidebar-border: var(--border);
  --sidebar-ring: var(--ring);
}

Override dark mode with .dark { ... }. Override fonts with @theme { --font-sans: ...; }.

Tip: use https://ui.shadcn.com/themes to generate color palettes, then copy the CSS variables into your project.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.37 1,722 3/18/2026
1.0.36 129 3/18/2026
1.0.35 137 3/17/2026
1.0.34 136 3/17/2026
1.0.33 141 3/17/2026
1.0.32 134 3/16/2026
1.0.31 130 3/13/2026
1.0.30 138 3/13/2026
1.0.29 125 3/13/2026
1.0.28 129 3/13/2026
1.0.27 131 3/13/2026
1.0.26 137 3/5/2026
1.0.25 132 3/4/2026
1.0.24 124 3/4/2026
1.0.23 126 3/4/2026
1.0.22 133 3/3/2026
1.0.21 121 3/3/2026
1.0.20 131 3/3/2026
1.0.19 132 3/3/2026
1.0.18 130 3/3/2026
Loading failed