Skip to content

extensedev/ShadowUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShadowUI

A port of shadcn/ui for Avalonia UI 12 / .NET. 50+ components · Light/Dark theme · 14 color palettes · Custom title bar · Native AOT compatible.

ShadowUI Gallery

Requirements

  • .NET 8 or .NET 10
  • Avalonia 12+

Installation

dotnet add package ShadowUI
<PackageReference Include="ShadowUI" Version="1.0.7" />

Getting Started

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>

Theming

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) → GraphiteAsh (progressively lighter dark backgrounds).
  • Deep dark: NearBlack (near-black #09090B with deep, low-lift elevated surfaces — darker than Charcoal).
  • Colored accents (Zinc surfaces + colored primary): Blue, Green, Violet, Rose, Orange.

Custom Title Bar

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>

Smooth Scrolling

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" />

Components

Base

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

Navigation & Overlays

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

Forms & Input

NumericUpDown, SearchableComboBox, OtpInput, InputGroup, ButtonGroup, Field, ColorPicker, SplitButton / ToggleSplitButton, DropDownButton, HyperlinkButton, RepeatButton, ButtonSpinner

Data & Tables

ShadowDataTable (sort, filter, pagination), ShadowPagination, Resizable, Table (base styles)

Content

Accordion, Alert (5 variants), AlertDialog, Breadcrumb, Collapsible, Expander, GroupBox, EmptyState, ShadowItem, SelectableTextBlock, HeaderedContentControl

Date & Time

ShadowCalendar (Single / Range), DatePicker

Visual & Charts

Carousel (prev/next + dot navigation), BarChart, LineChart, AreaChart, PieChart (donut)

Design Tokens

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

Documentation

Full component reference with code examples — docs/components.md.

Gallery

Run the interactive component gallery:

dotnet run --project samples/ShadowUI.Gallery/ShadowUI.Gallery.csproj

Native AOT

ShadowUI 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 Release

On Windows, Native AOT requires MSVC (C++ build tools). Run from Developer Command Prompt or add …\Microsoft Visual Studio\Installer to your PATH.

Build & Test

dotnet build ShadowUI.slnx -c Debug
dotnet test tests/ShadowUI.UnitTests/ShadowUI.UnitTests.csproj

License

MIT

About

shadcn/ui port for Avalonia UI — 50+ components, Light/Dark theme, Native AOT

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages