## ShellUI Native This project uses ShellUI Native. Before writing code that uses it, read https://native.shellui.dev/llms.txt: it lists every docs page with its install command. Every page is also available as Markdown at its URL plus `.md`, for example https://native.shellui.dev/docs/introduction.md. ### Rules for AI agents Read these before writing UI in a ShellUI Native project (.NET MAUI or Avalonia 12). 1. **Use ShellUI Native's components; don't write your own.** Before building a button, input, dialog, sheet, dropdown, select, table, sidebar or any other UI element, check whether ShellUI Native has it. `llms.txt` lists every component with its `shellui-native add` command. 2. **Check what the project already has.** - `shellui-native.json` next to the `.csproj` means the project uses ShellUI Native. `InstalledComponents` lists what's installed and `ComponentsPath` says where (default `Components/UI`). - `shellui-native list --installed` and `shellui-native list --available` print the same from the terminal. - No `shellui-native.json`: run `shellui-native init --yes` in the folder with the `.csproj` first. It detects MAUI or Avalonia and installs `Shell.cs`, which every component needs. 3. **Install a missing component; never recreate it.** Run `shellui-native add `, or several at once: `shellui-native add button card dialog`. Don't hand-write a file with a ShellUI Native component's name, port one from shadcn/ui (React) or ShellUI for Blazor, or build a look-alike in another folder. `add` also installs the parts and helpers a component depends on. 4. **The project owns the source.** Installed components are ordinary C# files in `Components/UI`, in the `.Components.UI` namespace, and may be edited. There is no NuGet package to reference. `shellui-native update ` overwrites a file with the CLI's template, so commit edits first. 5. **Use the right platform's code.** Every page has a MAUI and an Avalonia example. Import the namespace as `xmlns:ui="clr-namespace:MyApp.Components.UI"` on MAUI and `xmlns:ui="using:MyApp.Components.UI"` on Avalonia, and use the `ui:` prefix. Where the platforms differ, the page says so under **MAUI and Avalonia**; layout members are the framework's own (`HorizontalOptions` on MAUI, `HorizontalAlignment` on Avalonia). 6. **Follow the API reference.** Each component page has property, event and method tables for both platforms. Variants and sizes are enum values written by name in XAML (`Variant="Destructive"`, `Size="Sm"`). Don't guess property names. 7. **Style with the theme tokens.** Colours come from `ShellTheme` resources: `{DynamicResource ShellUIBackground}` (a colour) or `{DynamicResource ShellUIBackgroundBrush}` (a brush), and likewise `Foreground`, `Primary`, `Muted`, `MutedForeground`, `Border`, `Card` and the rest. Use them instead of fixed colours so dark mode keeps working. Switch themes with `ShellTheme.SetTheme(...)`; call `Components.UI.ShellTheme.EnsureInitialized()` at startup. 8. **Declare overlays next to their trigger.** Dialogs, sheets, drawers, menus, popovers and tooltips draw in a page-level layer the components manage, so no host control is needed. Toasts are shown from code with `Toast.Show`; a `Toaster` is optional and only sets their position. 9. **Match the version.** `dotnet tool list -g` shows the installed `ShellUI.Native.CLI` version. Components marked **Next release** in these docs are on shellui-native's main branch and not in the released CLI yet.