Nifty XAML
Format XAML like XAML Styler, go to StaticResource definitions, rename keys, jump to code-behind handlers, pick #AARRGGBB colors and see Grid rows on hover, for WPF, WinUI, MAUI and Avalonia.
Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.
Features



The XAML help that Visual Studio and Rider have, in VS Code, VSCodium, Cursor and the other forks. It works for WPF, WinUI, UWP, .NET MAUI, Xamarin.Forms and Avalonia (.axaml). No language server and no .NET install are needed.
- Format like XAML Styler. Format Document orders attributes (
x:Class, then namespaces, then x:Key/x:Name, then Grid position and size, then layout, then everything else, with designer attributes last). Elements with more than two attributes get one attribute per line, lined up under the first. Empty elements collapse to <Grid />. Blank lines you left between elements stay, text content keeps its exact whitespace, and xml:space="preserve" is left alone. Broken XAML is never touched.
- Go to definition for resources. Ctrl+click
{StaticResource PrimaryButton}, {DynamicResource} or {ThemeResource} to jump to its x:Key, in any XAML file in the workspace. ElementName= and {x:Reference} go to the x:Name.
- Event handlers. Ctrl+click
Click="OnSave" to open the method in the C#, VB or F# code-behind. F7 switches between MainWindow.xaml and MainWindow.xaml.cs.
- Complete resource keys after
{StaticResource , showing where each one is defined, and element names after ElementName=. Keys that fit the property come first: brushes for Background or Foreground, styles for Style (styles for that very element on top), control templates for Template, data templates for ItemTemplate, thicknesses for Margin, and so on, also inside a Setter. The other keys are still listed, further down.
- Hover a resource to see its definition and file. Hover
Grid.Row="2" to see which RowDefinition it lands in, including Avalonia's RowDefinitions="Auto,*", and a note when the row doesn't exist.
- Rename a key or name (F2) and every
{StaticResource} that uses it is updated across the workspace. Find All References works too.
- Color picker for XAML colors. XAML puts alpha first (
#80FF0000 is half-transparent red), and the swatches and picker do the same.
- Outline and breadcrumbs show the element tree with each element's
x:Name or x:Key.
- Unknown resource keys (optional): report
{StaticResource} keys that no file in the workspace defines.
- Works in the browser on vscode.dev and github.dev.
Commands
| Command |
Key |
What it does |
Nifty XAML: Switch Between XAML and Code-Behind |
F7 |
Open .xaml.cs from .xaml, and back |
Formatting, go to definition, rename and references use the editor's usual commands and keys.
Settings
| Setting |
Default |
What it does |
nifty.xaml.format.enable |
true |
Format XAML files |
nifty.xaml.format.maxAttributesOnOneLine |
2 |
Wrap attributes when an element has more |
nifty.xaml.format.maxLineLength |
0 |
Also wrap when a start tag is longer than this (0 = off) |
nifty.xaml.format.firstAttributeOnSameLine |
true |
Keep the first attribute next to the element name |
nifty.xaml.format.sortAttributes |
true |
Order attributes |
nifty.xaml.format.attributeOrder |
XAML Styler's groups |
Groups of attribute names; * is everything else |
nifty.xaml.format.collapseEmptyElements |
true |
Write <Grid></Grid> as <Grid /> |
nifty.xaml.colorPicker |
true |
Color swatches for #AARRGGBB |
nifty.xaml.unknownResources |
off |
information, warning or error for undefined keys |
nifty.xaml.ignoredResourceKeys |
[] |
Keys from the framework or packages, e.g. MaterialDesign* |
nifty.xaml.exclude |
bin, obj, node_modules |
Files left out of the resource index |
If you also use another XML formatter, pick Nifty XAML for XAML files with Format Document With… → Configure Default Formatter.
Install
- VS Code: search for "Nifty XAML" in the Extensions view, or install from the Visual Studio Marketplace.
- Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.
Privacy
This extension collects no telemetry and needs no account.
- Nifty HCL Tools: .tf and .hcl Language Support: Fast, lightweight Terraform and OpenTofu support: highlighting, outline, go to definition and references across a module, hovers, completion, undefined-reference errors and formatting. (Open VSX)
- Nifty Java Quality: Format, Checkstyle & PMD: Format Java with google-java-format or palantir-java-format, and see Checkstyle and PMD problems as you save. Tools download from Maven Central when you say so; zero setup for Maven and Gradle. (Open VSX)
- Nifty Markdown: TOC, Lists, Shortcuts & Paste: Markdown editing that keeps up: table of contents, section numbers, smart lists and task toggles, formatting keys, image paste, link checks and completions, and math in the preview. (Open VSX)
- Nifty Nginx: nginx.conf Formatting & IntelliSense: nginx config support: syntax highlighting, formatting, directive completion and docs on hover, context checks, and snippets for reverse proxies, SSL and PHP. (Open VSX)
- Nifty PHP Quality: PHPStan, PHPCS & Pint: PHPStan, PHP_CodeSniffer, Laravel Pint and PHP-CS-Fixer in one extension: problems as you save, one Fix command, and zero setup when the tools are in your project's vendor/bin. (Open VSX)
- Nifty Shaders: GLSL, HLSL & WGSL Checks: GLSL, HLSL and WGSL: syntax colours, errors from glslangValidator and naga (bundled for WGSL, works on the web), #include links, hover docs, completion and outline. (Open VSX)
See all 100+ Nifty extensions and web tools at https://getnifty.dev
| |