Uno Material — Agent Skill
Consolidated reference for the Uno Material theme. For any deep dive (full key tables, code samples, version-specific gotchas), fetch the authoritative docs via the steps below; the inline tables here cover the most-asked-for facts for fast lookup.
Workflow
Docs lookup: call uno_platform_docs_search(...) first, then uno_platform_docs_fetch(sourcePath="…") using the sourcePath field from a result (a relative .md path; add the result's anchor for a section). Never pass a URL, a .html link, or a hand-built path.
Step 1: Pick the relevant topic and search the docs
| Topic |
Search query |
Installation / MaterialTheme / UnoFeatures |
uno_platform_docs_search("Uno Material installation MaterialTheme UnoFeatures") |
| Control styles (Button / TextBox / FAB / etc.) |
uno_platform_docs_search("Uno Material controls styles") |
| Color palette + brushes (MD3) |
uno_platform_docs_search("Uno Material colors brushes MD3 palette") |
| Typography / type scale |
uno_platform_docs_search("Uno Material typography type scale") |
| Lightweight styling (per-control overrides) |
uno_platform_docs_search("Uno Material lightweight styling resource keys") |
| Color customization / Theme Builder |
uno_platform_docs_search("Uno Material color customization Theme Builder DSP") |
| Font customization |
uno_platform_docs_search("Uno Material font customization font family override") |
| Control extensions (icons, elevation) |
uno_platform_docs_search("Uno Material control extensions icons elevation") |
| C# Markup with Material |
uno_platform_docs_search("Uno.Themes.WinUI.Markup C# Markup Material") |
| Version migration |
uno_platform_docs_search("Uno Material migration v1 v2 v3") |
Step 2: Fetch the canonical pages
- Material Getting Started:
external/uno.themes/doc/material-getting-started.md
- Material Toolkit Getting Started:
external/uno.toolkit.ui/doc/material-getting-started.md (use MaterialToolkitTheme for Toolkit+Material)
- Material Controls Styles:
external/uno.themes/doc/material-controls-styles.md
- Lightweight Styling:
external/uno.themes/doc/lightweight-styling.md
- Material Migration:
external/uno.themes/doc/material-migration.md
uno_platform_docs_fetch(sourcePath="…") # the sourcePath field from a search result above; never a URL/.html
Critical Rules
- Brushes use
{ThemeResource}, NOT {StaticResource} — so the bound color follows the active theme (Light / Dark) at runtime. <TextBlock Foreground="{ThemeResource PrimaryBrush}" />.
- Styles use
{StaticResource} — control styles don't change with the theme; their internal bindings already use ThemeResource for brushes.
- Use
MaterialToolkitTheme or MaterialTheme, not both — when using both Toolkit + Material, MaterialToolkitTheme replaces MaterialTheme + ToolkitResources. Mixing them double-loads resources.
Installation (quick reference)
In .csproj:
<UnoFeatures>Material</UnoFeatures> <!-- or Material;Toolkit -->
In App.xaml:
<ResourceDictionary.MergedDictionaries>
<MaterialTheme xmlns="using:Uno.Material" />
</ResourceDictionary.MergedDictionaries>
Use <MaterialToolkitTheme xmlns="using:Uno.Toolkit.Material" /> if also using Uno Toolkit.
Control Style Keys (quick reference)
Button
| Style key |
Use for |
FilledButtonStyle |
Default. Primary actions ("Save", "Submit") |
ElevatedButtonStyle |
Primary action with elevation/shadow |
FilledTonalButtonStyle |
Secondary action; softer than Filled |
OutlinedButtonStyle |
Secondary action with border |
TextButtonStyle |
Tertiary / low-emphasis action |
IconButtonStyle |
Icon-only action (pair with Icons.Icon attached property) |
FAB (FloatingActionButton; applied to Button)
| Style key family |
Sizes |
FabStyle / SmallFabStyle / LargeFabStyle |
Primary FAB |
SecondaryFabStyle / SecondarySmallFabStyle / SecondaryLargeFabStyle |
Secondary color |
TertiaryFabStyle / TertiarySmallFabStyle / TertiaryLargeFabStyle |
Tertiary color |
SurfaceFabStyle / SurfaceSmallFabStyle / SurfaceLargeFabStyle |
Surface color |
TextBox / PasswordBox
| Style key |
Notes |
FilledTextBoxStyle |
Material default for TextBox |
OutlinedTextBoxStyle |
Outlined variant |
FilledPasswordBoxStyle |
Material default for PasswordBox |
OutlinedPasswordBoxStyle |
Outlined variant |
Color Palette Keys (Layer 1)
Material follows the MD3 role system. 32 color keys with Light/Dark variants. Most-used role families:
- Primary:
PrimaryColor, OnPrimaryColor, PrimaryContainerColor, OnPrimaryContainerColor, PrimaryInverseColor
- Secondary:
SecondaryColor, OnSecondaryColor, SecondaryContainerColor, OnSecondaryContainerColor
- Tertiary:
TertiaryColor, OnTertiaryColor, TertiaryContainerColor, OnTertiaryContainerColor
- Error:
ErrorColor, OnErrorColor, ErrorContainerColor, OnErrorContainerColor
- Surface:
SurfaceColor, OnSurfaceColor, SurfaceVariantColor, OnSurfaceVariantColor, SurfaceInverseColor, OnSurfaceInverseColor, SurfaceTintColor
- Background / Outline / Shadow:
BackgroundColor, OnBackgroundColor, OutlineColor, OutlineVariantColor, ShadowColor
Pairing rule: every background role has a designated foreground role. PrimaryBrush ↔ OnPrimaryBrush. ErrorContainerBrush ↔ OnErrorContainerBrush. Don't mix unpaired colors. (See uno-themes-semantic-colors-brushes for the shared semantic surface common to Material + Simple.)
Brush System (Layer 2)
Each color key generates ~9 brush variants with opacity tokens. Pattern: {ColorRole}{StateVariant}Brush.
| Suffix |
Opacity |
Purpose |
| (none) |
1.0 |
Rest state |
Hover |
0.08 |
Pointer hover layer |
Focused |
0.12 |
Keyboard focus layer |
Pressed |
0.12 |
Active press layer |
Dragged |
0.16 |
Drag operation layer |
Selected |
0.08 |
Selected item layer |
Medium |
0.64 |
Medium-emphasis text/icons |
Low |
0.32 |
Low-emphasis text, placeholders |
Disabled |
0.12 |
Disabled state |
Total: ~288 brushes generated from the palette + opacity tokens.
Typography (Layer)
M3 type scale, used as TextBlock styles. Never theme-prefix typography keys — write DisplayLarge, not MaterialDisplayLarge.
| Family |
Keys |
| Display |
DisplayLarge, DisplayMedium, DisplaySmall |
| Headline |
HeadlineLarge, HeadlineMedium, HeadlineSmall |
| Title |
TitleLarge, TitleMedium, TitleSmall |
| Body |
BodyLarge, BodyMedium, BodySmall |
| Label |
LabelLarge, LabelMedium, LabelSmall, LabelExtraSmall |
| Caption |
CaptionLarge, CaptionMedium, CaptionSmall |
Each style exposes {StyleKey}FontFamily, FontSize, FontWeight resource keys for lightweight styling overrides.
Control Extensions
Material ships attached properties for icon, elevation, and toggle-content patterns (namespace using:Uno.Material.Controls):
Icons.Icon — adds an icon to a Button (esp. IconButtonStyle).
- Elevation extensions — apply MD3 elevation shadows; layered with
ShadowContainer for richer effects.
- Alternate content — display different content based on
ToggleButton.IsChecked.
Customization
Three escalating scopes:
- Palette override (full cascade) — override
*Color keys via ColorOverrideSource / ColorOverrideDictionary on MaterialTheme. All ~288 brushes and controls update automatically. Generate the palette XAML via Material Theme Builder (DSP format).
- Specific brush override (targeted) — drop a
<SolidColorBrush x:Key="FilledButtonBackground" Color="..." /> into App.xaml or scoped resources.
- Per-instance override (scoped) — wrap the override in the control's
Resources block.
Font override: set FontOverrideSource / FontOverrideDictionary on MaterialTheme, or override individual *FontFamily keys.
C# Markup
Use Uno.Themes.WinUI.Markup for fluent C# styling — .MaterialFilledButtonStyle(), .MaterialOutlinedTextBoxStyle(), etc. Resource keys exposed as constants under MaterialThemeResources.
new Button().Content("Save").MaterialFilledButtonStyle()
Migration
Between major versions, resource keys, converters, and style names can change. Fetch the migration page on upgrade:
uno_platform_docs_fetch(sourcePath="external/uno.themes/doc/material-migration.md")
Key checks: renamed resource keys, removed converters, NuGet package renames, UnoFeatures flag changes.
Related Skills
- [[uno-themes-semantic-colors-brushes]] — Shared semantic design language (style keys + typography + colors that work across Material AND Simple themes). Read this first if styling needs to be portable between themes.
- [[uno-themes-simple]] — Simple theme specifics. Use when targeting Simple (designer/wireframe look) or its theme-specific styles (danger buttons, size variants, utility brushes, PersonPicture, etc.).
- [[uno-toolkit-material-theme]] —
MaterialToolkitTheme setup for Toolkit + Material.
1---2name: uno-themes-material3description: Comprehensive reference for the Uno Material theme — Material Design 3 styling for Uno Platform apps. Covers installation, the MD3 color palette and brush system, semantic typography, control styles (buttons, FAB, TextBox), control extensions (icons, elevation), lightweight styling, color/font customization, and version migration.4---56# Uno Material — Agent Skill78Consolidated reference for the Uno Material theme. For any deep dive (full key tables, code samples, version-specific gotchas), fetch the authoritative docs via the steps below; the inline tables here cover the most-asked-for facts for fast lookup.910## Workflow1112> **Docs lookup:** call `uno_platform_docs_search(...)` first, then `uno_platform_docs_fetch(sourcePath="…")` using the `sourcePath` field from a result (a relative `.md` path; add the result's `anchor` for a section). Never pass a URL, a `.html` link, or a hand-built path.1314### Step 1: Pick the relevant topic and search the docs1516| Topic | Search query |17|---|---|18| Installation / `MaterialTheme` / `UnoFeatures` | `uno_platform_docs_search("Uno Material installation MaterialTheme UnoFeatures")` |19| Control styles (Button / TextBox / FAB / etc.) | `uno_platform_docs_search("Uno Material controls styles")` |20| Color palette + brushes (MD3) | `uno_platform_docs_search("Uno Material colors brushes MD3 palette")` |21| Typography / type scale | `uno_platform_docs_search("Uno Material typography type scale")` |22| Lightweight styling (per-control overrides) | `uno_platform_docs_search("Uno Material lightweight styling resource keys")` |23| Color customization / Theme Builder | `uno_platform_docs_search("Uno Material color customization Theme Builder DSP")` |24| Font customization | `uno_platform_docs_search("Uno Material font customization font family override")` |25| Control extensions (icons, elevation) | `uno_platform_docs_search("Uno Material control extensions icons elevation")` |26| C# Markup with Material | `uno_platform_docs_search("Uno.Themes.WinUI.Markup C# Markup Material")` |27| Version migration | `uno_platform_docs_search("Uno Material migration v1 v2 v3")` |2829### Step 2: Fetch the canonical pages3031- **Material Getting Started**: `external/uno.themes/doc/material-getting-started.md`32- **Material Toolkit Getting Started**: `external/uno.toolkit.ui/doc/material-getting-started.md` (use `MaterialToolkitTheme` for Toolkit+Material)33- **Material Controls Styles**: `external/uno.themes/doc/material-controls-styles.md`34- **Lightweight Styling**: `external/uno.themes/doc/lightweight-styling.md`35- **Material Migration**: `external/uno.themes/doc/material-migration.md`3637```38uno_platform_docs_fetch(sourcePath="…") # the sourcePath field from a search result above; never a URL/.html39```4041## Critical Rules4243- **Brushes use `{ThemeResource}`, NOT `{StaticResource}`** — so the bound color follows the active theme (Light / Dark) at runtime. `<TextBlock Foreground="{ThemeResource PrimaryBrush}" />`.44- **Styles use `{StaticResource}`** — control styles don't change with the theme; their internal bindings already use ThemeResource for brushes.45- **Use `MaterialToolkitTheme` or `MaterialTheme`, not both** — when using both Toolkit + Material, `MaterialToolkitTheme` replaces `MaterialTheme + ToolkitResources`. Mixing them double-loads resources.4647## Installation (quick reference)4849In `.csproj`:50```xml51<UnoFeatures>Material</UnoFeatures> <!-- or Material;Toolkit -->52```5354In `App.xaml`:55```xml56<ResourceDictionary.MergedDictionaries>57 <MaterialTheme xmlns="using:Uno.Material" />58</ResourceDictionary.MergedDictionaries>59```6061Use `<MaterialToolkitTheme xmlns="using:Uno.Toolkit.Material" />` if also using Uno Toolkit.6263## Control Style Keys (quick reference)6465### Button6667| Style key | Use for |68|---|---|69| `FilledButtonStyle` | **Default**. Primary actions ("Save", "Submit") |70| `ElevatedButtonStyle` | Primary action with elevation/shadow |71| `FilledTonalButtonStyle` | Secondary action; softer than Filled |72| `OutlinedButtonStyle` | Secondary action with border |73| `TextButtonStyle` | Tertiary / low-emphasis action |74| `IconButtonStyle` | Icon-only action (pair with `Icons.Icon` attached property) |7576### FAB (FloatingActionButton; applied to `Button`)7778| Style key family | Sizes |79|---|---|80| `FabStyle` / `SmallFabStyle` / `LargeFabStyle` | Primary FAB |81| `SecondaryFabStyle` / `SecondarySmallFabStyle` / `SecondaryLargeFabStyle` | Secondary color |82| `TertiaryFabStyle` / `TertiarySmallFabStyle` / `TertiaryLargeFabStyle` | Tertiary color |83| `SurfaceFabStyle` / `SurfaceSmallFabStyle` / `SurfaceLargeFabStyle` | Surface color |8485### TextBox / PasswordBox8687| Style key | Notes |88|---|---|89| `FilledTextBoxStyle` | **Material default** for TextBox |90| `OutlinedTextBoxStyle` | Outlined variant |91| `FilledPasswordBoxStyle` | **Material default** for PasswordBox |92| `OutlinedPasswordBoxStyle` | Outlined variant |9394## Color Palette Keys (Layer 1)9596Material follows the MD3 role system. 32 color keys with Light/Dark variants. Most-used role families:9798- **Primary**: `PrimaryColor`, `OnPrimaryColor`, `PrimaryContainerColor`, `OnPrimaryContainerColor`, `PrimaryInverseColor`99- **Secondary**: `SecondaryColor`, `OnSecondaryColor`, `SecondaryContainerColor`, `OnSecondaryContainerColor`100- **Tertiary**: `TertiaryColor`, `OnTertiaryColor`, `TertiaryContainerColor`, `OnTertiaryContainerColor`101- **Error**: `ErrorColor`, `OnErrorColor`, `ErrorContainerColor`, `OnErrorContainerColor`102- **Surface**: `SurfaceColor`, `OnSurfaceColor`, `SurfaceVariantColor`, `OnSurfaceVariantColor`, `SurfaceInverseColor`, `OnSurfaceInverseColor`, `SurfaceTintColor`103- **Background / Outline / Shadow**: `BackgroundColor`, `OnBackgroundColor`, `OutlineColor`, `OutlineVariantColor`, `ShadowColor`104105**Pairing rule**: every background role has a designated foreground role. `PrimaryBrush` ↔ `OnPrimaryBrush`. `ErrorContainerBrush` ↔ `OnErrorContainerBrush`. Don't mix unpaired colors. (See `uno-themes-semantic-colors-brushes` for the shared semantic surface common to Material + Simple.)106107## Brush System (Layer 2)108109Each color key generates ~9 brush variants with opacity tokens. Pattern: `{ColorRole}{StateVariant}Brush`.110111| Suffix | Opacity | Purpose |112|---|---|---|113| *(none)* | 1.0 | Rest state |114| `Hover` | 0.08 | Pointer hover layer |115| `Focused` | 0.12 | Keyboard focus layer |116| `Pressed` | 0.12 | Active press layer |117| `Dragged` | 0.16 | Drag operation layer |118| `Selected` | 0.08 | Selected item layer |119| `Medium` | 0.64 | Medium-emphasis text/icons |120| `Low` | 0.32 | Low-emphasis text, placeholders |121| `Disabled` | 0.12 | Disabled state |122123Total: ~288 brushes generated from the palette + opacity tokens.124125## Typography (Layer)126127M3 type scale, used as `TextBlock` styles. **Never theme-prefix typography keys** — write `DisplayLarge`, not `MaterialDisplayLarge`.128129| Family | Keys |130|---|---|131| Display | `DisplayLarge`, `DisplayMedium`, `DisplaySmall` |132| Headline | `HeadlineLarge`, `HeadlineMedium`, `HeadlineSmall` |133| Title | `TitleLarge`, `TitleMedium`, `TitleSmall` |134| Body | `BodyLarge`, `BodyMedium`, `BodySmall` |135| Label | `LabelLarge`, `LabelMedium`, `LabelSmall`, `LabelExtraSmall` |136| Caption | `CaptionLarge`, `CaptionMedium`, `CaptionSmall` |137138Each style exposes `{StyleKey}FontFamily`, `FontSize`, `FontWeight` resource keys for lightweight styling overrides.139140## Control Extensions141142Material ships attached properties for icon, elevation, and toggle-content patterns (namespace `using:Uno.Material.Controls`):143144- **`Icons.Icon`** — adds an icon to a `Button` (esp. `IconButtonStyle`).145- **Elevation extensions** — apply MD3 elevation shadows; layered with `ShadowContainer` for richer effects.146- **Alternate content** — display different content based on `ToggleButton.IsChecked`.147148## Customization149150Three escalating scopes:1511521. **Palette override (full cascade)** — override `*Color` keys via `ColorOverrideSource` / `ColorOverrideDictionary` on `MaterialTheme`. All ~288 brushes and controls update automatically. Generate the palette XAML via **Material Theme Builder** (DSP format).1532. **Specific brush override (targeted)** — drop a `<SolidColorBrush x:Key="FilledButtonBackground" Color="..." />` into App.xaml or scoped resources.1543. **Per-instance override (scoped)** — wrap the override in the control's `Resources` block.155156Font override: set `FontOverrideSource` / `FontOverrideDictionary` on `MaterialTheme`, or override individual `*FontFamily` keys.157158## C# Markup159160Use `Uno.Themes.WinUI.Markup` for fluent C# styling — `.MaterialFilledButtonStyle()`, `.MaterialOutlinedTextBoxStyle()`, etc. Resource keys exposed as constants under `MaterialThemeResources`.161162```csharp163new Button().Content("Save").MaterialFilledButtonStyle()164```165166## Migration167168Between major versions, resource keys, converters, and style names can change. Fetch the migration page on upgrade:169170```171uno_platform_docs_fetch(sourcePath="external/uno.themes/doc/material-migration.md")172```173174Key checks: renamed resource keys, removed converters, NuGet package renames, `UnoFeatures` flag changes.175176## Related Skills177178- [[uno-themes-semantic-colors-brushes]] — Shared semantic design language (style keys + typography + colors that work across Material AND Simple themes). Read this first if styling needs to be portable between themes.179- [[uno-themes-simple]] — Simple theme specifics. Use when targeting Simple (designer/wireframe look) or its theme-specific styles (danger buttons, size variants, utility brushes, PersonPicture, etc.).180- [[uno-toolkit-material-theme]] — `MaterialToolkitTheme` setup for Toolkit + Material.