A port of shadcn/ui for Avalonia UI 12 / .NET. 50+ components · Light/Dark theme · 14 color palettes · Custom title bar · Native AOT compatible.
- .NET 8 or .NET 10
- Avalonia 12+
dotnet add package ShadowUI<PackageReference Include="ShadowUI" Version="1.0.7" />1. Add the theme to your App.axaml:
<Application xmlns="https://github.com/avaloniaui"
xmlns:shadowui="using:ShadowUI"
RequestedThemeVariant="Dark">
<Application.Styles>
<!-- Charcoal (recommended default); any of the 14 palettes: Zinc, Slate, Blue, Violet, ... -->
<shadowui:ShadowUITheme BaseColor="Charcoal" />
</Application.Styles>
</Application>2. Add the namespace to your views:
<Window xmlns:shadowui="using:ShadowUI" ...>3. Use components:
<shadowui:Card>
<StackPanel Spacing="8">
<shadowui:CardTitle Content="Welcome" />
<shadowui:CardDescription Content="Get started with ShadowUI." />
<Button Content="Save" />
<Button Classes="secondary" Content="Cancel" />
</StackPanel>
</shadowui:Card>Switch theme at runtime:
Application.Current!.RequestedThemeVariant = ThemeVariant.Dark;Switch color palette at runtime:
var theme = Application.Current!.Styles.OfType<ShadowUITheme>().First();
theme.BaseColor = BaseColor.Slate;14 palettes (BaseColor):
- Neutrals:
Zinc,Slate(cool),Stone(warm),Gray(cool, Tailwind gray),Neutral(true gray). - Lifted darks:
Charcoal(default) →Graphite→Ash(progressively lighter dark backgrounds). - Deep dark:
NearBlack(near-black#09090Bwith deep, low-lift elevated surfaces — darker than Charcoal). - Colored accents (Zinc surfaces + colored primary):
Blue,Green,Violet,Rose,Orange.
TitleBar replaces the native window chrome with a shadcn-style bar while keeping
the native Windows 11 minimize / maximize / close animations, snap and resize borders:
<DockPanel>
<shadowui:TitleBar DockPanel.Dock="Top"
Title="My App"
ShowMaximize="True">
<shadowui:TitleBar.Icon>
<Image Source="/Assets/logo.png" />
</shadowui:TitleBar.Icon>
</shadowui:TitleBar>
<!-- window content -->
</DockPanel>Everything is optional and removable:
| Property | Default | Purpose |
|---|---|---|
Title / ShowTitle |
null / true |
title text; ShowTitle="False" hides it |
Icon / IconSize |
null / 16 |
app icon (any visual); hidden when not set |
ShowMinimize / ShowMaximize / ShowClose |
true |
toggle individual window buttons |
RightContent |
null |
custom controls next to the window buttons |
Custom icon buttons that match the built-in ones — use the TitleBarButton theme:
<shadowui:TitleBar Title="My App">
<shadowui:TitleBar.RightContent>
<Button Theme="{StaticResource TitleBarButton}"
Width="46" Height="40"
Click="OnSettingsClick">
<!-- any 16x16 icon -->
</Button>
</shadowui:TitleBar.RightContent>
</shadowui:TitleBar>All ScrollViewers get inertial smooth scrolling out of the box. Opt out or tune per viewer:
<ScrollViewer shadowui:SmoothScrollAssist.IsEnabled="False" />
<ScrollViewer shadowui:SmoothScrollAssist.BaseStepSize="100"
shadowui:SmoothScrollAssist.SmoothingFactor="14" />Button (default secondary destructive outline ghost link + icon), Badge (+ success/warning/info), Card, Separator, Label,
TextBox / Textarea, CheckBox, Switch, RadioButton, Toggle, ToggleGroup, Slider,
ProgressBar, Avatar, Skeleton, Kbd, Tooltip, AspectRatio, Spinner, ColorPicker
Tabs (underline / legacy / large), TabStrip, ComboBox (Select), MultiSelectComboBox, Popover (Flyout), Menu / DropdownMenu / ContextMenu, NavigationMenu, Menubar, HoverCard, TreeView, SplitView, Sidebar (icon-collapsed mode, expandable groups), TitleBar (custom window title bar), Dialog, AlertDialog, Toast / Notifications (Sonner-style stacking, 6 positions, 5 types), CommandPalette (⌘K, fuzzy search, keyboard nav), Sheet / Drawer, ScrollBar
NumericUpDown, SearchableComboBox, OtpInput, InputGroup, ButtonGroup, Field, ColorPicker, SplitButton / ToggleSplitButton, DropDownButton, HyperlinkButton, RepeatButton, ButtonSpinner
ShadowDataTable (sort, filter, pagination), ShadowPagination, Resizable, Table (base styles)
Accordion, Alert (5 variants), AlertDialog, Breadcrumb, Collapsible, Expander, GroupBox, EmptyState, ShadowItem, SelectableTextBlock, HeaderedContentControl
ShadowCalendar (Single / Range), DatePicker
Carousel (prev/next + dot navigation), BarChart, LineChart, AreaChart, PieChart (donut)
Key DynamicResource brushes for custom markup:
| Key | Purpose |
|---|---|
ShadowBackgroundBrush / ShadowForegroundBrush |
background / text |
ShadowPrimaryBrush / ShadowPrimaryForegroundBrush |
primary accent |
ShadowMutedBrush, ShadowAccentBrush |
secondary surfaces |
ShadowDestructiveBrush, ShadowSuccessBrush, ShadowWarningBrush, ShadowInfoBrush |
semantic status |
ShadowBorderBrush, ShadowInputBrush |
borders / inputs |
ShadowSidebarBrush, ShadowSidebarForegroundBrush |
sidebar surfaces |
ShadowRadiusSm / ShadowRadiusMd / ShadowRadiusLg / ShadowRadiusXl |
corner radii |
ShadowShadowXs / ShadowShadowSm / ShadowShadowMd |
box shadows |
Full component reference with code examples — docs/components.md.
Run the interactive component gallery:
dotnet run --project samples/ShadowUI.Gallery/ShadowUI.Gallery.csprojShadowUI is fully Native-AOT compatible: compiled bindings everywhere, no reflection, palettes instantiated via generated types.
dotnet publish tests/ShadowUI.AotSmokeTest/ShadowUI.AotSmokeTest.csproj -r win-x64 -c ReleaseOn Windows, Native AOT requires MSVC (C++ build tools). Run from Developer Command Prompt or add
…\Microsoft Visual Studio\Installerto yourPATH.
dotnet build ShadowUI.slnx -c Debug
dotnet test tests/ShadowUI.UnitTests/ShadowUI.UnitTests.csproj