# ShellUI Native > ShellUI Native is a shadcn/ui-style component library for .NET MAUI and Avalonia 12. Components are copied into your project as C# source files with the `shellui-native` CLI; every example has MAUI and Avalonia XAML. ## 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. --- # Introduction > Copy-and-own .NET MAUI and Avalonia components with the ShellUI design system. Source: https://native.shellui.dev/docs/introduction ShellUI Native brings the [shadcn/ui](https://ui.shadcn.com) approach to native .NET apps. It's the sibling of [ShellUI](https://shellui.dev) for Blazor: the same design, the same theme tokens, as plain C# controls for **.NET MAUI** and **Avalonia**. There's no component package to depend on. The `shellui-native` CLI copies each component into your project as a C# file, with everything it needs, and from then on the code is yours to read and change. > **Release status** > > `ShellUI.Native.CLI` **0.2.0-beta.1** is on NuGet and installs every component for both .NET MAUI and Avalonia. It's still a prerelease, so APIs can change. Components added since that release are marked **Next release** on their pages. ## How it works - **Copy and own.** `shellui-native add dialog` writes `Dialog.cs`, its parts and the helpers they use into `Components/UI`. Change anything: the next `add` won't overwrite it unless you pass `--force`. - **One design on two platforms.** Components keep the same names, properties and variants on MAUI and Avalonia, so a screen reads the same on both. Where a platform does something differently, the component's page says so under **MAUI and Avalonia**. - **Theme tokens.** Every colour is a token (`Background`, `Primary`, `Border`, …) mirroring ShellUI's CSS variables. `ShellTheme` swaps the light and dark palettes at runtime, and you can override any token. See [Theming](https://native.shellui.dev/docs/theming.md). - **No native chrome.** Selects, pickers, sliders and overlays are drawn by the components, so they look the same on Windows, macOS, Linux, Android and iOS. - **Keyboard and focus.** A focus ring for keyboard users, Enter and Space on triggers, Escape to close the overlay on top, and focus kept inside open dialogs. ## About these docs Each component page has a live preview and the code for **MAUI** and **Avalonia**. The previews are rendered with ShellUI for Blazor, which shares the design, so they look like the native component without being it. Pick your platform with the **MAUI | Avalonia** switch on any page; every example on the site follows, and your choice is remembered. ## Next steps - [Installation](https://native.shellui.dev/docs/installation.md): Install the CLI and set up a MAUI or Avalonia project. - [Components](https://native.shellui.dev/docs/components.md): Browse all 81 components by category. - [Theming](https://native.shellui.dev/docs/theming.md): Tokens, light and dark mode, and custom colours. - [CLI](https://native.shellui.dev/docs/cli.md): Every command and option. --- # Installation > Install the CLI, initialise a MAUI or Avalonia project, and add your first component. Source: https://native.shellui.dev/docs/installation You need the **.NET 10 SDK** and a .NET MAUI or Avalonia 12 project. The same commands work in both: `init` detects which one it is, and `add` installs that platform's version of each component. **1. Install the CLI** ShellUI Native is a prerelease, so include `--prerelease`: ```bash dotnet tool install -g ShellUI.Native.CLI --prerelease ``` **2. Initialise your project** In the folder with your `.csproj`: ```bash shellui-native init --yes ``` `init` detects the platform from the project file, creates `Components/UI`, installs `Shell.cs` (the theme, focus ring and overlay helpers every component uses) and writes `shellui-native.json`. On MAUI it also writes `Resources/Styles/ShellUITheme.xaml`, the light palette as XAML resources for design-time previews. **3. Load the theme** Publish the theme tokens before the first page appears, so your own `{DynamicResource ShellUI*}` references resolve straight away (components also do it on first use): **MAUI** ```csharp // App.xaml.cs public App() { InitializeComponent(); Components.UI.ShellTheme.EnsureInitialized(); } ``` **Avalonia** ```csharp // App.axaml.cs public override void Initialize() { AvaloniaXamlLoader.Load(this); Components.UI.ShellTheme.EnsureInitialized(); } ``` **4. Add components** ```bash shellui-native add button input card ``` Names can be separated by spaces or commas. Adding a part (`dialog-trigger`) installs its whole family, and every component brings the helpers it depends on. **5. Use them in XAML** Import the namespace and use the components with the `ui:` prefix: **MAUI** ```xml ``` **Avalonia** ```xml ``` ## What you get ``` MyApp/ ├── Components/ │ └── UI/ │ ├── Shell.cs # theme, focus ring, overlays │ ├── Button.cs │ └── Variants/ │ └── ButtonVariants.cs ├── Resources/Styles/ShellUITheme.xaml # MAUI only └── shellui-native.json ``` Every file is plain C#. Commit them with your app and change them like any other code. ## Platform notes - **MAUI:** tested on Windows and Android. iOS and Mac Catalyst build but haven't been run on a device yet. - **Avalonia:** tested on Windows; the demo builds on Linux and macOS in CI. Components use Avalonia 12 and the Fluent theme. - **Long pages on Windows (MAUI):** a single page with hundreds of controls can hit WinUI's layout-pass limit. Split it into sections that load when shown. --- # Theming > Theme tokens, light and dark mode, and your own colours. Source: https://native.shellui.dev/docs/theming Every component takes its colours from **theme tokens** that mirror ShellUI's CSS variables (`--background`, `--primary`, `--border`, …). `ShellTheme`, in the `Shell.cs` that `init` installs, holds a light and a dark palette and publishes the active one as application resources, so switching theme repaints every component. ## Tokens | Token | Used for | |---|---| | `Background` / `Foreground` | Page and dialog surface, body text | | `Card` / `CardForeground` | Card surface | | `Popover` / `PopoverForeground` | Dropdown, popover and select panels | | `Primary` / `PrimaryForeground` | Default button, checked checkbox / switch / radio, progress fill | | `Secondary`, `Muted`, `Accent` (+ `*Foreground`) | Secondary button, tab list, skeleton, hover backgrounds | | `Destructive`, `Success`, `Warning`, `Info` (+ `*Foreground`) | Status variants: badge, alert, progress, labels | | `Border`, `Input`, `Ring` | Dividers, field borders, the focus ring | | `Overlay` | Dialog, drawer and sheet backdrop | | `Chart1` … `Chart5` | [Chart](https://native.shellui.dev/docs/components/charts.md) series, in order (ShellUI's `--chart-1` … `--chart-5`). | ## Using tokens in your XAML Each token is published as a colour, `ShellUI`, and a brush, `ShellUIBrush`: **MAUI** ```xml ``` **Avalonia** ```xml ``` In code, the `Token` extension binds a colour or brush property to a token, and keeps it in step when the theme changes: **MAUI** ```csharp myBorder.Token(Border.StrokeProperty, ShellToken.Border); ``` **Avalonia** ```csharp myBorder.Token(Border.BorderBrushProperty, ShellToken.Border); ``` ## Light and dark The theme follows the operating system until you pick one. Switch it from code, or drop a [Theme Toggle](https://native.shellui.dev/docs/components/utility/theme-toggle.md) on the page: **MAUI** ```csharp ShellTheme.SetTheme(AppTheme.Dark); ShellTheme.ToggleTheme(); ``` **Avalonia** ```csharp ShellTheme.SetTheme(ThemeVariant.Dark); ShellTheme.ToggleTheme(); ``` `ShellTheme.ThemeChanged` fires after every switch, and `ShellTheme.IsDarkMode` tells you which palette is active. ## Your own colours Change tokens before the first page loads, then publish them again: **MAUI** ```csharp ShellTheme.Light[ShellToken.Primary] = Color.FromArgb("#2563EB"); ShellTheme.Dark[ShellToken.Primary] = Color.FromArgb("#3B82F6"); ShellTheme.Apply(); ``` **Avalonia** ```csharp ShellTheme.Light[ShellToken.Primary] = Color.Parse("#2563EB"); ShellTheme.Dark[ShellToken.Primary] = Color.Parse("#3B82F6"); ShellTheme.Apply(); ``` Since `Shell.cs` is your code, you can also edit the palettes there directly. ## Android system bars On MAUI, set `ShellTheme.SyncSystemBars = true` before `EnsureInitialized()` to make Android's status and navigation bars follow the theme: the bars turn transparent over the page, their icons flip with light and dark, and dialog backdrops cover them. Also set `colorPrimary` and `colorPrimaryDark` in `Platforms/Android/Resources/values/colors.xml` to your background colour, so the splash screen doesn't flash the template's purple. --- # CLI > Every shellui-native command and option. Source: https://native.shellui.dev/docs/cli The CLI is a .NET global tool. Install or update it with: ```bash dotnet tool install -g ShellUI.Native.CLI --prerelease dotnet tool update -g ShellUI.Native.CLI --prerelease ``` Run every command from the folder that holds your project's `.csproj`. ## init Sets up ShellUI Native in the project: detects the platform, creates `Components/UI`, installs `Shell.cs` and writes `shellui-native.json`. On MAUI it also writes `Resources/Styles/ShellUITheme.xaml`. In a project that also uses ShellUI for Blazor (it has a `shellui.json`), the components go in `Components/Native` instead, so the two sets don't clash. The namespace follows the folder: `Components/UI` gives `YourApp.Components.UI`, `Components/Native` gives `YourApp.Components.Native`. ```bash shellui-native init [--yes] [--force] [--style default|minimal] ``` | Option | Description | |---|---| | `--yes` | Use the defaults without asking. | | `--force` | Initialise again in a project that's already set up. | | `--style` | `default` or `minimal`. Saved in `shellui-native.json`; it doesn't change the installed code yet. | ## add Copies components into `Components/UI`, with every component and helper they depend on. Adding a part, such as `dialog-trigger`, installs its whole family. The namespace in each file is replaced with your project's. ```bash shellui-native add [--force] ``` Separate names with spaces or commas: `shellui-native add button input card` or `shellui-native add button,input,card`. An unknown name gets suggestions: `shellui-native add donut` answers "Did you mean 'donut-chart'?". | Option | Description | |---|---| | `--force` | Overwrite components that are already installed (and your edits to them). | ## list Shows the components that have a template for the project's platform, with their category and whether they're installed. ```bash shellui-native list [--installed] [--available] ``` | Option | Description | |---|---| | `--installed` | Only installed components. | | `--available` | Only components that aren't installed yet. | ## remove Deletes each named component's file from `Components/UI` and drops it from `shellui-native.json`. Only that file goes: the parts and helpers it installed stay, since other components may use them. ```bash shellui-native remove ``` ## update Replaces installed components with the CLI's current templates. With no names, or with `--all`, it updates every installed component. Your edits to those files are overwritten, so commit first. ```bash shellui-native update shellui-native update --all ``` `add` never touches a file that's already in your project, so after updating the CLI a new component can land next to an older version of something it depends on. If it doesn't build, update that dependency: `date-range-picker` needs the current `calendar`, and `button-group` the current `button`. ## shellui-native.json `init` writes the project's configuration; `add` and `remove` keep `InstalledComponents` up to date. ```json { "Schema": "https://native.shellui.dev/schema.json", "Style": "default", "ComponentsPath": "Components/UI", "TargetPlatform": 1, "Theme": { "Enabled": true, "Style": "default", "SyncWithShellUI": true }, "InstalledComponents": [] } ``` --- # AI Agents > Point Claude Code, Cursor, Copilot and other coding agents at these docs, so they use ShellUI Native's components instead of writing their own. Source: https://native.shellui.dev/docs/ai-agents These docs are published for AI coding agents in the [llms.txt](https://llmstxt.org) format. An agent that reads them knows which components exist, how to install one with `shellui-native add`, and how each one is used on MAUI and on Avalonia, so it doesn't write its own versions. ## Set up your project Coding agents read an instructions file in the project root at the start of every session. Add ShellUI Native's rules to the one your agent reads: they tell it to use the components, check what's installed, and run `shellui-native add` for anything missing, and they link these docs. Each file is a `## ShellUI Native` section, so the commands append it to a file you already have, or create the file. **Claude Code** Claude Code reads `CLAUDE.md`. [Download CLAUDE.md](https://native.shellui.dev/agents/CLAUDE.md), or run this in the project root: ```bash curl -fsSL https://native.shellui.dev/agents/CLAUDE.md >> CLAUDE.md ``` **Cursor** Cursor reads rules from `.cursor/rules`. [Download shellui-native.mdc](https://native.shellui.dev/agents/shellui-native.mdc) into that folder, or run this in the project root: ```bash curl -fsSL --create-dirs -o .cursor/rules/shellui-native.mdc https://native.shellui.dev/agents/shellui-native.mdc ``` **GitHub Copilot** Copilot reads `.github/copilot-instructions.md`. [Download copilot-instructions.md](https://native.shellui.dev/agents/copilot-instructions.md) into `.github`, or run this in the project root: ```bash mkdir -p .github && curl -fsSL https://native.shellui.dev/agents/copilot-instructions.md >> .github/copilot-instructions.md ``` **Other agents** Codex and many other agents read `AGENTS.md`. [Download AGENTS.md](https://native.shellui.dev/agents/AGENTS.md), or run this in the project root: ```bash curl -fsSL https://native.shellui.dev/agents/AGENTS.md >> AGENTS.md ``` ## Or ask the agent Paste this into your agent to have it read the docs and set up the instructions file itself: ```text Read https://native.shellui.dev/llms.txt and follow its rules in this project. Then add the ShellUI Native section from https://native.shellui.dev/agents/AGENTS.md to the instructions file you read at startup (AGENTS.md, CLAUDE.md or .github/copilot-instructions.md), creating it if it doesn't exist. ``` For a one-off task, give it the docs with the task: ```text Read https://native.shellui.dev/llms.txt, then add a settings page with a form. ``` ## What agents can read | URL | Contents | |-----|----------| | [`/llms.txt`](https://native.shellui.dev/llms.txt) | Rules for agents, then every page of these docs with a one-line description and, for components, the `shellui-native add` command | | [`/llms-full.txt`](https://native.shellui.dev/llms-full.txt) | The rules and every page as Markdown in one file, with the MAUI and Avalonia code of every example | | Any page + `.md` | One page as Markdown, for example [`/docs/components/form/button.md`](https://native.shellui.dev/docs/components/form/button.md) | Every page also has a ⋯ menu next to its title: **Copy page** copies its Markdown, **View as Markdown** opens it, and **Open in Claude** and **Open in ChatGPT** start a chat that reads it. ## What the rules say - Look for an existing ShellUI Native component before building any UI element. - Check `shellui-native.json` (or `shellui-native list --installed`) for what the project has, and run `shellui-native add ` for what it doesn't. Never recreate a component or port one from shadcn/ui or ShellUI for Blazor. - Use the platform's own example and namespace import (MAUI or Avalonia), follow each page's API tables, and style with the theme tokens so dark mode works. --- # Components > Every ShellUI Native component, by category. Source: https://native.shellui.dev/docs/components Each page shows a live preview rendered with ShellUI for Blazor, which shares the design, and the code for MAUI and Avalonia. Where ShellUI for Blazor has no such component (Bottom Nav, Edge Menu), the preview is the Avalonia component itself, running in your browser. Pick your platform with the switch on any page; every example follows. Every component runs on both platforms. Components marked **Next release** are on the main branch of shellui-native and not in the CLI on NuGet (0.2.0-beta.1) yet. ## Form Buttons, inputs, pickers and the other controls that take input. | Component | Description | |---|---| | [Button](https://native.shellui.dev/docs/components/form/button.md) | Displays a button, with variants, sizes, an optional icon and a loading state. | | [Button Group](https://native.shellui.dev/docs/components/form/button-group.md) | Buttons joined into one control, with only the outer corners rounded. | | [Calendar](https://native.shellui.dev/docs/components/form/calendar.md) | A month grid for picking a day. | | [Checkbox](https://native.shellui.dev/docs/components/form/checkbox.md) | A checkbox with an optional label and an error state. | | [Combobox](https://native.shellui.dev/docs/components/form/combobox.md) | A select with a search field to filter its items. | | [Date Picker](https://native.shellui.dev/docs/components/form/date-picker.md) | A date field that opens a calendar under it. | | [Date Range Picker](https://native.shellui.dev/docs/components/form/date-range-picker.md) | A date field that picks a start and an end date from one calendar. | | [File Upload](https://native.shellui.dev/docs/components/form/file-upload.md) | A drop zone that opens the file picker and lists the files you picked. | | [Form](https://native.shellui.dev/docs/components/form/form.md) | Fields with a label, a description and an error message, stacked with even spacing. | | [Input](https://native.shellui.dev/docs/components/form/input.md) | A text field at the 40px form height, with error and password modes. | | [Input Group](https://native.shellui.dev/docs/components/form/input-group.md) | A text field with an icon, a short text or any view before or after the text. | | [Input OTP](https://native.shellui.dev/docs/components/form/input-otp.md) | A one-time-code field with a slot per character. | | [Label](https://native.shellui.dev/docs/components/form/label.md) | Text in the ShellUI type scale, with sizes, weights and colour variants. | | [Multi Select](https://native.shellui.dev/docs/components/form/multi-select.md) | A searchable select for several options, shown as chips. | | [Number Input](https://native.shellui.dev/docs/components/form/number-input.md) | A number field with decrement and increment buttons. | | [Radio Group](https://native.shellui.dev/docs/components/form/radio-group.md) | A set of options where only one can be checked. | | [Select](https://native.shellui.dev/docs/components/form/select.md) | Picks one item from a list that floats under its trigger. | | [Slider](https://native.shellui.dev/docs/components/form/slider.md) | Picks a value in a range by dragging, clicking the track or using the keyboard. | | [Switch](https://native.shellui.dev/docs/components/form/switch.md) | An on / off toggle with an optional label. | | [Tag Input](https://native.shellui.dev/docs/components/form/tag-input.md) | A text field that turns each entry into a removable tag. | | [Textarea](https://native.shellui.dev/docs/components/form/textarea.md) | A multi-line text field that grows with its content. | | [Time Picker](https://native.shellui.dev/docs/components/form/time-picker.md) | A time field that opens hour, minute and AM / PM columns. | | [Toggle](https://native.shellui.dev/docs/components/form/toggle.md) | A two-state button that stays pressed. | | [Toggle Group](https://native.shellui.dev/docs/components/form/toggle-group.md) | A row of toggles where one, or several, can be pressed. | ## Overlay Dialogs, sheets, menus and other content that floats above the page. | Component | Description | |---|---| | [Alert Dialog](https://native.shellui.dev/docs/components/overlay/alert-dialog.md) | A confirmation that requires a choice: no close button, and the backdrop doesn't dismiss it. | | [Context Menu](https://native.shellui.dev/docs/components/overlay/context-menu.md) | A menu that opens at the pointer on right-click, or on long-press on touch screens. | | [Dialog](https://native.shellui.dev/docs/components/overlay/dialog.md) | A modal window over the page, with a backdrop. | | [Drawer](https://native.shellui.dev/docs/components/overlay/drawer.md) | A panel that slides up from the bottom, with a grab handle. | | [Dropdown](https://native.shellui.dev/docs/components/overlay/dropdown.md) | A menu that floats under its trigger. | | [Hover Card](https://native.shellui.dev/docs/components/overlay/hover-card.md) | Rich content that floats under its trigger while the pointer is over either. | | [Popover](https://native.shellui.dev/docs/components/overlay/popover.md) | Rich content that floats next to its trigger. | | [Sheet](https://native.shellui.dev/docs/components/overlay/sheet.md) | A panel that slides in from an edge of the window. | | [Tooltip](https://native.shellui.dev/docs/components/overlay/tooltip.md) | A short hint shown while the pointer rests on a control. | ## Layout Cards, accordions and the containers that arrange content. | Component | Description | |---|---| | [Accordion](https://native.shellui.dev/docs/components/layout/accordion.md) | Stacked sections that expand and collapse, one or several at a time. | | [Aspect Ratio](https://native.shellui.dev/docs/components/layout/aspect-ratio.md) | Keeps its content at a fixed width-to-height ratio. | | [Card](https://native.shellui.dev/docs/components/layout/card.md) | A bordered container with header, content and footer parts. | | [Collapsible](https://native.shellui.dev/docs/components/layout/collapsible.md) | Shows and hides a section, animating its height. | | [Resizable](https://native.shellui.dev/docs/components/layout/resizable.md) | Panels side by side or stacked, with a divider you drag to resize them. | | [Scroll Area](https://native.shellui.dev/docs/components/layout/scroll-area.md) | A scrollable region with the platform's scrollbar. | | [Separator](https://native.shellui.dev/docs/components/layout/separator.md) | A thin line that divides content, horizontally or vertically. | | [Wrap Layout](https://native.shellui.dev/docs/components/layout/wrap-layout.md) | Lays its children out left to right and wraps them onto new rows. | ## Navigation Bars, menus, tabs and other ways to move between views. | Component | Description | |---|---| | [Bottom Nav](https://native.shellui.dev/docs/components/navigation/bottom-nav.md) | A mobile tab bar with icon tabs, short labels, badges and an optional raised action button. **Next release.** | | [Breadcrumb](https://native.shellui.dev/docs/components/navigation/breadcrumb.md) | The path to the current page, with a chevron between items. | | [Command](https://native.shellui.dev/docs/components/navigation/command.md) | A search field over a list of grouped commands, inline or as a command palette. | | [Edge Menu](https://native.shellui.dev/docs/components/navigation/edge-menu.md) | A handle on a screen edge that slides out a rail of tool tiles. **Next release.** | | [Link Card](https://native.shellui.dev/docs/components/navigation/link-card.md) | A clickable card with an icon, title and description. | | [Menubar](https://native.shellui.dev/docs/components/navigation/menubar.md) | A row of menus, like a desktop app's File, Edit and View. | | [Navbar](https://native.shellui.dev/docs/components/navigation/navbar.md) | A top bar with a brand, links and actions; the links collapse into a menu on narrow screens. | | [Navigation Menu](https://native.shellui.dev/docs/components/navigation/navigation-menu.md) | A row of top-level links for an app header, where an item can open a panel of links. | | [Pagination](https://native.shellui.dev/docs/components/navigation/pagination.md) | Previous / next and page numbers, with ellipses for long ranges. | | [Prev Next Nav](https://native.shellui.dev/docs/components/navigation/prev-next-nav.md) | Previous and next page links for the foot of a page. | | [Sidebar](https://native.shellui.dev/docs/components/navigation/sidebar.md) | An app sidebar with groups of items that collapses to a rail of icons. | | [Stepper](https://native.shellui.dev/docs/components/navigation/stepper.md) | A step-by-step flow with numbered steps and its own navigation. | | [Tabs](https://native.shellui.dev/docs/components/navigation/tabs.md) | A row of triggers that switches between panels. | | [Tree View](https://native.shellui.dev/docs/components/navigation/tree-view.md) | An expandable tree of rows, with selection. | ## Data Display Tables, avatars, badges and other ways to present data. | Component | Description | |---|---| | [Avatar](https://native.shellui.dev/docs/components/data-display/avatar.md) | A round image with initials, or a user icon, as the fallback. | | [Badge](https://native.shellui.dev/docs/components/data-display/badge.md) | A small pill for a status, count or tag. | | [Carousel](https://native.shellui.dev/docs/components/data-display/carousel.md) | Swipeable slides with arrows, dots, looping and auto-play. | | [Chat](https://native.shellui.dev/docs/components/data-display/chat.md) | A conversation panel with message bubbles, a typing indicator and a message box. | | [Data Table](https://native.shellui.dev/docs/components/data-display/data-table.md) | A table filled from a list, with a filter, sortable columns, row selection and pages. | | [Empty State](https://native.shellui.dev/docs/components/data-display/empty-state.md) | A placeholder for an empty list or screen, with an icon, text and actions. | | [Image Viewer](https://native.shellui.dev/docs/components/data-display/image-viewer.md) | A thumbnail that opens the image over the page, with zoom controls. | | [Kbd](https://native.shellui.dev/docs/components/data-display/kbd.md) | A keyboard key or shortcut hint. | | [Progress](https://native.shellui.dev/docs/components/data-display/progress.md) | A bar showing how far along a task is. | | [Stat Card](https://native.shellui.dev/docs/components/data-display/stat-card.md) | A dashboard metric with a trend and a short description. | | [Table](https://native.shellui.dev/docs/components/data-display/table.md) | A data table with a header, row hover and selection, and an optional caption. | | [Timeline](https://native.shellui.dev/docs/components/data-display/timeline.md) | A vertical list of events joined by a line. | ## Charts Drawn by the components in the theme's chart colours, with a legend, a tooltip and a grow-in animation. [How they work](https://native.shellui.dev/docs/components/charts.md). | Component | Description | |---|---| | [Bar Chart](https://native.shellui.dev/docs/components/charts/bar-chart.md) | Bars for each category, side by side, stacked or lying down. | | [Line Chart](https://native.shellui.dev/docs/components/charts/line-chart.md) | A line per series across the categories, smooth or straight. | | [Area Chart](https://native.shellui.dev/docs/components/charts/area-chart.md) | A line per series with the space under it filled, overlapping or stacked. | | [Pie Chart](https://native.shellui.dev/docs/components/charts/pie-chart.md) | Slices of a whole, as a pie or a donut with a value in the middle. | | [Radar Chart](https://native.shellui.dev/docs/components/charts/radar-chart.md) | A spoke per category around a ringed grid, and a filled shape per series. | | [Radial Chart](https://native.shellui.dev/docs/components/charts/radial-chart.md) | Concentric rings that fill towards a maximum, for progress towards goals. | ## Feedback Alerts, toasts, spinners and other status messages. | Component | Description | |---|---| | [Alert](https://native.shellui.dev/docs/components/feedback/alert.md) | A callout for a message that needs attention, with an icon per variant. | | [Callout](https://native.shellui.dev/docs/components/feedback/callout.md) | A highlighted note on a faint tint of its variant colour. | | [Skeleton](https://native.shellui.dev/docs/components/feedback/skeleton.md) | A pulsing placeholder shown while content loads. | | [Spinner](https://native.shellui.dev/docs/components/feedback/spinner.md) | A rotating loading indicator. | | [Toast](https://native.shellui.dev/docs/components/feedback/toast.md) | Sonner-style notifications that stack in a corner and dismiss themselves. | ## Utility Icons, the theme toggle and other building blocks. | Component | Description | |---|---| | [Copy Button](https://native.shellui.dev/docs/components/utility/copy-button.md) | Copies text to the clipboard and confirms with a check mark. | | [Icon](https://native.shellui.dev/docs/components/utility/icon.md) | Lucide stroke icons drawn as native shapes, tinted by theme tokens. | | [Theme Toggle](https://native.shellui.dev/docs/components/utility/theme-toggle.md) | A button that switches between light and dark mode. | --- # Button > Displays a button, with variants, sizes, an optional icon and a loading state. Source: https://native.shellui.dev/docs/components/form/button ## Installation ```bash shellui-native add button ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `button-variants`. ## Usage ### Variants **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=button-variants) ### Sizes **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=button-sizes) ### With an icon `Icon` takes any name from the icon set; `IconPosition` puts it before or after the text. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=button-icon) ### Loading and disabled While `IsLoading` is true the button shows a spinner and ignores clicks. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=button-loading) ## Events Handle `Clicked`. It fires for a click, a tap, and Enter or Space while the button has keyboard focus. ```csharp SaveButton.Clicked += async (_, _) => { SaveButton.IsLoading = true; await SaveAsync(); SaveButton.IsLoading = false; }; ``` ## MAUI and Avalonia The same on both. For a full-width button, set `HorizontalOptions="Fill"` on MAUI and `HorizontalAlignment="Stretch"` on Avalonia. ## API | Property | Type | Default | Description | |---|---|---|---| | `Variant` | `ButtonVariant` | `Default` | Visual style. One of `Default`, `Destructive`, `Outline`, `Secondary`, `Ghost`, `Link`. | | `Size` | `ButtonSize` | `Default` | Size preset. One of `Default`, `Sm`, `Lg`, `Icon`. | | `IsLoading` | `bool` | `false` | Shows a spinner and ignores clicks. | | `Text` | `string` | — | Label text. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | `IconPosition` | `IconPosition` | `Left` | Side of the text the icon sits on. One of `Left`, `Right`. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | | Method | Description | |---|---| | `Press()` | Clicks in code, as a pointer click or Enter/Space would. Avalonia only. | --- # Button Group > Buttons joined into one control, with only the outer corners rounded. Source: https://native.shellui.dev/docs/components/form/button-group ## Installation ```bash shellui-native add button-group ``` **Platforms:** MAUI · Avalonia. Also installs `button`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=button-group-basic) Each button keeps its own `Clicked`. Neighbouring borders overlap, so `Outline` buttons share one line between them. ### Vertical **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=button-group-vertical) Stacked buttons share the widest one's width. ### Updating an older project `ButtonGroup` needs the `Button` that ships with it. If `button` is already in your project from an older CLI version, update it first: ```bash shellui-native update button ``` `update` rewrites `Button.cs`, so reapply any edits you made to it. ## MAUI and Avalonia On Avalonia the buttons are collected in `Items`. ## API XAML children go to `Items`. | Property | Type | Default | Description | |---|---|---|---| | `Orientation` | `StackOrientation` (MAUI) · `Orientation` (Avalonia) | `Horizontal` | `Horizontal` or `Vertical`. | --- # Calendar > A month grid for picking a day. Source: https://native.shellui.dev/docs/components/form/calendar ## Installation ```bash shellui-native add calendar ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=calendar-basic) ## API | Property | Type | Default | Description | |---|---|---|---| | `SelectedDate` | `DateTime?` | Today | Selected date. | | `MinimumDate` | `DateTime?` | `null` | Earliest selectable date; `null` for no limit. | | `MaximumDate` | `DateTime?` | `null` | Latest selectable date; `null` for no limit. | | `RangeStart` | `DateTime?` | `null` | First day of a highlighted span of days. | | `RangeEnd` | `DateTime?` | `null` | Last day of the highlighted span. | | Event | Arguments | Description | |---|---|---| | `DateSelected` | `DateTime` | A day was picked. | --- # Checkbox > A checkbox with an optional label and an error state. Source: https://native.shellui.dev/docs/components/form/checkbox ## Installation ```bash shellui-native add checkbox ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=checkbox-basic) ## API | Property | Type | Default | Description | |---|---|---|---| | `IsChecked` | `bool` | `false` | Whether it's checked. Two-way bindable. | | `Label` | `string` | — | Text next to the control; clicking it toggles the control. | | `HasError` | `bool` | `false` | Shows the destructive border and ring. | | Event | Arguments | Description | |---|---|---| | `CheckedChanged` | `bool` | User input only: setting IsChecked from code or a binding doesn't raise it. | --- # Combobox > A select with a search field to filter its items. Source: https://native.shellui.dev/docs/components/form/combobox ## Installation ```bash shellui-native add combobox ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=combobox-basic) ## MAUI and Avalonia - On Avalonia, Up / Down move a highlight through the matches and Enter takes it; MAUI's Enter takes the first match. - The Avalonia search field has focus as soon as the panel opens. - `Value` is a nullable `string` on Avalonia. ## API | Property | Type | Default | Description | |---|---|---|---| | `Value` | `string` | — | Selected item. Two-way bindable. | | `ItemsSource` | `IList` (MAUI) · `IList?` (Avalonia) | `null` | Items to choose from; shown with `ToString()`. | | `Placeholder` | `string` | `"Select..."` | Hint shown while empty. | | `SearchPlaceholder` | `string` | `"Search..."` | Hint in the search field. | | `EmptyText` | `string` | `"No results found."` | Shown when nothing matches the search. | | Event | Arguments | Description | |---|---|---| | `ValueChanged` | `string` | User input only: setting Value from code or a binding doesn't raise it. | | Method | Description | |---|---| | `SetOpen(bool open)` | Opens or closes it. | | `Close()` | Closes it. | --- # Date Picker > A date field that opens a calendar under it. Source: https://native.shellui.dev/docs/components/form/date-picker ## Installation ```bash shellui-native add date-picker ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `calendar`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=date-picker-basic) ## MAUI and Avalonia `DateChanged` passes `DateChangedEventArgs` on MAUI and the new `DateTime` on Avalonia. ## API | Property | Type | Default | Description | |---|---|---|---| | `Date` | `DateTime` | Today | Selected date. Two-way bindable. | | `MinimumDate` | `DateTime?` | `null` | Earliest selectable date; `null` for no limit. | | `MaximumDate` | `DateTime?` | `null` | Latest selectable date; `null` for no limit. | | `Format` | `string` | `"MMMM d, yyyy"` | .NET date format string for the trigger text. | | Event | Arguments | Description | |---|---|---| | `DateChanged` | `DateChangedEventArgs` (MAUI) · `DateTime` (Avalonia) | User input only: setting Date from code or a binding doesn't raise it. | | Method | Description | |---|---| | `SetOpen(bool open)` | Opens or closes it. | | `Close()` | Closes it. | --- # Date Range Picker > A date field that picks a start and an end date from one calendar. Source: https://native.shellui.dev/docs/components/form/date-range-picker ## Installation ```bash shellui-native add date-range-picker ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `calendar`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=date-range-picker-basic) The first pick is the start and the second the end. A pick before the start, or one made when the range is already complete, starts over. The panel closes when the range is complete, and the × clears it. ### Highlighting a range in a Calendar The picker uses `Calendar`'s `RangeStart` and `RangeEnd`, which tint a span of days. You can set them on a calendar of your own: ```xml ``` ## MAUI and Avalonia On Avalonia the focused trigger also opens with Enter, Space or Down, and Escape closes the panel. ## API | Property | Type | Default | Description | |---|---|---|---| | `StartDate` | `DateTime?` | `null` | First day of the range; `null` until one is picked. Two-way bindable. | | `EndDate` | `DateTime?` | `null` | Last day of the range; `null` until the range is complete. Two-way bindable. | | `Placeholder` | `string` | `"Pick a date range"` | Hint shown while empty. | | `Format` | `string` | `"MMM d, yyyy"` | .NET date format string for the trigger text. | | `AllowClear` | `bool` | `true` | Shows the × that clears the range. | | `MinimumDate` | `DateTime?` | `null` | Earliest selectable date; `null` for no limit. | | `MaximumDate` | `DateTime?` | `null` | Latest selectable date; `null` for no limit. | | Event | Arguments | Description | |---|---|---| | `RangeChanged` | — | `StartDate` or `EndDate` changed. | | Method | Description | |---|---| | `SetOpen(bool open)` | Opens or closes it. | | `Close()` | Closes it. | | `Clear()` | Clears both dates. | --- # File Upload > A drop zone that opens the file picker and lists the files you picked. Source: https://native.shellui.dev/docs/components/form/file-upload ## Installation ```bash shellui-native add file-upload ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=file-upload-basic) Tapping the zone opens the platform file picker. The picked files are listed underneath, each with a × to remove it. Without `Multiple`, a new pick replaces the file. ### Reading the files `FilesChanged` passes the current list. Open each file as a stream: **MAUI** ```csharp private async void OnFilesChanged(object? sender, IReadOnlyList files) { foreach (var file in files) { await using var stream = await file.OpenReadAsync(); // upload or read the stream } } ``` **Avalonia** ```csharp private async void OnFilesChanged(object? sender, IReadOnlyList files) { foreach (var file in files) { await using var stream = await file.OpenReadAsync(); // upload or read the stream } } ``` ### Limiting the file types `FileTypes` takes the platform's own picker type, so set it in code: **MAUI** ```csharp Upload.FileTypes = FilePickerFileType.Images; ``` **Avalonia** ```csharp Upload.FileTypes = new[] { FilePickerFileTypes.ImageAll }; ``` ## MAUI and Avalonia - Files are `FileResult` on MAUI and `IStorageFile` on Avalonia. - Dropping files on the zone works on Windows only on MAUI, and wherever Avalonia supports drag and drop on Avalonia. - On Avalonia the zone is a tab stop: Enter or Space opens the picker. ## API | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | `"Drag and drop or click here to upload files"` | Prompt shown in the drop zone. | | `Multiple` | `bool` | `false` | More than one file can be picked; new picks are added to the list. | | `MaxFiles` | `int` | `0` | The most files the list holds when `Multiple` is on; `0` for no limit. | | `FileTypes` | `FilePickerFileType` (MAUI) · `IReadOnlyList?` (Avalonia) | `null` | Which files the picker offers; `null` offers every file. Set it in code. | | `ShowFiles` | `bool` | `true` | Lists the picked files under the drop zone. | | Event | Arguments | Description | |---|---|---| | `FilesChanged` | `IReadOnlyList` (MAUI) · `IReadOnlyList` (Avalonia) | The list of files changed; passes the current list. | | Method | Description | |---|---| | `PickAsync()` | Opens the platform file picker and adds what was picked. | | `Add(IEnumerable files)` | Adds files as a pick or a drop would. | | `Remove(FileResult file)` | Removes one file from the list. | | `Clear()` | Removes every file. | --- # Form > Fields with a label, a description and an error message, stacked with even spacing. Source: https://native.shellui.dev/docs/components/form/form ## Installation ```bash shellui-native add form ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=form-basic) Each `FormField` is a label, a control, an optional description and an error message. `IsRequired` adds a red asterisk to the label. ### Validation Validation is yours: set a field's `Error` and the form reports it. The message shows in the destructive colour and the label turns red. The red border is the control's own `HasError`, so set that too: ```csharp private void OnSubmit(object? sender, EventArgs e) { NameField.Error = string.IsNullOrWhiteSpace(FullName.Text) ? "Enter your name." : ""; EmailField.Error = Email.Text.Contains('@') ? "" : "Enter a valid email address."; FullName.HasError = NameField.HasError; Email.HasError = EmailField.HasError; if (SignUp.IsValid) { // submit } } ``` `IsValid` is true while no field has an `Error`, `FirstInvalid` is the first field that has one, and `ClearErrors()` resets them all. ## API ### Form XAML children go to `Fields`. | Property | Type | Default | Description | |---|---|---|---| | `Spacing` | `double` | `24` | Space between the fields. | | Method | Description | |---|---| | `FormFields()` | Every `FormField` in the form, however deeply it's nested. | | `ClearErrors()` | Clears the `Error` of every field. | ### FormField XAML children go to `Control`. | Property | Type | Default | Description | |---|---|---|---| | `Label` | `string` | — | Text above the control. | | `Description` | `string` | — | Supporting text under the control. | | `Error` | `string` | — | The validation message; empty while the field is valid. Two-way bindable. | | `IsRequired` | `bool` | `false` | Adds a red asterisk after the label. | | `Control` | `View` (MAUI) · `Control?` (Avalonia) | `null` | The control the field wraps; set by placing it inside the field. | --- # Input > A text field at the 40px form height, with error and password modes. Source: https://native.shellui.dev/docs/components/form/input ## Installation ```bash shellui-native add input ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=input-basic) ### Password, error and read-only **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=input-states) ## MAUI and Avalonia - `Keyboard` (the soft keyboard on phones) is MAUI only. - `MaxLength`: no limit by default on both; on Avalonia `0` means no limit. ## API | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Entered text. Two-way bindable. | | `Placeholder` | `string` | — | Hint shown while empty. | | `IsPassword` | `bool` | `false` | Masks the text. | | `HasError` | `bool` | `false` | Shows the destructive border and ring. | | `IsReadOnly` | `bool` | `false` | Shows the text without allowing edits. | | `MaxLength` | `int` | No limit (MAUI) · `0` (no limit) (Avalonia) | Maximum number of characters. | | `Keyboard` | `Keyboard` | `Default` | Soft keyboard to show on touch devices. MAUI only. | | Event | Arguments | Description | |---|---|---| | `TextChanged` | `TextChangedEventArgs` | The text changed. | | `Completed` | — | Every slot is filled (or Enter in a text field). | --- # Input Group > A text field with an icon, a short text or any view before or after the text. Source: https://native.shellui.dev/docs/components/form/input-group ## Installation ```bash shellui-native add input-group ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=input-group-basic) The prefix and suffix sit inside the field's border, so the group has the same 40px height, focus ring and error state as `Input`. `Prefix` and `Suffix` take any view and replace the icon and text on their side. ## MAUI and Avalonia - `Keyboard`, which picks the on-screen keyboard, is MAUI only. - On Avalonia a click on a control in the prefix or suffix (a button, say) is left to that control; a click anywhere else focuses the field. ## API | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Entered text. Two-way bindable. | | `Placeholder` | `string` | — | Hint shown while empty. | | `IsPassword` | `bool` | `false` | Masks the text. | | `HasError` | `bool` | `false` | Shows the destructive border and ring. | | `Keyboard` | `Keyboard` | `Default` | Soft keyboard to show on touch devices. MAUI only. | | `PrefixIcon` | `IconName` | `None` | Icon before the text. | | `SuffixIcon` | `IconName` | `None` | Icon after the text. | | `PrefixText` | `string` | — | Short text before the text, such as `https://`. | | `SuffixText` | `string` | — | Short text after the text, such as `.com`. | | `Prefix` | `View` (MAUI) · `Control?` (Avalonia) | `null` | Any view before the text; replaces `PrefixIcon` and `PrefixText`. | | `Suffix` | `View` (MAUI) · `Control?` (Avalonia) | `null` | Any view after the text; replaces `SuffixIcon` and `SuffixText`. | | Event | Arguments | Description | |---|---|---| | `TextChanged` | `TextChangedEventArgs` | The text changed. | | `Completed` | — | Enter was pressed in the field. | --- # Input OTP > A one-time-code field with a slot per character. Source: https://native.shellui.dev/docs/components/form/input-otp ## Installation ```bash shellui-native add input-otp ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=input-otp-basic) ## MAUI and Avalonia - MAUI uses a hidden entry with the numeric keyboard; Avalonia puts an invisible text box over the slots. - On Avalonia, `Focus()` focuses that text box. ## API | Property | Type | Default | Description | |---|---|---|---| | `Length` | `int` | `6` | Number of slots. | | `Value` | `string` | — | The entered code. Two-way bindable. | | `IsNumeric` | `bool` | `true` | Digits only (numeric keyboard). False allows letters too. | | `HasError` | `bool` | `false` | Shows the destructive border and ring. | | Event | Arguments | Description | |---|---|---| | `ValueChanged` | `string` | User input only: setting Value from code or a binding doesn't raise ValueChanged or Completed. | | `Completed` | `string` | Raised when every slot is filled. | --- # Label > Text in the ShellUI type scale, with sizes, weights and colour variants. Source: https://native.shellui.dev/docs/components/form/label The class is `ShellLabel`, since both MAUI and Avalonia already have a `Label`. ## Installation ```bash shellui-native add label ``` **Platforms:** MAUI · Avalonia. ## Usage ### Sizes, weights and variants **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=label-variants) ## MAUI and Avalonia Both wrap long text. Avalonia's `ShellLabel` is a `TextBlock`, so it also takes the TextBlock properties (`TextWrapping="NoWrap"` for one line, `TextAlignment`, …). ## API | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | | `Size` | `LabelSize` | `Default` | Size preset. One of `Xs`, `Sm`, `Default`, `Lg`, `Xl`, `Xxl`, `Xxxl`. | | `Weight` | `LabelWeight` | `Normal` | One of `Light`, `Normal`, `Medium`, `Semibold`, `Bold`. | | `Variant` | `LabelVariant` | `Default` | Visual style. One of `Default`, `Muted`, `Destructive`, `Success`, `Warning`. | | `HorizontalTextAlignment` | `TextAlignment` | `Start` | Passed to the inner `Label`: `Start`, `Center` or `End`. MAUI only. | | `LineBreakMode` | `LineBreakMode` | `WordWrap` | Passed to the inner `Label`: how long text wraps or is cut off. MAUI only. | --- # Multi Select > A searchable select for several options, shown as chips. Source: https://native.shellui.dev/docs/components/form/multi-select ## Installation ```bash shellui-native add multi-select ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `wrap-layout`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=multi-select-basic) ## MAUI and Avalonia - On Avalonia, Up / Down move a highlight through the matches and Enter toggles it; MAUI's Enter takes the first match. - The Avalonia search field has focus as soon as the panel opens. ## API | Property | Type | Default | Description | |---|---|---|---| | `ItemsSource` | `IList` (MAUI) · `IList?` (Avalonia) | `null` | Items to choose from; shown with `ToString()`. | | `Values` | `IList` (MAUI) · `IList?` (Avalonia) | `null` | Selected values. | | `Placeholder` | `string` | `"Select..."` | Hint shown while empty. | | `SearchPlaceholder` | `string` | `"Search..."` | Hint in the search field. | | `EmptyText` | `string` | `"No results found."` | Shown when nothing matches the search. | | Event | Arguments | Description | |---|---|---| | `ValuesChanged` | `IReadOnlyList` | User input only: setting Values, or calling Toggle, from code doesn't raise it. | | Method | Description | |---|---| | `SetOpen(bool open)` | Opens or closes it. | | `Close()` | Closes it. | | `Toggle(string text)` | Opens it if closed, closes it if open. | --- # Number Input > A number field with decrement and increment buttons. Source: https://native.shellui.dev/docs/components/form/number-input ## Installation ```bash shellui-native add number-input ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=number-input-basic) ## MAUI and Avalonia - MAUI shows the numeric keyboard on phones. - On Avalonia, Up / Down step the value while the field has focus. ## API | Property | Type | Default | Description | |---|---|---|---| | `Value` | `decimal?` | `null` | Current value. Two-way bindable. | | `Minimum` | `decimal?` | `null` | Smallest value. | | `Maximum` | `decimal?` | `null` | Largest value. | | `Step` | `decimal` | `1` | Amount the arrow keys (or buttons) change the value by. | | `Placeholder` | `string` | — | Hint shown while empty. | | Event | Arguments | Description | |---|---|---| | `ValueChanged` | `decimal?` | User input only: setting Value from code or a binding doesn't raise it. | --- # Radio Group > A set of options where only one can be checked. Source: https://native.shellui.dev/docs/components/form/radio-group ## Installation ```bash shellui-native add radio-group ``` **Platforms:** MAUI · Avalonia. Also installs `element-extensions`, `radio-group-item`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=radio-group-basic) ## API ### RadioGroup XAML children go to `Children`. | Property | Type | Default | Description | |---|---|---|---| | `Value` | `string` | — | Value of the checked item. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `ValueChanged` | `string` | User input only: setting Value from code or a binding doesn't raise it. | | Method | Description | |---|---| | `SetValue(string value)` | Selects the item with this value. | ### RadioGroupItem | Property | Type | Default | Description | |---|---|---|---| | `Value` | `string` | — | Value this item stands for. | | `Text` | `string` | — | Text shown by the component. | --- # Select > Picks one item from a list that floats under its trigger. Source: https://native.shellui.dev/docs/components/form/select ## Installation ```bash shellui-native add select ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic Give it strings through `ItemsSource`; `SelectedIndex` is the pick (-1 for none). **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=select-basic) ```csharp public IList Platforms { get; } = [".NET MAUI", "Avalonia", "Blazor"]; ``` ## MAUI and Avalonia The same API. MAUI draws its own list instead of the platform picker, so it looks the same on every OS. ## API | Property | Type | Default | Description | |---|---|---|---| | `SelectedIndex` | `int` | `-1` | Index of the selected item; -1 for none. Two-way bindable. | | `ItemsSource` | `IList` (MAUI) · `IList?` (Avalonia) | `null` | Items to choose from; shown with `ToString()`. | | `Placeholder` | `string` | `"Select..."` | Hint shown while empty. | | Event | Arguments | Description | |---|---|---| | `SelectedIndexChanged` | — | User input only: setting SelectedIndex from code or a binding doesn't raise it. | | Method | Description | |---|---| | `SetOpen(bool open)` | Opens or closes it. | | `Close()` | Closes it. | --- # Slider > Picks a value in a range by dragging, clicking the track or using the keyboard. Source: https://native.shellui.dev/docs/components/form/slider ## Installation ```bash shellui-native add slider ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=slider-basic) ## MAUI and Avalonia - MAUI tints the platform slider with the theme tokens; Avalonia draws a shadcn slider of its own. - `Step` (how far the arrow keys move it) is Avalonia only; Page Up / Down move 10 steps, Home and End jump to the ends. - `ValueChanged` passes the new `double` on Avalonia. ## API | Property | Type | Default | Description | |---|---|---|---| | `Value` | `double` | `50` | Current value, between `Minimum` and `Maximum`. Two-way bindable. | | `Minimum` | `double` | `0` | Smallest value. | | `Maximum` | `double` | `100` | Largest value. | | `Step` | `double` | `1` | Keyboard increment. Pointer input is continuous. Avalonia only. | | Event | Arguments | Description | |---|---|---| | `ValueChanged` | `ValueChangedEventArgs` (MAUI) · `double` (Avalonia) | User input only: setting Value from code or a binding doesn't raise it. | --- # Switch > An on / off toggle with an optional label. Source: https://native.shellui.dev/docs/components/form/switch ## Installation ```bash shellui-native add switch ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=switch-basic) ## API | Property | Type | Default | Description | |---|---|---|---| | `IsToggled` | `bool` | `false` | Whether it's on. Two-way bindable. | | `Label` | `string` | — | Text next to the control; clicking it toggles the control. | | Event | Arguments | Description | |---|---|---| | `Toggled` | `bool` | User input only: setting IsToggled from code or a binding doesn't raise it. | --- # Tag Input > A text field that turns each entry into a removable tag. Source: https://native.shellui.dev/docs/components/form/tag-input ## Installation ```bash shellui-native add tag-input ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `wrap-layout`. ## Usage ### Basic Enter or a comma adds a tag; Backspace in the empty field removes the last one. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=tag-input-basic) ## MAUI and Avalonia On Avalonia, Backspace in the empty field also removes the last tag. ## API | Property | Type | Default | Description | |---|---|---|---| | `Tags` | `IList` (MAUI) · `IList?` (Avalonia) | `null` | The tags. | | `Placeholder` | `string` | `"Add tag..."` | Hint shown while empty. | | `MaxTags` | `int` | `0` | 0 means no limit. | | `AllowDuplicates` | `bool` | `false` | Allows the same tag more than once. | | Event | Arguments | Description | |---|---|---| | `TagsChanged` | `IReadOnlyList` | User input only: setting Tags, or calling Add / Remove, from code doesn't raise it. | | Method | Description | |---|---| | `Add(string tag)` | Adds a tag, as typing it and pressing Enter would. | | `Remove(string tag)` | Removes a tag. | --- # Textarea > A multi-line text field that grows with its content. Source: https://native.shellui.dev/docs/components/form/textarea ## Installation ```bash shellui-native add textarea ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=textarea-basic) ## API | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Entered text. Two-way bindable. | | `Placeholder` | `string` | — | Hint shown while empty. | | `HasError` | `bool` | `false` | Shows the destructive border and ring. | | `MaxLength` | `int` | `int.MaxValue` (MAUI) · `0` (Avalonia) | Maximum number of characters. | | Event | Arguments | Description | |---|---|---| | `TextChanged` | `TextChangedEventArgs` | The text changed. | --- # Time Picker > A time field that opens hour, minute and AM / PM columns. Source: https://native.shellui.dev/docs/components/form/time-picker ## Installation ```bash shellui-native add time-picker ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic `MinuteStep` sets the gap between minutes; the clock follows the current culture unless you set `Is24Hour`. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=time-picker-basic) ## API | Property | Type | Default | Description | |---|---|---|---| | `Time` | `TimeSpan` | The current time | Selected time. Two-way bindable. | | `MinuteStep` | `int` | `5` | Minutes between entries in the minute column. | | `Is24Hour` | `bool` | From the current culture | Defaults to the current culture's clock. | | `Format` | `string` | — | .NET time format string for the trigger text. Null uses "HH:mm" or "h:mm tt". | | Event | Arguments | Description | |---|---|---| | `TimeChanged` | — | User input only: setting Time from code or a binding doesn't raise it. | | Method | Description | |---|---| | `SetOpen(bool open)` | Opens or closes it. | | `Close()` | Closes it. | --- # Toggle > A two-state button that stays pressed. Source: https://native.shellui.dev/docs/components/form/toggle ## Installation ```bash shellui-native add toggle ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=toggle-basic) ## API | Property | Type | Default | Description | |---|---|---|---| | `IsPressed` | `bool` | `false` | Whether it's pressed. Two-way bindable. | | `Text` | `string` | — | Text shown by the component. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | `Variant` | `ToggleVariant` | `Default` | Visual style. One of `Default`, `Outline`. | | `Size` | `ToggleSize` | `Default` | Size preset. One of `Sm`, `Default`, `Lg`. | | Event | Arguments | Description | |---|---|---| | `PressedChanged` | `bool` | User input only: setting IsPressed from code or a binding doesn't raise it. | --- # Toggle Group > A row of toggles where one, or several, can be pressed. Source: https://native.shellui.dev/docs/components/form/toggle-group ## Installation ```bash shellui-native add toggle-group ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `element-extensions`. ## Usage ### Single **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=toggle-group-single) ### Multiple **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=toggle-group-multiple) ## MAUI and Avalonia On Avalonia the items are also tab stops, pressed with Enter or Space. ## API ### ToggleGroup XAML children go to `Items`. | Property | Type | Default | Description | |---|---|---|---| | `Multiple` | `bool` | `false` | Allows several items to be pressed at once. | | `Value` | `string` | — | Pressed item with `Multiple="False"`. Two-way bindable. | | `Values` | `IList` (MAUI) · `IList?` (Avalonia) | `null` | The pressed items' Values in Multiple mode. | | `Variant` | `ToggleGroupVariant` | `Default` | Visual style. One of `Default`, `Outline`. | | Event | Arguments | Description | |---|---|---| | `ValueChanged` | `string?` | User input only: setting Value or Values from code or a binding doesn't raise them. | | `ValuesChanged` | `IReadOnlyList` | The selection changed. | | Method | Description | |---|---| | `IsPressed(string value)` | Whether it's pressed. Two-way bindable. | ### ToggleGroupItem | Property | Type | Default | Description | |---|---|---|---| | `Value` | `string` | — | Value this item stands for. | | `Text` | `string` | — | Text shown by the component. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | --- # Alert Dialog Source: https://native.shellui.dev/docs/components/overlay/alert-dialog ## Installation ```bash shellui-native add alert-dialog ``` **Platforms:** MAUI · Avalonia. Also installs `element-extensions`, `button`, `icon`, `button-variants`. ## Usage ### Basic Open it from code with `ShowAsync()`, which completes with the choice. Escape counts as Cancel. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=alert-dialog-basic) ```csharp private async void OnDeleteClicked(object? sender, EventArgs e) { if (await DeleteDialog.ShowAsync()) Toast.Success("Account deleted"); } ``` ## MAUI and Avalonia Extra content between the description and the buttons: one `Body` view on MAUI, any XAML children on Avalonia. ## API ### AlertDialog XAML children go to `Items` on Avalonia and `Body` on MAUI. | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | Heading text. | | `Description` | `string` | — | Supporting text under the title. | | `ConfirmText` | `string` | `"Continue"` | Text of the confirm button. | | `CancelText` | `string` | `"Cancel"` | Empty hides the cancel button. | | `ConfirmVariant` | `ButtonVariant` | `Default` | Button variant of the confirm button (`Destructive` for deletions). One of `Default`, `Destructive`, `Outline`, `Secondary`, `Ghost`, `Link`. | | `Body` | `View` | `null` | Extra content between the description and the buttons. MAUI only. | | `Open` | `bool` | `false` | Whether it's open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `Confirmed` | — | The confirm button was pressed. | | `Cancelled` | — | Cancel, Escape or the back button. | | `OpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `ShowAsync()` | Opens the dialog and completes with true (confirm) or false (cancel). | | `SetOpen(bool value)` | Opens or closes it. | ### AlertDialogTrigger | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | --- # Context Menu > A menu that opens at the pointer on right-click, or on long-press on touch screens. Source: https://native.shellui.dev/docs/components/overlay/context-menu ## Installation ```bash shellui-native add context-menu ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `element-extensions`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=context-menu-basic) ## MAUI and Avalonia - MAUI opens the menu on right-click, or on a long press on touch screens. - Avalonia also opens it with the Menu key or Shift+F10 while focus is inside the trigger, and a right-click while it's open moves it. - On Avalonia the items are tab stops. ## API ### ContextMenu XAML children go to `Items` on Avalonia. | Property | Type | Default | Description | |---|---|---|---| | `IsOpen` | `bool` | `false` | Whether it's open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `IsOpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `OpenAt(Point? point)` | Opens the menu at a point relative to this view, or below the trigger when null. | | `SetOpen(bool value)` | Opens or closes it. | | `Toggle()` | Opens it if closed, closes it if open. | | `Close()` | Closes it. | ### ContextMenuTrigger No properties of its own. ### ContextMenuContent XAML children go to `Items` on Avalonia and `Children` on MAUI. No properties of its own. ### ContextMenuItem | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | `Shortcut` | `string` | — | Keyboard hint shown at the end of the row (display only). | | `IsDestructive` | `bool` | `false` | Draws the item in the destructive colour. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | | Method | Description | |---|---| | `Press()` | Picks the item in code, as a click or Enter/Space would. Avalonia only. | ### ContextMenuSeparator No properties of its own. --- # Dialog > A modal window over the page, with a backdrop. Source: https://native.shellui.dev/docs/components/overlay/dialog Declare it anywhere, next to the button that opens it: the content covers the window while it's open. Escape, the backdrop, the close button or any `DialogClose` closes it. While it's open, keyboard focus stays inside. ## Installation ```bash shellui-native add dialog ``` **Platforms:** MAUI · Avalonia. Also installs `dialog-trigger`, `dialog-content`, `dialog-header`, `dialog-footer`, `dialog-title`, `dialog-description`, `dialog-close`, `element-extensions`, `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=dialog-basic) ## From code ```csharp ProfileDialog.SetOpen(true); ProfileDialog.OpenChanged += (_, open) => Status.Text = open ? "Editing" : "Closed"; ``` ## MAUI and Avalonia On Avalonia the XAML children of `Dialog` and `DialogContent` are collected in `Items`. Otherwise the same. ## API ### Dialog XAML children go to `Items` on Avalonia. | Property | Type | Default | Description | |---|---|---|---| | `Open` | `bool` | `false` | Whether it's open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `OpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `SetOpen(bool value)` | Opens or closes it. | ### DialogTrigger | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | ### DialogContent XAML children go to `Items` on Avalonia and `Children` on MAUI. | Property | Type | Default | Description | |---|---|---|---| | `ShowCloseButton` | `bool` | `true` | Shows the close button in the corner. | ### DialogHeader XAML children go to `Children`. No properties of its own. ### DialogTitle | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | ### DialogDescription | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | ### DialogFooter XAML children go to `Children`. No properties of its own. ### DialogClose | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | --- # Drawer > A panel that slides up from the bottom, with a grab handle. Source: https://native.shellui.dev/docs/components/overlay/drawer ## Installation ```bash shellui-native add drawer ``` **Platforms:** MAUI · Avalonia. Also installs `drawer-trigger`, `drawer-content`, `element-extensions`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=drawer-basic) ## Title and description The title and description reuse `DialogTitle` and `DialogDescription`, so add `dialog` too if you use them. ## API ### Drawer XAML children go to `Items` on Avalonia. | Property | Type | Default | Description | |---|---|---|---| | `Side` | `DrawerSide` | `Bottom` | Edge the panel slides in from. One of `Left`, `Right`, `Top`, `Bottom`. | | `Open` | `bool` | `false` | Whether it's open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `OpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `SetOpen(bool value)` | Opens or closes it. | ### DrawerTrigger | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | ### DrawerContent XAML children go to `Items` on Avalonia and `Children` on MAUI. No properties of its own. --- # Dropdown > A menu that floats under its trigger. Source: https://native.shellui.dev/docs/components/overlay/dropdown It flips above the trigger when there's no room below. A click outside, picking an item, Escape, or opening another menu closes it. ## Installation ```bash shellui-native add dropdown ``` **Platforms:** MAUI · Avalonia. Also installs `dropdown-trigger`, `dropdown-content`, `dropdown-item`, `element-extensions`, `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=dropdown-basic) ## MAUI and Avalonia MAUI also keeps `ToggleAsync()` and `CloseAsync()` for older code; on Avalonia use `Toggle()` and `Close()`. ## API ### Dropdown XAML children go to `Items` on Avalonia. | Property | Type | Default | Description | |---|---|---|---| | `IsOpen` | `bool` | `false` | Whether it's open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `IsOpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `ToggleAsync()` | Kept for compatibility with earlier versions. MAUI only. | | `CloseAsync()` | MAUI only. | | `SetOpen(bool value)` | Opens or closes it. | | `Toggle()` | Opens it if closed, closes it if open. | | `Close()` | Closes it. | ### DropdownTrigger | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | ### DropdownContent XAML children go to `Items` on Avalonia and `Children` on MAUI. No properties of its own. ### DropdownItem | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | | Method | Description | |---|---| | `Press()` | Picks the item in code, as a click or Enter/Space would. Avalonia only. | --- # Hover Card > Rich content that floats under its trigger while the pointer is over either. Source: https://native.shellui.dev/docs/components/overlay/hover-card ## Installation ```bash shellui-native add hover-card ``` **Platforms:** MAUI · Avalonia. Also installs `hover-card-trigger`, `hover-card-content`, `element-extensions`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=hover-card-basic) ## MAUI and Avalonia Both open on mouse hover and toggle on a tap where there's no hover. On Avalonia, Enter or Space on the trigger toggles it too. ## API ### HoverCard XAML children go to `Items` on Avalonia. | Property | Type | Default | Description | |---|---|---|---| | `OpenDelay` | `int` | `300` | Milliseconds before the card opens / closes after the pointer enters / leaves. | | `CloseDelay` | `int` | `200` | Milliseconds before the card closes after the pointer leaves. | | `IsOpen` | `bool` | `false` | Whether it's open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `IsOpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `SetOpen(bool value)` | Opens or closes it. | | `Toggle()` | Opens it if closed, closes it if open. | | `Close()` | Closes it. | ### HoverCardTrigger | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | ### HoverCardContent XAML children go to `Items` on Avalonia and `Children` on MAUI. No properties of its own. --- # Popover > Rich content that floats next to its trigger. Source: https://native.shellui.dev/docs/components/overlay/popover ## Installation ```bash shellui-native add popover ``` **Platforms:** MAUI · Avalonia. Also installs `popover-trigger`, `popover-content`, `element-extensions`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=popover-basic) ## API ### Popover XAML children go to `Items` on Avalonia. | Property | Type | Default | Description | |---|---|---|---| | `IsOpen` | `bool` | `false` | Whether it's open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `IsOpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `ToggleAsync()` | Kept for compatibility with earlier versions. MAUI only. | | `CloseAsync()` | MAUI only. | | `SetOpen(bool value)` | Opens or closes it. | | `Toggle()` | Opens it if closed, closes it if open. | | `Close()` | Closes it. | ### PopoverTrigger | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | ### PopoverContent XAML children go to `Items` on Avalonia and `Children` on MAUI. No properties of its own. --- # Sheet > A panel that slides in from an edge of the window. Source: https://native.shellui.dev/docs/components/overlay/sheet ## Installation ```bash shellui-native add sheet ``` **Platforms:** MAUI · Avalonia. Also installs `sheet-trigger`, `sheet-content`, `element-extensions`, `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=sheet-basic) ## Title and description The title and description reuse `DialogTitle` and `DialogDescription`, so add `dialog` too if you use them. ## API ### Sheet XAML children go to `Items` on Avalonia. | Property | Type | Default | Description | |---|---|---|---| | `Side` | `SheetSide` | `Right` | Edge the panel slides in from. One of `Left`, `Right`, `Top`, `Bottom`. | | `Open` | `bool` | `false` | Whether it's open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `OpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `SetOpen(bool value)` | Opens or closes it. | ### SheetTrigger | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | ### SheetContent XAML children go to `Items` on Avalonia and `Children` on MAUI. | Property | Type | Default | Description | |---|---|---|---| | `MaxPanelWidth` | `double` | `384` | Widest a left or right sheet gets (384 is sm:max-w-sm); it never covers more than 75% of the window. | --- # Tooltip > A short hint shown while the pointer rests on a control. Source: https://native.shellui.dev/docs/components/overlay/tooltip ## Installation ```bash shellui-native add tooltip ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=tooltip-basic) ## MAUI and Avalonia - `Placement` is `Top` or `Bottom` on MAUI; Avalonia takes its own `PlacementMode`, so `Left` and `Right` work too. - On Avalonia the tooltip also shows while its control has keyboard focus. - Touch screens have no hover, so tooltips don't show there. ## API XAML children go to `Content`. | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Tooltip text. | | `Placement` | `ShellPopupPlacement` (MAUI) · `PlacementMode` (Avalonia) | `Top` | Side of the target the tooltip appears on. | | `Delay` | `int` | `400` | Milliseconds the pointer must rest before the tooltip shows. | | `Content` | `Control?` | `null` | The control the tooltip belongs to. Avalonia only. | --- # Accordion > Stacked sections that expand and collapse, one or several at a time. Source: https://native.shellui.dev/docs/components/layout/accordion ## Installation ```bash shellui-native add accordion ``` **Platforms:** MAUI · Avalonia. Also installs `element-extensions`, `accordion-item`, `accordion-trigger`, `accordion-content`, `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=accordion-basic) ## MAUI and Avalonia On Avalonia the XAML children of `AccordionItem` are collected in `Items`. Otherwise the same. ## API ### Accordion | Property | Type | Default | Description | |---|---|---|---| | `Type` | `AccordionType` | `Single` | `Single` (one open item) or `Multiple`. | | `Value` | `string` | — | Item open at first; comma-separated values with `Type="Multiple"`. | | Event | Arguments | Description | |---|---|---| | `ItemToggled` | `(string Value, bool IsOpen)` | Fired when any item's open state changes: (value, isOpen). User input only: setting Value, or calling Toggle, from code doesn't raise it. | | Method | Description | |---|---| | `IsOpen(string value)` | Whether the item with this value is open. | | `Toggle(string value)` | Opens it if closed, closes it if open. | ### AccordionItem XAML children go to `Items` on Avalonia and `Children` on MAUI. | Property | Type | Default | Description | |---|---|---|---| | `Value` | `string` | — | Identifies the item within its accordion. | | Event | Arguments | Description | |---|---|---| | `OpenChanged` | `bool` | User input only, like the accordion's ItemToggled. | | Method | Description | |---|---| | `Toggle()` | Opens it if closed, closes it if open. | ### AccordionTrigger XAML children go to `Body`. | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | | `Body` | `View` (MAUI) · `Control?` (Avalonia) | `null` | Custom header content instead of `Text`. | | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | ### AccordionContent XAML children go to `Content`. No properties of its own. --- # Aspect Ratio > Keeps its content at a fixed width-to-height ratio. Source: https://native.shellui.dev/docs/components/layout/aspect-ratio ## Installation ```bash shellui-native add aspect-ratio ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=aspect-ratio-basic) ## MAUI and Avalonia - On Avalonia `AspectRatio` is a `Border`, so `CornerRadius` rounds whatever is inside. - Set the width with `WidthRequest` on MAUI and `Width` on Avalonia. ## API | Property | Type | Default | Description | |---|---|---|---| | `Ratio` | `double` | 16 : 9 (`1.7778`) | Width divided by height. 16:9 is 1.7778, 4:3 is 1.3333, a square is 1. | --- # Card > A bordered container with header, content and footer parts. Source: https://native.shellui.dev/docs/components/layout/card ## Installation ```bash shellui-native add card ``` **Platforms:** MAUI · Avalonia. Also installs `card-header`, `card-content`, `card-footer`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=card-basic) ## MAUI and Avalonia - `Variant` (`Default`, `Outline`, `Ghost`, `Elevated`) and `IsPressable` work the same on both. - On Avalonia the XAML children of `Card` are collected in `Items`. ## API ### Card XAML children go to `Items` on Avalonia and `CardContent` on MAUI. | Property | Type | Default | Description | |---|---|---|---| | `Variant` | `CardVariant` | `Default` | `Default`, `Outline`, `Ghost` or `Elevated`. One of `Default`, `Elevated`. | | `IsPressable` | `bool` | `false` | Reacts to hover and press, and raises `Clicked`. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | ### CardHeader | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | Heading text. | | `Description` | `string` | — | Supporting text under the title. | ### CardContent No properties of its own. ### CardFooter XAML children go to `FooterContent`. No properties of its own. --- # Collapsible > Shows and hides a section, animating its height. Source: https://native.shellui.dev/docs/components/layout/collapsible ## Installation ```bash shellui-native add collapsible ``` **Platforms:** MAUI · Avalonia. Also installs `element-extensions`, `collapsible-trigger`, `collapsible-content`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=collapsible-basic) ## API ### Collapsible | Property | Type | Default | Description | |---|---|---|---| | `Open` | `bool` | `false` | Whether it's open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `OpenChanged` | `bool` | User input only: setting Open, or calling Toggle / SetOpen, from code doesn't raise it. | | Method | Description | |---|---| | `SetOpen(bool value)` | Opens or closes it. | | `Toggle()` | Opens it if closed, closes it if open. | ### CollapsibleTrigger | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | ### CollapsibleContent XAML children go to `Content`. No properties of its own. --- # Resizable > Panels side by side or stacked, with a divider you drag to resize them. Source: https://native.shellui.dev/docs/components/layout/resizable ShellUI for Blazor's `Resizable` doesn't drag, so the preview below is a still picture of the native component. ## Installation ```bash shellui-native add resizable ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=resizable-basic) `Size` is a panel's share of the space: a panel with `Size="2"` gets twice as much as one with `Size="1"`. Dragging a divider moves space between its two neighbours, and neither goes under its `MinSize`. Groups nest, so a panel can hold another `Resizable` with the other orientation. Give the outer group a size. ## MAUI and Avalonia - On Avalonia the dividers are tab stops: the arrow keys move a focused divider 16px. - The Avalonia pointer shows a resize cursor over a divider. ## API ### Resizable XAML children go to `Panels`. | Property | Type | Default | Description | |---|---|---|---| | `Orientation` | `StackOrientation` (MAUI) · `Orientation` (Avalonia) | `Horizontal` | `Horizontal` or `Vertical`. | | `ShowHandle` | `bool` | `true` | Shows the short bar on each divider; the divider drags with or without it. | | Event | Arguments | Description | |---|---|---| | `Resized` | — | A drag ended. | ### ResizablePanel | Property | Type | Default | Description | |---|---|---|---| | `Size` | `double` | `1` | The panel's share of the space: `2` gets twice as much as `1`. Two-way bindable. | | `MinSize` | `double` | `48` | The smallest the panel can be dragged to, in device-independent pixels. | --- # Scroll Area > A scrollable region with the platform's scrollbar. Source: https://native.shellui.dev/docs/components/layout/scroll-area ## Installation ```bash shellui-native add scroll-area ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic For the shadcn look, wrap it in a 1px border with 6px corners. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=scroll-area-basic) ## MAUI and Avalonia MAUI shows the platform scrollbar; Avalonia uses Fluent's thin scrollbar, which hides while idle. ## API No properties of its own. --- # Separator > A thin line that divides content, horizontally or vertically. Source: https://native.shellui.dev/docs/components/layout/separator ## Installation ```bash shellui-native add separator ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=separator-basic) ## API | Property | Type | Default | Description | |---|---|---|---| | `Orientation` | `SeparatorOrientation` | `Horizontal` | `Horizontal` or `Vertical`. One of `Horizontal`, `Vertical`. | --- # Wrap Layout > Lays its children out left to right and wraps them onto new rows. Source: https://native.shellui.dev/docs/components/layout/wrap-layout ShellUI for Blazor has no twin (CSS does this with `flex-wrap`), so the preview below is a flex-wrap row of ShellUI buttons. On Avalonia, use the built-in `WrapPanel`. ## Installation ```bash shellui-native add wrap-layout ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=wrap-layout-basic) ## MAUI and Avalonia - MAUI's `WrapLayout` has `Padding`; the Avalonia one is a `Panel` without it. - Avalonia's own `WrapPanel` covers plain wrapping. Use `WrapLayout` there for `LastChildFill`, which lets the last child take the rest of its row. ## API | Property | Type | Default | Description | |---|---|---|---| | `Spacing` | `double` | `8` | Gap between children in a row. | | `LineSpacing` | `double` | `8` | Gap between rows. | | `LastChildFill` | `bool` | `false` | The last child takes what is left of its row (or a row of its own when less than MinimumLastChildWidth remains) — e.g. the text field after a run of chips. | | `MinimumLastChildWidth` | `double` | `96` | Smallest width the stretched last child may take before it wraps. | | Method | Description | |---|---| | `Measure(double widthConstraint, double heightConstraint)` | MAUI only. | | `ArrangeChildren(Rect bounds)` | MAUI only. | --- # Bottom Nav > A mobile tab bar with icon tabs, short labels, badges and an optional raised action button. Source: https://native.shellui.dev/docs/components/navigation/bottom-nav > **Next release** > > On the main branch of shellui-native; not in the 0.2.0-beta.1 CLI yet. The phone take on a sidebar: a row of icon tabs pinned to the bottom of the screen, with count badges, dots and optionally a round action button in the middle. Put it in the last row of the page, or over the page so it can slide away while the page scrolls. ShellUI for Blazor has no bottom nav, so the previews on this page are the Avalonia component itself, running in your browser. For whole screens built around one, see [Blocks](https://native.shellui.dev/docs/blocks.md). ## Installation ```bash shellui-native add bottom-nav ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `element-extensions`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` `SelectedValue` is the active item's `Value`; pressing an item sets it. `Badge` puts a count over the icon ("3", "99+"), `Dot` a small dot for something new without a count, and `IconContent` replaces the icon with any view, such as an `Avatar`. `Prominent` turns an item into a round action button, for compose or pay. In a full-width bar it rises above the bar's edge; in a floating bar it is just the circle. It raises `Clicked` and never becomes the selected item, so it needs no `Value`. ### Variants `Variant` sets the bar's style. `Default` (above) is a 64px bar with a border on top, where a line slides to the active item. Switching items animates in about 200 ms, and a press scales the icon in slightly. A badge on an active pill or circle takes its colour as its ring. #### Pill An 80px bar; a pill grows behind the active icon, as in Material 3. `ActiveIcon` swaps the icon while the item is active, here a ticked circle for Tasks. **MAUI** ```xml ``` **Avalonia** ```xml ``` #### Floating An inset rounded bar with a shadow; a filled pill slides behind the active icon, with the label under it, so long labels stay readable. With `Labels="Active"` only the active item shows its label and the others centre their icon. **MAUI** ```xml ``` **Avalonia** ```xml ``` #### Lifted The active icon rises into a ringed circle over the bar's top edge, and the circle slides from item to item. The bar always leaves room above it for the circle. **MAUI** ```xml ``` **Avalonia** ```xml ``` #### Expanding A compact floating capsule of icons; the active one widens into a pill with its label. This variant always labels the active item only, whatever `Labels` says. **MAUI** ```xml ``` **Avalonia** ```xml ``` ### Labels `Labels` picks which items show their label: `Always` (the default), `Active` (only the active item; the others centre their icon) or `Never`. ### Colour and indicator `ActiveToken` is the active item's colour in `Default`: `Foreground` unless you set it, `Primary` for a brand-coloured bar. `ShowIndicator="False"` drops the sliding line (`Default`) or pill (`Floating`), so the active item shows by colour alone. ```xml ``` ### Hiding while the page scrolls Set `ScrollSource` to the page's scroll view and put the bar over the content, in the same cell and aligned to the bottom, so the content can use the space. Scrolling down slides the bar away (after 24px of scrolling, past the first 48px); scrolling up 8px or reaching the top brings it back. `IsHidden` is the same state, two-way: set it to hide or show the bar from code. Scroll the preview to try it. **MAUI** ```xml ... ``` **Avalonia** ```xml ... ``` Leave room under the content (the bottom padding above), so the last item isn't stuck behind the bar when it is showing. ### The home indicator `BottomInset` is the space under the bar for the phone's home indicator: the full-width bars fill it with their colour, the floating ones sit above it. Left unset, it follows the safe area under the bar on phones and is 0 elsewhere, so set it only to override. ### Events `SelectedValueChanged` reports user input only: setting `SelectedValue` from code or a binding doesn't raise it. An item's `Clicked` fires on every press, also on the item that is already active, to scroll its page back to the top for example. `Press()` picks an item from code, as a tap would. ```csharp Tabs.SelectedValueChanged += (_, value) => ShowPage(value); HomeTab.Clicked += (_, _) => { if (HomeTab.IsActive) ScrollHomeToTop(); }; ``` ## MAUI and Avalonia - On Avalonia the items are tab stops: Enter or Space selects one, and Left and Right move to the neighbouring item and select it. On MAUI an item is selected with Enter or Space. - `ScrollSource` is a `ScrollView` on MAUI (`{x:Reference Feed}`) and a `ScrollViewer` on Avalonia (`{Binding #Feed}`). - `IconContent` is a `View` on MAUI and a `Control` on Avalonia. On MAUI it is the item's content property, so the view can also go straight inside ``. - `BottomInset` follows the safe area on Android and iOS on MAUI, and on Avalonia wherever the window draws edge to edge. ## API ### BottomNav XAML children go to `Items`. | Property | Type | Default | Description | |---|---|---|---| | `SelectedValue` | `string` | — | The active item's `Value`. Two-way bindable. | | `Variant` | `BottomNavVariant` | `Default` | Visual style. One of `Default`, `Pill`, `Floating`, `Lifted`, `Expanding`. | | `Labels` | `BottomNavLabels` | `Always` | Which items show their label. Expanding always labels the active item only. One of `Always`, `Active`, `Never`. | | `ActiveToken` | `ShellToken` | `Foreground` | The active item's colour in `Default` (`Primary` for a brand-coloured bar). | | `ShowIndicator` | `bool` | `true` | The sliding line (`Default`) or pill (`Floating`); without it the active item shows by colour alone. | | `BottomInset` | `double` | `double.NaN` | Space under the bar for the home indicator: full-width bars fill it with their colour, floating ones sit above it. `NaN` follows the safe area under the bar on phones and is 0 elsewhere. | | `ScrollSource` | `ScrollView` (MAUI) · `ScrollViewer?` (Avalonia) | `null` | A scroll view to follow: scrolling it down hides the bar, scrolling up shows it. | | `IsHidden` | `bool` | `false` | Slid out of view, by `ScrollSource` or from code. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `SelectedValueChanged` | `string?` | The user picked another item. Setting `SelectedValue` from code or a binding doesn't raise it. | ### BottomNavItem XAML children go to `IconContent`. | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Label under the icon. | | `Value` | `string` | — | Identifies the item; becomes the bar's `SelectedValue` when pressed. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | `ActiveIcon` | `IconName` | `None` | Shown instead of `Icon` while the item is active. | | `IconContent` | `View` (MAUI) · `Control?` (Avalonia) | `null` | Any view instead of the icon, such as an `Avatar`. | | `Badge` | `string` | — | A count over the icon ("3", "99+"). Empty hides it. | | `Dot` | `bool` | `false` | A small dot over the icon, for "something new" without a count. | | `Prominent` | `bool` | `false` | A round action button (compose, pay): it rises above a full-width bar, raises `Clicked` and never becomes the selected item. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Pressed, also when the item is already active (to scroll its page to the top, say). | | Method | Description | |---|---| | `Press()` | Picks the item in code, as a tap or Enter/Space would. | --- # Breadcrumb > The path to the current page, with a chevron between items. Source: https://native.shellui.dev/docs/components/navigation/breadcrumb ## Installation ```bash shellui-native add breadcrumb ``` **Platforms:** MAUI · Avalonia. Also installs `breadcrumb-item`, `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=breadcrumb-basic) ## API ### Breadcrumb No properties of its own. ### BreadcrumbItem | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | | `IsCurrent` | `bool` | `false` | Marks the current page: plain text, not clickable or focusable. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | --- # Command > A search field over a list of grouped commands, inline or as a command palette. Source: https://native.shellui.dev/docs/components/navigation/command ## Installation ```bash shellui-native add command ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=command-basic) Typing filters the list: every word you type must be in an item's `Text` or `Keywords`. Groups with no match and the separators hide while you search, and `EmptyText` shows when nothing matches. The first match is highlighted and Enter picks it. `ItemSelected` passes the item: ```csharp private void OnCommand(object? sender, CommandItem item) { // item.Value is "calendar", "profile", ... } ``` ### Command palette `CommandPalette`, in the same file, shows the list in a dialog near the top of the window. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=command-palette) Open it from code. Picking an item, tapping the backdrop or pressing Escape closes it, and it opens with an empty search each time: ```csharp private void OnOpenPalette(object? sender, EventArgs e) => Palette.SetOpen(true); ``` ### The name `Command` on MAUI MAUI has a `Command` class of its own (the `ICommand` helper). In C# that imports both namespaces, qualify one of them or add an alias: ```csharp using UI = MyApp.Components.UI; ``` ## MAUI and Avalonia - On Avalonia, Up / Down move the highlight through the matches; on MAUI, Enter picks the first match. - The Avalonia `CommandPalette` has `Hotkey`, a key gesture that opens and closes it anywhere in the window. It is Ctrl+K by default; `Hotkey="{x:Null}"` turns it off. MAUI opens the palette from code only. - On Avalonia the children are collected in `Groups` and a group's items in `Items`. ## API ### Command XAML children go to `Groups`. | Property | Type | Default | Description | |---|---|---|---| | `Placeholder` | `string` | `"Type a command or search..."` | Hint shown while empty. | | `EmptyText` | `string` | `"No results found."` | Shown when nothing matches the search. | | `MaxListHeight` | `double` | `300` | The list scrolls past this height. | | Event | Arguments | Description | |---|---|---| | `ItemSelected` | `CommandItem` | An item was picked; passes the item. | | Method | Description | |---|---| | `Reset()` | Clears the search. | | `Items()` | Every item, in order, whether it's in a group or directly in the list. | ### CommandGroup XAML children go to `Items`. | Property | Type | Default | Description | |---|---|---|---| | `Heading` | `string` | — | Text above the group's items. | ### CommandItem | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Item text; the search matches it. | | `Value` | `string` | — | Identifies the item to your code. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | `Shortcut` | `string` | — | Keyboard hint shown at the end of the row (display only). | | `Keywords` | `string` | — | Extra words the search matches besides `Text`. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | | Method | Description | |---|---| | `Press()` | Picks the item in code, as a click or Enter would. Avalonia only. | ### CommandSeparator No properties of its own. ### CommandPalette XAML children go to `Items` on Avalonia and `Groups` on MAUI. | Property | Type | Default | Description | |---|---|---|---| | `Placeholder` | `string` | `"Type a command or search..."` | Hint shown while empty. | | `EmptyText` | `string` | `"No results found."` | Shown when nothing matches the search. | | `Open` | `bool` | `false` | Whether it's open. Two-way bindable. | | `Hotkey` | `KeyGesture?` | `new KeyGesture(Key.K, KeyModifiers.Control)` | A key gesture that opens and closes the palette anywhere in the window; `null` for none. Avalonia only. | | Event | Arguments | Description | |---|---|---| | `ItemSelected` | `CommandItem` | An item was picked; passes the item. The palette closes first. | | `OpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `SetOpen(bool value)` | Opens or closes it. | --- # Edge Menu > A handle on a screen edge that slides out a rail of tool tiles. Source: https://native.shellui.dev/docs/components/navigation/edge-menu > **Next release** > > On the main branch of shellui-native; not in the 0.2.0-beta.1 CLI yet. A menu docked to a screen edge: a small handle that slides out a rail of icon tiles, for tools and shortcuts that shouldn't take a tab in the [bottom nav](https://native.shellui.dev/docs/components/navigation/bottom-nav.md). ShellUI for Blazor has no edge menu, so the previews on this page are the Avalonia component itself, running in your browser. They start open; the handle closes and opens them. ## Installation ```bash shellui-native add edge-menu ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `element-extensions`. ## Usage ### Basic **MAUI** ```xml ... ``` **Avalonia** ```xml ... ``` Put the menu over the page, in the same cell after the content. Only the handle and the open rail take input, so the page stays usable while the menu is closed. The handle opens it; a tap outside, Escape, the handle or a tile closes it. `Side` puts it on the `Right` (the default) or `Left` edge, and `Position` places the handle along the edge: 0 at the top, 0.5 (the default) in the middle, 1 at the bottom. ### Solid and dimmed `Variant="Solid"` is a dock in the primary colour with tiles a shade lighter, and `Dim` darkens the page while the menu is open. **MAUI** ```xml ``` **Avalonia** ```xml ``` ### Actions or a selection Tiles can be plain actions: handle each tile's `Clicked`. Or give them a `Value`, and the menu keeps the picked one in `SelectedValue` (two-way) and highlights it, like a tool palette. `SelectedValueChanged` reports user input only: setting `SelectedValue` from code or a binding doesn't raise it. `CloseOnSelect` (true by default) closes the menu when a tile is picked; set it to `False` to pick several tiles in a row. ### Opening from code `IsOpen` is two-way, and `Open()`, `Close()` and `Toggle()` set it. `IsOpenChanged` reports every open and close, like the other overlays. ```csharp Tools.IsOpenChanged += (_, open) => Status.Text = open ? "Tools open" : "Tools closed"; Tools.Open(); ``` ## MAUI and Avalonia - On Avalonia the tiles are tab stops: Enter or Space picks one, Up and Down move between them, and focus goes to the first tile when the menu opens and back to the handle when it closes. On MAUI a tile is picked with a tap or Enter / Space. - On MAUI the back button also closes the menu on Android. - The tiles are collected in `Items`: an `IList` on MAUI, a `Controls` collection on Avalonia. ## API ### EdgeMenu XAML children go to `Items`. | Property | Type | Default | Description | |---|---|---|---| | `IsOpen` | `bool` | `false` | Whether it's open. Two-way bindable. | | `Side` | `EdgeMenuSide` | `Right` | The edge the menu is docked to. One of `Right`, `Left`. | | `Position` | `double` | `0.5` | Where the handle sits along the edge: 0 top, 0.5 middle, 1 bottom. | | `Variant` | `EdgeMenuVariant` | `Default` | Visual style. One of `Default`, `Solid`. | | `Dim` | `bool` | `false` | Dims the page while the menu is open. | | `CloseOnSelect` | `bool` | `true` | Picking a tile closes the menu. | | `SelectedValue` | `string` | — | The highlighted tile's `Value`. Two-way bindable; optional, tiles can be plain actions. | | Event | Arguments | Description | |---|---|---| | `IsOpenChanged` | `bool` | Opened or closed; raised on every change. | | `SelectedValueChanged` | `string?` | The user picked another tile. Setting `SelectedValue` from code or a binding doesn't raise it. | | Method | Description | |---|---| | `Open()` | Opens it. | | `Close()` | Closes it. | | `Toggle()` | Opens it if closed, closes it if open. | ### EdgeMenuItem | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Label under the icon. | | `Value` | `string` | — | Identifies the tile for the menu's `SelectedValue` (optional). | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Tapped, or Enter / Space with keyboard focus. | | Method | Description | |---|---| | `Press()` | Picks the tile in code, as a tap or Enter / Space would. | --- # Link Card > A clickable card with an icon, title and description. Source: https://native.shellui.dev/docs/components/navigation/link-card ## Installation ```bash shellui-native add link-card ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=link-card-basic) ## MAUI and Avalonia `Url` opens with `Launcher.Default` on MAUI and with the window's `Launcher` on Avalonia. ## API | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | Heading text. | | `Description` | `string` | — | Supporting text under the title. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | `Url` | `string` | — | Opened in the system browser (or the app registered for the link) when the card is tapped. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | | Method | Description | |---|---| | `Press()` | Clicks in code, as a pointer click or Enter/Space would. Avalonia only. | --- # Menubar > A row of menus, like a desktop app's File, Edit and View. Source: https://native.shellui.dev/docs/components/navigation/menubar ## Installation ```bash shellui-native add menubar ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=menubar-basic) Each menu opens a panel of items under its title. Clicking outside, picking an item or pressing Escape closes it, and opening one menu closes the other. `Shortcut` is a hint at the end of the row; it doesn't register a key. ## MAUI and Avalonia - On Avalonia the titles are tab stops: Enter, Space or Down opens a menu, and Left / Right move between titles. - In an open Avalonia menu, Up / Down move between the items and Enter picks one. - On Avalonia the menus are collected in `Menus` and a menu's items in `Items`. ## API ### Menubar XAML children go to `Menus`. No properties of its own. ### MenubarMenu XAML children go to `Items`. | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | The menu's name in the bar. | | Event | Arguments | Description | |---|---|---| | `Opened` | — | The menu opened. | | `Closed` | — | The menu closed. | | Method | Description | |---|---| | `SetOpen(bool open)` | Opens or closes it. | | `Close()` | Closes it. | ### MenubarItem | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Item text. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | `Shortcut` | `string` | — | Keyboard hint shown at the end of the row (display only). | | `IsDestructive` | `bool` | `false` | Draws the item in the destructive colour. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | | Method | Description | |---|---| | `Press()` | Picks the item in code, as a click or Enter/Space would. Avalonia only. | ### MenubarSeparator No properties of its own. --- # Navbar > A top bar with a brand, links and actions; the links collapse into a menu on narrow screens. Source: https://native.shellui.dev/docs/components/navigation/navbar ## Installation ```bash shellui-native add navbar ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `element-extensions`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=navbar-basic) The bar is 56px high with a border below. `SelectedValue` is the active item's `Value`; pressing an item sets it. ### Collapsing When the bar is narrower than `CollapseBelow` (640 by default), the links move into a menu that a button opens under the bar. Picking a link closes it. Set `CollapseBelow="0"` to keep the links in the bar at any width. ### Your own brand `Brand` takes a view that replaces the icon and title, for a logo image for example. ## MAUI and Avalonia - On Avalonia the links and the menu button are tab stops, pressed with Enter or Space. - On Avalonia the links are collected in `Items`. ## API ### Navbar XAML children go to `Items`. | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | Brand text at the start of the bar. | | `Icon` | `IconName` | `None` | Brand icon before the title; `None` for no icon. | | `Brand` | `View` (MAUI) · `Control?` (Avalonia) | `null` | A view that replaces the icon and title. | | `Actions` | `View` (MAUI) · `Control?` (Avalonia) | `null` | A view at the end of the bar (buttons, an avatar, a theme toggle). | | `SelectedValue` | `string` | — | The active item's `Value`. Two-way bindable. | | `CollapseBelow` | `double` | `640` | Below this width the links move into the menu; `0` never collapses. | | `IsMenuOpen` | `bool` | `false` | Whether the collapsed links menu is open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `SelectedValueChanged` | `string?` | User input only: setting SelectedValue from code or a binding doesn't raise it. | ### NavbarItem | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Link text. | | `Value` | `string` | — | Identifies the item; becomes the bar's `SelectedValue` when pressed. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | | Method | Description | |---|---| | `Press()` | Picks the link in code, as a click or Enter/Space would. Avalonia only. | --- # Navigation Menu > A row of top-level links for an app header, where an item can open a panel of links. Source: https://native.shellui.dev/docs/components/navigation/navigation-menu ## Installation ```bash shellui-native add navigation-menu ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=navigation-menu-basic) An item with links inside shows a chevron and opens a panel of them. An item without links is a plain link that raises `Clicked`. A link can also have an `Icon`. ## MAUI and Avalonia - On Avalonia the items are tab stops: Enter, Space or Down opens a panel, and Left / Right move between items. - In an open Avalonia panel, Up / Down move between the links and Enter picks one. - On Avalonia the items are collected in `Items` and an item's links in `Links`. ## API ### NavigationMenu XAML children go to `Items`. No properties of its own. ### NavigationMenuItem XAML children go to `Links`. | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | The item's text in the row. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | An item without links was pressed. | | Method | Description | |---|---| | `SetOpen(bool open)` | Opens or closes it. | | `Close()` | Closes it. | | `Press()` | Opens the panel, or raises Clicked when there are no links, as a click or Enter would. Avalonia only. | ### NavigationMenuLink | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | Link text. | | `Description` | `string` | — | Supporting text under the title. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | | Method | Description | |---|---| | `Press()` | Picks the link in code, as a click or Enter/Space would. Avalonia only. | --- # Pagination > Previous / next and page numbers, with ellipses for long ranges. Source: https://native.shellui.dev/docs/components/navigation/pagination ## Installation ```bash shellui-native add pagination ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=pagination-basic) ## MAUI and Avalonia - `ShowLabels` (the "Previous" / "Next" text) is on by default; MAUI turns it off on phones. - On Avalonia every page and arrow is a tab stop that activates with Enter or Space. ## API | Property | Type | Default | Description | |---|---|---|---| | `Page` | `int` | `1` | Current page, starting at 1. Two-way bindable. | | `TotalPages` | `int` | `1` | Number of pages. | | `SiblingCount` | `int` | `1` | Pages shown on each side of the current page. | | `ShowLabels` | `bool` | `true` (`false` on phones) (MAUI) · `true` (Avalonia) | "Previous" / "Next" text next to the chevrons. Off by default on phones to fit the width. | | Event | Arguments | Description | |---|---|---| | `PageChanged` | `int` | User input only: setting Page from code or a binding doesn't raise it. | --- # Prev Next Nav > Previous and next page links for the foot of a page. Source: https://native.shellui.dev/docs/components/navigation/prev-next-nav ## Installation ```bash shellui-native add prev-next-nav ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=prev-next-nav-basic) Two bordered cards side by side, each a small "Previous" or "Next" over the page's name. A side with no label is left empty, so the first page of a series shows only the next link: ```xml ``` `PreviousText` and `NextText` change the small words, for another language for example. ## MAUI and Avalonia On Avalonia the cards are tab stops, pressed with Enter or Space. ## API | Property | Type | Default | Description | |---|---|---|---| | `PreviousLabel` | `string` | — | Name of the previous page; empty leaves that side out. | | `NextLabel` | `string` | — | Name of the next page; empty leaves that side out. | | `PreviousText` | `string` | `"Previous"` | The small word over the previous page's name. | | `NextText` | `string` | `"Next"` | The small word over the next page's name. | | Event | Arguments | Description | |---|---|---| | `PreviousClicked` | — | The previous card was pressed. | | `NextClicked` | — | The next card was pressed. | --- # Sidebar > An app sidebar with groups of items that collapses to a rail of icons. Source: https://native.shellui.dev/docs/components/navigation/sidebar ShellUI for Blazor's sidebar is a larger set of parts, so the preview below is built from HTML and the ShellUI tokens to match the native component. ## Installation ```bash shellui-native add sidebar ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `element-extensions`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=sidebar-basic) Put the sidebar in an `Auto` column next to your content. It is 256px wide; an item with a `Value` becomes the `SelectedValue` when pressed, and an item without one just raises `Clicked`. ### Collapsing `IsCollapsed` (or `Toggle()`) shrinks the sidebar to a 56px rail that shows the icons only, animating the width: ```csharp private void OnToggleSidebar(object? sender, EventArgs e) => AppSidebar.Toggle(); ``` The header and footer are your own views, so hide what doesn't fit the rail in `IsCollapsedChanged`. ### On phones A fixed column takes too much of a phone screen. Put the `Sidebar` inside a [Sheet](https://native.shellui.dev/docs/components/overlay/sheet.md) there and open it from a menu button. ## MAUI and Avalonia - On Avalonia the items are tab stops, pressed with Enter or Space. - On Avalonia the groups are collected in `Groups` and a group's items in `Items`. ## API ### Sidebar XAML children go to `Groups`. | Property | Type | Default | Description | |---|---|---|---| | `IsCollapsed` | `bool` | `false` | Shows the icon rail instead of the full sidebar. Two-way bindable. | | `SelectedValue` | `string` | — | The active item's `Value`. Two-way bindable. | | `ExpandedWidth` | `double` | `256` | Width when expanded. | | `CollapsedWidth` | `double` | `56` | Width of the icon rail. | | `Side` | `SidebarSide` | `Left` | Which edge of the window it sits on; the border is drawn on the other edge. One of `Left`, `Right`. | | `Header` | `View` (MAUI) · `Control?` (Avalonia) | `null` | A view above the groups. | | `Footer` | `View` (MAUI) · `Control?` (Avalonia) | `null` | A view below the groups. | | Event | Arguments | Description | |---|---|---| | `IsCollapsedChanged` | `bool` | The sidebar collapsed or expanded. | | `SelectedValueChanged` | `string?` | User input only: setting SelectedValue from code or a binding doesn't raise it. | | Method | Description | |---|---| | `Toggle()` | Collapses it if expanded, expands it if collapsed. | ### SidebarGroup XAML children go to `Items`. | Property | Type | Default | Description | |---|---|---|---| | `Label` | `string` | — | Heading above the group's items; hidden on the rail. | ### SidebarItem | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Item text; hidden on the rail. | | `Value` | `string` | — | Identifies the item; becomes the sidebar's `SelectedValue` when pressed. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | `Badge` | `string` | — | Short text at the end of the row, e.g. a count. | | Event | Arguments | Description | |---|---|---| | `Clicked` | — | Clicked or tapped (or Enter / Space with keyboard focus). | | Method | Description | |---|---| | `Press()` | Picks the item in code, as a click or Enter/Space would. Avalonia only. | --- # Stepper > A step-by-step flow with numbered steps and its own navigation. Source: https://native.shellui.dev/docs/components/navigation/stepper ## Installation ```bash shellui-native add stepper ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `button`, `button-variants`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=stepper-basic) ## MAUI and Avalonia - MAUI shows only the active step's view. On Avalonia every step stays in the tree and only the active one is visible. - On Avalonia, the steps you have reached are tab stops, opened with Enter or Space. ## API ### Stepper XAML children go to `Steps`. | Property | Type | Default | Description | |---|---|---|---| | `CurrentStep` | `int` | `0` | Zero-based index of the active step. Two-way bindable. | | `ShowNavigation` | `bool` | `true` | Shows the built-in previous / next buttons. | | `PreviousText` | `string` | `"Previous"` | Text of the previous button. | | `NextText` | `string` | `"Next"` | Text of the next button. | | `ConfirmText` | `string` | `"Confirm"` | Text of the confirm button. | | Event | Arguments | Description | |---|---|---| | `CurrentStepChanged` | `int` | User input only: setting CurrentStep, or calling Next / Previous, from code doesn't raise it. | | `Confirmed` | — | Raised by the Confirm button on the last step. | | Method | Description | |---|---| | `Next()` | Moves to the next step. | | `Previous()` | Moves to the previous step. | ### StepperStep | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | Heading text. | | `Description` | `string` | — | Supporting text under the title. | --- # Tabs > A row of triggers that switches between panels. Source: https://native.shellui.dev/docs/components/navigation/tabs ## Installation ```bash shellui-native add tabs ``` **Platforms:** MAUI · Avalonia. Also installs `element-extensions`, `tabs-list`, `tabs-trigger`, `tabs-content`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=tabs-basic) ## MAUI and Avalonia On Avalonia, Left and Right also move between the tabs of a focused tab list. ## API ### Tabs | Property | Type | Default | Description | |---|---|---|---| | `Value` | `string` | — | Value of the active tab. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `ValueChanged` | `(string Old, string New)` | (oldValue, newValue) User input only: setting Value from code or a binding doesn't raise it. | | Method | Description | |---|---| | `SetValue(string value)` | Selects the item with this value. | ### TabsList XAML children go to `Items` on Avalonia and `Children` on MAUI. No properties of its own. ### TabsTrigger | Property | Type | Default | Description | |---|---|---|---| | `Value` | `string` | — | Value of the panel it shows. | | `Text` | `string` | — | Text shown by the component. | ### TabsContent XAML children go to `Content`. | Property | Type | Default | Description | |---|---|---|---| | `Value` | `string` | — | Shown while the tabs' value matches. | --- # Tree View > An expandable tree of rows, with selection. Source: https://native.shellui.dev/docs/components/navigation/tree-view ## Installation ```bash shellui-native add tree-view ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `element-extensions`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=tree-view-basic) ## MAUI and Avalonia Rows are tab stops on both platforms. On Avalonia, Right also expands a row and Left collapses it. ## API ### TreeView XAML children go to `Items`. | Property | Type | Default | Description | |---|---|---|---| | `SelectedValue` | `string` | — | The selected item's Value (its Text when no Value is set). | | Event | Arguments | Description | |---|---|---| | `SelectedValueChanged` | `string?` | User input only: setting SelectedValue from code or a binding doesn't raise it. | ### TreeViewItem XAML children go to `Items`. | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | | `Value` | `string` | — | Identifies the item; reported as the tree's `SelectedValue`. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | `IsExpanded` | `bool` | `false` | Whether the item's children are shown. | --- # Avatar > A round image with initials, or a user icon, as the fallback. Source: https://native.shellui.dev/docs/components/data-display/avatar ## Installation ```bash shellui-native add avatar ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=avatar-basic) ## MAUI and Avalonia `Source` is an `ImageSource` on MAUI (an image in `Resources/Images`) and an `IImage` on Avalonia (a resource path such as `/Assets/profile.png`). ## API | Property | Type | Default | Description | |---|---|---|---| | `Source` | `ImageSource` (MAUI) · `IImage?` (Avalonia) | `null` | Image to show. | | `Fallback` | `string` | — | Initials shown when there's no image; empty shows a user icon. | | `Size` | `AvatarSize` | `Default` | Size preset. One of `Sm`, `Default`, `Lg`, `Xl`. | --- # Badge > A small pill for a status, count or tag. Source: https://native.shellui.dev/docs/components/data-display/badge ## Installation ```bash shellui-native add badge ``` **Platforms:** MAUI · Avalonia. ## Usage ### Variants **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=badge-variants) ## API | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Badge text. | | `Variant` | `BadgeVariant` | `Default` | Visual style. One of `Default`, `Secondary`, `Destructive`, `Outline`, `Success`, `Warning`, `Info`. | --- # Carousel > Swipeable slides with arrows, dots, looping and auto-play. Source: https://native.shellui.dev/docs/components/data-display/carousel ## Installation ```bash shellui-native add carousel ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=carousel-basic) ## MAUI and Avalonia - On Avalonia you drag slides with the mouse as well as with touch. - The Avalonia arrows are tab stops, and Left / Right change the slide while one has focus. - With `AspectRatio="0"`, give the carousel a height: `HeightRequest` on MAUI, `Height` on Avalonia. ## API XAML children go to `Slides`. | Property | Type | Default | Description | |---|---|---|---| | `Position` | `int` | `0` | Index of the current slide. Two-way bindable. | | `Loop` | `bool` | `true` | At the last slide, Next wraps to the first (and Previous the other way). | | `ShowArrows` | `bool` | `true` | Shows the previous / next buttons. | | `ShowDots` | `bool` | `true` | Shows the position dots. | | `AutoPlay` | `bool` | `false` | Advances slides on a timer. | | `AutoPlayInterval` | `int` | `3000` | Milliseconds between slides while AutoPlay is on. | | `AspectRatio` | `double` | 16 : 9 (`1.7778`) | Width / height of the frame. 0 turns it off: set HeightRequest on the carousel instead. | | Event | Arguments | Description | |---|---|---| | `PositionChanged` | `int` | User input only (arrows, dots, swipes, keys): auto-play, Next / Previous and setting Position from code don't raise it. | | Method | Description | |---|---| | `Next()` | Shows the next slide. | | `Previous()` | Shows the previous slide. | --- # Chat > A conversation panel with message bubbles, a typing indicator and a message box. Source: https://native.shellui.dev/docs/components/data-display/chat ## Installation ```bash shellui-native add chat ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `button`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=chat-basic) `Chat` is the frame: an optional header, a scrolling list of messages and an optional footer, usually a `ChatInput`. Give it a height. The list follows the newest message, unless the reader has scrolled up. ### Sending and streaming `Submitted` passes the trimmed text and clears the box. Add the user's message, then a reply with `IsStreaming`, which shows three bouncing dots until the text arrives: ```csharp private async void OnSend(object? sender, string text) { Conversation.Messages.Add(new ChatMessage { Role = ChatRole.User, Text = text }); var reply = new ChatMessage { Role = ChatRole.Assistant, Sender = "ShellUI", IsStreaming = true }; Conversation.Messages.Add(reply); reply.Text = await AskAsync(text); reply.IsStreaming = false; } ``` Set `IsLoading` on the `ChatInput` while a reply is on its way: the send button shows a spinner and sending is blocked. ### Messages `Role` places and colours the bubble: `User` on one side, `Assistant` on the other, `System` centred. `AvatarText` shows initials next to the bubble, and `Avatar` takes a view instead. `Actions` is a view under the bubble, for copy or retry buttons. A message's child view goes inside the bubble, under the text. ## MAUI and Avalonia On Avalonia, Enter in the `ChatInput` sends and Shift+Enter starts a new line. On MAUI the send button sends. ## API ### Chat XAML children go to `Messages`. | Property | Type | Default | Description | |---|---|---|---| | `Header` | `View` (MAUI) · `Control?` (Avalonia) | `null` | A view above the messages. | | `Footer` | `View` (MAUI) · `Control?` (Avalonia) | `null` | A view below the messages, usually a `ChatInput`. | | `AutoScroll` | `bool` | `true` | Follows new messages and a message that grows, unless the reader has scrolled up. | | Method | Description | |---|---| | `ScrollToEnd(bool animated = true)` | Shows the newest message. | ### ChatMessage XAML children go to `Body`. | Property | Type | Default | Description | |---|---|---|---| | `Role` | `ChatRole` | `Assistant` | Who the message is from; it places and colours the bubble. One of `Assistant`, `User`, `System`. | | `Text` | `string` | — | The message text. | | `Sender` | `string` | — | The sender's name above the bubble. | | `Timestamp` | `string` | — | Time text shown with the sender's name. | | `IsStreaming` | `bool` | `false` | Shows three bouncing dots after the text while a reply is still arriving. | | `AvatarText` | `string` | — | Initials shown in the avatar circle. | | `Avatar` | `View` (MAUI) · `Control?` (Avalonia) | `null` | Any view for the avatar circle (an `Avatar`, an `Icon`); replaces `AvatarText`. | | `Body` | `View` (MAUI) · `Control?` (Avalonia) | `null` | A view inside the bubble, under the text. | | `Actions` | `View` (MAUI) · `Control?` (Avalonia) | `null` | A view under the bubble, for copy or retry buttons. | ### ChatInput | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | The text in the box. Two-way bindable. | | `Placeholder` | `string` | `"Send a message..."` | Hint shown while empty. | | `IsLoading` | `bool` | `false` | Shows a spinner in the send button and blocks sending. | | `Actions` | `View` (MAUI) · `Control?` (Avalonia) | `null` | A view before the text, for an attach button for example. | | Event | Arguments | Description | |---|---|---| | `Submitted` | `string` | The message was sent; passes the trimmed text. The box is cleared. | | Method | Description | |---|---| | `Submit()` | Sends the text as the button does; does nothing while loading or when the box is empty. | --- # Data Table > A table filled from a list, with a filter, sortable columns, row selection and pages. Source: https://native.shellui.dev/docs/components/data-display/data-table ## Installation ```bash shellui-native add data-table ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `button`, `table`, `input`, `checkbox`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=data-table-basic) `ItemsSource` takes any list, and an `ObservableCollection` refreshes the table as it changes. Each column names the item property it shows: ```csharp public record Invoice(string Number, string Customer, string Status, DateTime Date, decimal Amount); ``` - **Filter.** Every word typed in the field must be in the text of some column. - **Sort.** A sortable header cycles ascending, descending and unsorted. Numbers and dates sort by value. - **Selection.** `ShowSelection` adds a checkbox column. The header checkbox selects every row that passes the filter, across pages. `SelectedItems` holds the items, and `SelectionChanged` passes them. - **Pages.** Ten rows at a time, with Previous and Next. Change the count with `PageSize`, or turn pages off with `ShowPagination="False"`. Cells show text only. For badges or buttons in cells, build the rows yourself with [Table](https://native.shellui.dev/docs/components/data-display/table.md). ### Columns `Width` takes a Grid column width: `*`, `2*` or a fixed number. `Format` is a .NET format string such as `C` or `MMM d, yyyy`. After changing an item's values in place, call `Refresh()`. ### Trimming and NativeAOT `Property` is read by name at run time. In an app published with trimming or NativeAOT, set `Value` in code instead, so the property isn't trimmed away: ```csharp InvoiceTable.Columns[0].Value = item => ((Invoice)item).Number; ``` ## MAUI and Avalonia - On Avalonia, sortable headers are tab stops, pressed with Enter or Space, and keep focus after sorting. - On Avalonia a click on a row's checkbox doesn't raise `RowTapped`. ## API ### DataTable XAML children go to `Columns`. | Property | Type | Default | Description | |---|---|---|---| | `ItemsSource` | `IEnumerable` (MAUI) · `IEnumerable?` (Avalonia) | `null` | The items to show, one row each. An `ObservableCollection` refreshes the table as it changes. | | `ShowFilter` | `bool` | `true` | Shows the filter field above the table. | | `FilterPlaceholder` | `string` | `"Filter..."` | Hint in the empty filter field. | | `ShowPagination` | `bool` | `true` | Splits the rows into pages, with Previous and Next. | | `PageSize` | `int` | `10` | Rows per page while `ShowPagination` is on. | | `ShowSelection` | `bool` | `false` | Adds a checkbox column; the header checkbox selects every row that passes the filter. | | `EmptyText` | `string` | `"No results."` | Shown when no row passes the filter. | | `MinimumContentWidth` | `double` | `0` | Below this width the table scrolls sideways instead of squeezing its columns. 0 never scrolls. | | Event | Arguments | Description | |---|---|---| | `SelectionChanged` | `IReadOnlyList` | The selection changed; passes the selected items. | | `RowTapped` | `object` | A row was tapped; passes its item. | | Method | Description | |---|---| | `Refresh()` | Re-reads the items and columns. Call it after changing an item's values or a column. | | `GoToPage(int page)` | Shows a page, counting from 1. | | `SortBy(DataTableColumn? column, bool descending = false)` | Sorts by a column; call it again to reverse, and with null to restore the source order. | | `ClearSelection()` | Unselects every row. | ### DataTableColumn | Property | Type | Default | Description | |---|---|---|---| | `Header` | `string` | — | Text in the column's header cell. | | `Property` | `string` | — | The name of the item property this column shows. | | `Value` | `Func?` | `null` | Reads the column's value from an item; replaces `Property`. Set it in code. | | `Format` | `string` | — | A .NET format string for the value, such as `C` or `MMM d, yyyy`. | | `Width` | `string` | `"*"` | A Grid column width: `*`, `2*` or a fixed number. | | `IsSortable` | `bool` | `true` | Whether tapping the header sorts by this column. | | `IsBold` | `bool` | `false` | Medium-weight text, for the row's key column. | | `HorizontalTextAlignment` | `TextAlignment` | `Start` | Text alignment in the cell. | --- # Empty State > A placeholder for an empty list or screen, with an icon, text and actions. Source: https://native.shellui.dev/docs/components/data-display/empty-state ## Installation ```bash shellui-native add empty-state ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=empty-state-basic) ## API XAML children go to `Actions`. | Property | Type | Default | Description | |---|---|---|---| | `Icon` | `IconName` | `Inbox` | Icon in the tile above the title. | | `Title` | `string` | — | Heading text. | | `Description` | `string` | — | Supporting text under the title. | | `Bordered` | `bool` | `false` | Draws the outline. | --- # Image Viewer > A thumbnail that opens the image over the page, with zoom controls. Source: https://native.shellui.dev/docs/components/data-display/image-viewer ## Installation ```bash shellui-native add image-viewer ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=image-viewer-basic) Give the viewer a size: the thumbnail fills it. A tap opens the image over the page on a dark backdrop, with zoom out, reset, zoom in and close controls. A tap on the backdrop or Escape closes it. ### A smaller thumbnail file Set `ThumbnailSource` to a smaller file for the page. `Source` then loads only when the viewer opens. ### Zoom `Zoom` goes from 0.5 to 4, where 1 fits the page. Zooming scales the image around its centre; it doesn't pan. `ZoomIn()`, `ZoomOut()` and `ResetZoom()` do what the controls do. ## MAUI and Avalonia - `Source` is an `ImageSource` on MAUI (an image in `Resources/Images`) and an `IImage` on Avalonia (a resource path such as `/Assets/photo.jpg`). - How the thumbnail fills its box is `Aspect` on MAUI and `Stretch` on Avalonia. - MAUI zooms with a pinch. Avalonia zooms with the mouse wheel and the + / - / 0 keys. - On Avalonia the thumbnail and the controls are tab stops. ## API XAML children go to `Items` on Avalonia. | Property | Type | Default | Description | |---|---|---|---| | `Source` | `ImageSource` (MAUI) · `IImage?` (Avalonia) | `null` | The image shown in the viewer, and as the thumbnail when `ThumbnailSource` isn't set. | | `ThumbnailSource` | `ImageSource` (MAUI) · `IImage?` (Avalonia) | `null` | A smaller file for the page; `Source` then loads only in the viewer. | | `Description` | `string` | — | What the image shows, for screen readers. | | `Aspect` | `Aspect` | `AspectFill` | How the thumbnail fills its box. MAUI only. | | `Open` | `bool` | `false` | Whether the viewer is open. Two-way bindable. | | `Stretch` | `Stretch` | `UniformToFill` | How the thumbnail fills its box. Avalonia only. | | Event | Arguments | Description | |---|---|---| | `OpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `ZoomIn()` | Zooms in one step, up to 4. | | `ZoomOut()` | Zooms out one step, down to 0.5. | | `ResetZoom()` | Back to 1, where the image fits the page. | | `SetOpen(bool value)` | Opens or closes it. | --- # Kbd > A keyboard key or shortcut hint. Source: https://native.shellui.dev/docs/components/data-display/kbd ## Installation ```bash shellui-native add kbd ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=kbd-basic) ## API | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Key or shortcut to show (`Ctrl+K`). | --- # Progress > A bar showing how far along a task is. Source: https://native.shellui.dev/docs/components/data-display/progress ## Installation ```bash shellui-native add progress ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic `Success` and `Destructive` tint the bar; the ShellUI preview only has the default colour. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=progress-basic) ## API | Property | Type | Default | Description | |---|---|---|---| | `Value` | `double` | `0` | Progress, from 0 to `Maximum`. | | `Maximum` | `double` | `100` | Largest value. | | `Variant` | `ProgressVariant` | `Default` | Visual style. One of `Default`, `Success`, `Warning`, `Destructive`. | | `ShowLabel` | `bool` | `false` | Shows the percentage next to the bar. | --- # Stat Card > A dashboard metric with a trend and a short description. Source: https://native.shellui.dev/docs/components/data-display/stat-card ## Installation ```bash shellui-native add stat-card ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=stat-card-basic) ## API | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | Heading text. | | `Value` | `string` | — | The headline figure. | | `Change` | `string` | — | Change against the previous period, shown next to the trend. | | `Trend` | `StatTrend` | `Neutral` | Direction of the change: `Up`, `Down` or `Neutral`. One of `Neutral`, `Up`, `Down`. | | `Description` | `string` | — | Supporting text under the title. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | --- # Table > A data table with a header, row hover and selection, and an optional caption. Source: https://native.shellui.dev/docs/components/data-display/table One template holds `Table`, `TableHeader`, `TableRow`, `TableHead` and `TableCell`. `Columns` takes Grid widths for every row; use star and fixed widths, since each row is its own grid. ## Installation ```bash shellui-native add table ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=table-basic) ## MAUI and Avalonia - Rows raise `Tapped` on both; on Avalonia it's Avalonia's own `Tapped` event, so the handler takes `TappedEventArgs`. - Set `IsSelected` on a row to highlight it. ## API ### Table XAML children go to `Rows`. | Property | Type | Default | Description | |---|---|---|---| | `Columns` | `string` | — | Column widths for every row, as Grid lengths (`2*,*,100`). Use star and fixed widths: each row is its own grid. | | `Caption` | `string` | — | Muted caption under the table. | | `Bordered` | `bool` | `true` | Draws the outline. | | `MinimumContentWidth` | `double` | `0` | Narrower than this, the table scrolls horizontally instead of squeezing its columns. | ### TableHeader | Property | Type | Default | Description | |---|---|---|---| | `Columns` | `string` | — | Column widths for a header used outside a Table. | | `IsSelected` | `bool` | `false` | Highlights the row as selected. | | Event | Arguments | Description | |---|---|---| | `Tapped` | — | The row was clicked or tapped. MAUI only. | ### TableRow | Property | Type | Default | Description | |---|---|---|---| | `Columns` | `string` | — | Column widths for a row used outside a Table. | | `IsSelected` | `bool` | `false` | Highlights the row as selected. | | Event | Arguments | Description | |---|---|---| | `Tapped` | — | The row was clicked or tapped. MAUI only. | ### TableHead | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | | `HorizontalTextAlignment` | `TextAlignment` | `Start` | Text alignment in the cell. | ### TableCell | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | | `HorizontalTextAlignment` | `TextAlignment` | `Start` | Text alignment in the cell. | | `IsBold` | `bool` | `false` | Medium-weight text, for the row's key column. | --- # Timeline > A vertical list of events joined by a line. Source: https://native.shellui.dev/docs/components/data-display/timeline ## Installation ```bash shellui-native add timeline ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=timeline-basic) ## MAUI and Avalonia A `TimelineItem` can hold one child view instead of `Text`. MAUI sets it as `Body`; on Avalonia it is the item's child, also reachable as `Body`. ## API ### Timeline XAML children go to `Items`. No properties of its own. ### TimelineItem XAML children go to `Body`. | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | Heading text. | | `Time` | `string` | — | Timestamp text shown with the item. | | `Text` | `string` | — | Text shown by the component. | | `IsActive` | `bool` | `false` | Highlights the item as the current one. | | `Icon` | `IconName` | `None` | Lucide icon from `IconName`; `None` for no icon. | | `Body` | `View` (MAUI) · `Control?` (Avalonia) | `null` | Content under the description. | --- # Charts > Bar, line, area, pie, donut, radar and radial charts, drawn by the components in the theme's colours. Source: https://native.shellui.dev/docs/components/charts The charts are drawn by the components themselves (MAUI's `GraphicsView`, Avalonia's `Render`), so they need no charting package. They take their colours from the theme, and every chart has a legend, a tooltip under the pointer (or the finger) and a grow-in animation. | Chart | Install | Shows | |---|---|---| | [Bar Chart](https://native.shellui.dev/docs/components/charts/bar-chart.md) | `bar-chart` | Bars per category: side by side, stacked or horizontal | | [Line Chart](https://native.shellui.dev/docs/components/charts/line-chart.md) | `line-chart` | A line per series, smooth or straight | | [Area Chart](https://native.shellui.dev/docs/components/charts/area-chart.md) | `area-chart` | Filled lines, overlapping or stacked | | [Pie Chart](https://native.shellui.dev/docs/components/charts/pie-chart.md) | `pie-chart` | Slices of a whole; `DonutChart` adds a hole for a value | | [Radar Chart](https://native.shellui.dev/docs/components/charts/radar-chart.md) | `radar-chart` | A shape per series over a ring of categories | | [Radial Chart](https://native.shellui.dev/docs/components/charts/radial-chart.md) | `radial-chart` | Rings filling towards a maximum | ```bash shellui-native add bar-chart line-chart area-chart pie-chart radar-chart radial-chart ``` Each chart installs `chart`, the core they share. The chart colours are theme tokens added with the charts: in a project whose `shell` came from an older CLI, run `shellui-native update shell` first. ## Data A chart's children are its series, and `Labels` names the categories (or a pie's slices). In XAML both are comma-separated lists: **MAUI** ```xml ``` **Avalonia** ```xml ``` From code, set `Labels` and add to `Series`: ```csharp Downloads.Labels = new ChartLabels(months); Downloads.Series.Add(new ChartSeries { Name = "ShellUI", Values = new ChartValues(counts) }); ``` Adding or removing a series, or setting a series' `Values`, `Name` or `Color`, redraws the chart. After changing numbers inside an existing `Values` list, call `Refresh()`. `PlayAnimation()` grows the chart in again. Give every chart a height: `HeightRequest` on MAUI, `Height` on Avalonia. `ValueFormat` (a .NET number format, `#,0.##` by default) formats the axis and tooltip values, and `Description` names the chart for screen readers. ## Colours Series take the theme's `Chart1` to `Chart5` tokens in order; past the fifth, the colours repeat, fainter. They follow light and dark mode and can be replaced like any other [theme token](https://native.shellui.dev/docs/theming.md), before the first page loads: **MAUI** ```csharp ShellTheme.Light[ShellToken.Chart1] = Color.FromArgb("#E76E50"); ShellTheme.Dark[ShellToken.Chart1] = Color.FromArgb("#2662D9"); ``` **Avalonia** ```csharp ShellTheme.Light[ShellToken.Chart1] = Color.Parse("#E76E50"); ShellTheme.Dark[ShellToken.Chart1] = Color.Parse("#2662D9"); ``` A series' own `Color` wins over the theme. ## Your own chart Derive from `ChartBase` and draw in `DrawChart` with the `IChartCanvas` it hands you (lines, polygons, text). The legend, tooltip and animation come with the base class, and `ChartMath` has the geometry the built-in charts use: arcs, sectors, rounded rectangles, smooth curves and axis scales. ## What the charts don't do Zooming and panning, mixing bars and lines in one chart, click events on a bar or slice, and very large data sets (every point is drawn). For those, a charting library such as LiveCharts sits fine next to ShellUI Native: colour it from `ShellTheme.Get(ShellToken.Chart1)`. --- # Bar Chart > Bars for each category, side by side, stacked or lying down. Source: https://native.shellui.dev/docs/components/charts/bar-chart A bar per series for each category, drawn by the component in the theme's chart colours, with a legend, a tooltip and a grow-in animation. See [Charts](https://native.shellui.dev/docs/components/charts.md) for how data, colours and updates work in every chart. ## Installation ```bash shellui-native add bar-chart ``` **Platforms:** MAUI · Avalonia. Also installs `chart`, the core every chart shares. The chart colours are theme tokens added with the charts, so in a project whose `shell` came from an older CLI, run `shellui-native update shell` first. ## Usage ### Basic Each `ChartSeries` is a set of bars; `Labels` names the categories along the axis. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=bar-chart-basic) ### Stacked `IsStacked` puts each series on top of the one before it. Only the top of a stack is rounded. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=bar-chart-stacked) ### Horizontal `IsHorizontal` lays the bars down: categories run down the side and values along the bottom. Negative values go the other way. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=bar-chart-horizontal) ## MAUI and Avalonia - MAUI draws the chart in a `GraphicsView`; give it a `HeightRequest`. On touch screens a tap or a drag shows the tooltip. - Avalonia draws it in `Render`, in the control's own font; give it a `Height`. `ChartSeries.Color` is an Avalonia `Color` (`Color.Parse("#E76E50")`). ## API ### BarChart XAML children go to `Series`. | Property | Type | Default | Description | |---|---|---|---| | `IsStacked` | `bool` | `false` | Stacks the series on top of each other instead of side by side. | | `IsHorizontal` | `bool` | `false` | Lays the bars down: categories run down the side, values along the bottom. | | `CornerRadius` | `double` | `4` | Rounds the end of each bar (the end of each stack when stacked). | | `MaxBarSize` | `double` | `56` | The thickest a bar gets, however much room there is. | | `ShowGrid` | `bool` | `true` | Grid lines behind the plot, at each value axis step. | | `ShowXAxis` | `bool` | `true` | The labels under the plot. | | `ShowYAxis` | `bool` | `true` | The labels beside the plot. | | `Minimum` | `double` | Fits the data | The ends of the value axis; by default they fit the data and include zero. | | `Maximum` | `double` | Fits the data | The other end of the value axis; see `Minimum`. | | `Labels` | `ChartLabels` (MAUI) · `ChartLabels?` (Avalonia) | `null` | The category names along the axis, or the slice names of a pie. | | `ShowLegend` | `bool` | `true` | Shows the series (or slice) names with their colours under the chart. | | `ShowTooltip` | `bool` | `true` | Shows the values under the pointer (or the finger). | | `IsAnimated` | `bool` | `true` | Grows the chart in when it first appears. | | `ValueFormat` | `string` | `"#,0.##"` | A .NET number format for axis and tooltip values. | | `EmptyText` | `string` | `"No data"` | Shown when there are no values. | | `Description` | `string` | — | What the chart shows, for screen readers. | | Method | Description | |---|---| | `Refresh()` | Redraws the chart. Call it after changing the numbers inside a series' Values. | | `PlayAnimation()` | Grows the chart in again. | ### ChartSeries | Property | Type | Default | Description | |---|---|---|---| | `Name` | `string` | — | Shown in the legend and the tooltip. | | `Values` | `ChartValues` | Empty | The numbers, one per category. In XAML, a comma-separated list. | | `Color` | `Color?` | `null` | Replaces the theme's chart color for this series. | --- # Line Chart > A line per series across the categories, smooth or straight. Source: https://native.shellui.dev/docs/components/charts/line-chart A line per series, from one edge of the plot to the other. See [Charts](https://native.shellui.dev/docs/components/charts.md) for how data, colours and updates work in every chart. ## Installation ```bash shellui-native add line-chart ``` **Platforms:** MAUI · Avalonia. Also installs `chart`, the core every chart shares. The chart colours are theme tokens added with the charts, so in a project whose `shell` came from an older CLI, run `shellui-native update shell` first. ## Usage ### Basic Lines are smooth by default: the curve passes through every point without overshooting it. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=line-chart-basic) ### Straight lines and dots `IsSmooth="False"` joins the points with straight segments, and `ShowDots` marks each one. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=line-chart-linear) ## MAUI and Avalonia - MAUI draws the chart in a `GraphicsView`; give it a `HeightRequest`. On touch screens a tap or a drag shows the tooltip. - Avalonia draws it in `Render`, in the control's own font; give it a `Height`. `ChartSeries.Color` is an Avalonia `Color` (`Color.Parse("#E76E50")`). ## API ### LineChart XAML children go to `Series`. | Property | Type | Default | Description | |---|---|---|---| | `IsSmooth` | `bool` | `true` | Curves the line through its points; false joins them with straight segments. | | `ShowDots` | `bool` | `false` | A dot on every point. | | `StrokeWidth` | `double` | `2` | Width of each line. | | `ShowGrid` | `bool` | `true` | Grid lines behind the plot, at each value axis step. | | `ShowXAxis` | `bool` | `true` | The labels under the plot. | | `ShowYAxis` | `bool` | `true` | The labels beside the plot. | | `Minimum` | `double` | Fits the data | The ends of the value axis; by default they fit the data and include zero. | | `Maximum` | `double` | Fits the data | The other end of the value axis; see `Minimum`. | | `Labels` | `ChartLabels` (MAUI) · `ChartLabels?` (Avalonia) | `null` | The category names along the axis, or the slice names of a pie. | | `ShowLegend` | `bool` | `true` | Shows the series (or slice) names with their colours under the chart. | | `ShowTooltip` | `bool` | `true` | Shows the values under the pointer (or the finger). | | `IsAnimated` | `bool` | `true` | Grows the chart in when it first appears. | | `ValueFormat` | `string` | `"#,0.##"` | A .NET number format for axis and tooltip values. | | `EmptyText` | `string` | `"No data"` | Shown when there are no values. | | `Description` | `string` | — | What the chart shows, for screen readers. | | Method | Description | |---|---| | `Refresh()` | Redraws the chart. Call it after changing the numbers inside a series' Values. | | `PlayAnimation()` | Grows the chart in again. | ### ChartSeries | Property | Type | Default | Description | |---|---|---|---| | `Name` | `string` | — | Shown in the legend and the tooltip. | | `Values` | `ChartValues` | Empty | The numbers, one per category. In XAML, a comma-separated list. | | `Color` | `Color?` | `null` | Replaces the theme's chart color for this series. | --- # Area Chart > A line per series with the space under it filled, overlapping or stacked. Source: https://native.shellui.dev/docs/components/charts/area-chart A line per series with the space under it filled. See [Charts](https://native.shellui.dev/docs/components/charts.md) for how data, colours and updates work in every chart. ## Installation ```bash shellui-native add area-chart ``` **Platforms:** MAUI · Avalonia. Also installs `chart`, the core every chart shares. The chart colours are theme tokens added with the charts, so in a project whose `shell` came from an older CLI, run `shellui-native update shell` first. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=area-chart-basic) ### Stacked Without `IsStacked` the areas overlap, each from zero; with it, each series sits on the one before it, so the top line is the total. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=area-chart-stacked) ## MAUI and Avalonia - MAUI draws the chart in a `GraphicsView`; give it a `HeightRequest`. On touch screens a tap or a drag shows the tooltip. - Avalonia draws it in `Render`, in the control's own font; give it a `Height`. `ChartSeries.Color` is an Avalonia `Color` (`Color.Parse("#E76E50")`). ## API ### AreaChart XAML children go to `Series`. | Property | Type | Default | Description | |---|---|---|---| | `IsSmooth` | `bool` | `true` | Curves the line through its points; false joins them with straight segments. | | `IsStacked` | `bool` | `false` | Stacks the series instead of overlapping them. | | `FillOpacity` | `double` | `0.4` | Opacity of the fill under each line. | | `StrokeWidth` | `double` | `2` | Width of the line along the top of each area. | | `ShowGrid` | `bool` | `true` | Grid lines behind the plot, at each value axis step. | | `ShowXAxis` | `bool` | `true` | The labels under the plot. | | `ShowYAxis` | `bool` | `true` | The labels beside the plot. | | `Minimum` | `double` | Fits the data | The ends of the value axis; by default they fit the data and include zero. | | `Maximum` | `double` | Fits the data | The other end of the value axis; see `Minimum`. | | `Labels` | `ChartLabels` (MAUI) · `ChartLabels?` (Avalonia) | `null` | The category names along the axis, or the slice names of a pie. | | `ShowLegend` | `bool` | `true` | Shows the series (or slice) names with their colours under the chart. | | `ShowTooltip` | `bool` | `true` | Shows the values under the pointer (or the finger). | | `IsAnimated` | `bool` | `true` | Grows the chart in when it first appears. | | `ValueFormat` | `string` | `"#,0.##"` | A .NET number format for axis and tooltip values. | | `EmptyText` | `string` | `"No data"` | Shown when there are no values. | | `Description` | `string` | — | What the chart shows, for screen readers. | | Method | Description | |---|---| | `Refresh()` | Redraws the chart. Call it after changing the numbers inside a series' Values. | | `PlayAnimation()` | Grows the chart in again. | ### ChartSeries | Property | Type | Default | Description | |---|---|---|---| | `Name` | `string` | — | Shown in the legend and the tooltip. | | `Values` | `ChartValues` | Empty | The numbers, one per category. In XAML, a comma-separated list. | | `Color` | `Color?` | `null` | Replaces the theme's chart color for this series. | --- # Pie Chart > Slices of a whole, as a pie or a donut with a value in the middle. Source: https://native.shellui.dev/docs/components/charts/pie-chart The first series' values as slices, clockwise from twelve o'clock, named by `Labels` and coloured from the chart colours in order. The tooltip shows a slice's value and its share of the total. `DonutChart`, in the same file, is a pie with a hole. See [Charts](https://native.shellui.dev/docs/components/charts.md) for how data, colours and updates work in every chart. ## Installation ```bash shellui-native add pie-chart ``` **Platforms:** MAUI · Avalonia. Also installs `chart`, the core every chart shares. The chart colours are theme tokens added with the charts, so in a project whose `shell` came from an older CLI, run `shellui-native update shell` first. ## Usage ### Pie **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=pie-chart-basic) ### Donut `DonutChart` starts with `InnerRadius` at 0.6. `CenterValue` and `CenterLabel` go in the hole; the ShellUI preview has no centre text. Any `PieChart` with an `InnerRadius` above 0 is a donut too. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=donut-chart-basic) Past the fifth slice the colours repeat, fainter. `Gap` sets the space between slices in degrees, and `ShowLabels` writes each value outside its slice. ## MAUI and Avalonia - MAUI draws the chart in a `GraphicsView`; give it a `HeightRequest`. On touch screens a tap or a drag shows the tooltip. - Avalonia draws it in `Render`, in the control's own font; give it a `Height`. `ChartSeries.Color` is an Avalonia `Color` (`Color.Parse("#E76E50")`). ## API ### PieChart XAML children go to `Series`. | Property | Type | Default | Description | |---|---|---|---| | `InnerRadius` | `double` | `0` | The hole, as a share of the radius: 0 is a pie, 0.6 a donut. | | `Gap` | `double` | `1` | Degrees of space between slices. | | `ShowLabels` | `bool` | `false` | Writes each slice's value outside it. | | `CenterValue` | `string` | — | Large text in the hole of a donut. | | `CenterLabel` | `string` | — | Small muted text under CenterValue. | | `Labels` | `ChartLabels` (MAUI) · `ChartLabels?` (Avalonia) | `null` | The category names along the axis, or the slice names of a pie. | | `ShowLegend` | `bool` | `true` | Shows the series (or slice) names with their colours under the chart. | | `ShowTooltip` | `bool` | `true` | Shows the values under the pointer (or the finger). | | `IsAnimated` | `bool` | `true` | Grows the chart in when it first appears. | | `ValueFormat` | `string` | `"#,0.##"` | A .NET number format for axis and tooltip values. | | `EmptyText` | `string` | `"No data"` | Shown when there are no values. | | `Description` | `string` | — | What the chart shows, for screen readers. | | Method | Description | |---|---| | `Refresh()` | Redraws the chart. Call it after changing the numbers inside a series' Values. | | `PlayAnimation()` | Grows the chart in again. | ### ChartSeries | Property | Type | Default | Description | |---|---|---|---| | `Name` | `string` | — | Shown in the legend and the tooltip. | | `Values` | `ChartValues` | Empty | The numbers, one per category. In XAML, a comma-separated list. | | `Color` | `Color?` | `null` | Replaces the theme's chart color for this series. | --- # Radar Chart > A spoke per category around a ringed grid, and a filled shape per series. Source: https://native.shellui.dev/docs/components/charts/radar-chart A spoke per category around a ringed grid, and a filled shape per series, for comparing a few series across the same measures. It needs at least three categories. See [Charts](https://native.shellui.dev/docs/components/charts.md) for how data, colours and updates work in every chart. ## Installation ```bash shellui-native add radar-chart ``` **Platforms:** MAUI · Avalonia. Also installs `chart`, the core every chart shares. The chart colours are theme tokens added with the charts, so in a project whose `shell` came from an older CLI, run `shellui-native update shell` first. ## Usage ### Basic `Maximum` sets the value at the outer ring; by default it fits the data. `ShowDots` marks each point. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=radar-chart-basic) ## MAUI and Avalonia - MAUI draws the chart in a `GraphicsView`; give it a `HeightRequest`. On touch screens a tap or a drag shows the tooltip. - Avalonia draws it in `Render`, in the control's own font; give it a `Height`. `ChartSeries.Color` is an Avalonia `Color` (`Color.Parse("#E76E50")`). ## API ### RadarChart XAML children go to `Series`. | Property | Type | Default | Description | |---|---|---|---| | `Maximum` | `double` | Fits the data | The value at the outer ring; by default it fits the data. | | `FillOpacity` | `double` | `0.5` | Opacity of each series' shape. | | `ShowDots` | `bool` | `false` | A dot on every point. | | `Labels` | `ChartLabels` (MAUI) · `ChartLabels?` (Avalonia) | `null` | The category names along the axis, or the slice names of a pie. | | `ShowLegend` | `bool` | `true` | Shows the series (or slice) names with their colours under the chart. | | `ShowTooltip` | `bool` | `true` | Shows the values under the pointer (or the finger). | | `IsAnimated` | `bool` | `true` | Grows the chart in when it first appears. | | `ValueFormat` | `string` | `"#,0.##"` | A .NET number format for axis and tooltip values. | | `EmptyText` | `string` | `"No data"` | Shown when there are no values. | | `Description` | `string` | — | What the chart shows, for screen readers. | | Method | Description | |---|---| | `Refresh()` | Redraws the chart. Call it after changing the numbers inside a series' Values. | | `PlayAnimation()` | Grows the chart in again. | ### ChartSeries | Property | Type | Default | Description | |---|---|---|---| | `Name` | `string` | — | Shown in the legend and the tooltip. | | `Values` | `ChartValues` | Empty | The numbers, one per category. In XAML, a comma-separated list. | | `Color` | `Color?` | `null` | Replaces the theme's chart color for this series. | --- # Radial Chart > Concentric rings that fill towards a maximum, for progress towards goals. Source: https://native.shellui.dev/docs/components/charts/radial-chart The first series' values as concentric rings on a muted track, each filling clockwise towards `Maximum`; the first value is the outer ring. See [Charts](https://native.shellui.dev/docs/components/charts.md) for how data, colours and updates work in every chart. ## Installation ```bash shellui-native add radial-chart ``` **Platforms:** MAUI · Avalonia. Also installs `chart`, the core every chart shares. The chart colours are theme tokens added with the charts, so in a project whose `shell` came from an older CLI, run `shellui-native update shell` first. ## Usage ### Basic Without `Maximum`, the largest value is a full ring. `InnerRadius` sizes the hole and `IsRounded` rounds the ends of each ring. The ShellUI preview has no centre text. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=radial-chart-basic) ## MAUI and Avalonia - MAUI draws the chart in a `GraphicsView`; give it a `HeightRequest`. On touch screens a tap or a drag shows the tooltip. - Avalonia draws it in `Render`, in the control's own font; give it a `Height`. `ChartSeries.Color` is an Avalonia `Color` (`Color.Parse("#E76E50")`). ## API ### RadialChart XAML children go to `Series`. | Property | Type | Default | Description | |---|---|---|---| | `Maximum` | `double` | The largest value | The value of a full ring; by default the largest value. | | `InnerRadius` | `double` | `0.35` | The hole in the middle, as a share of the radius. | | `IsRounded` | `bool` | `true` | Rounds the ends of each ring. | | `CenterValue` | `string` | — | Large text in the middle. | | `CenterLabel` | `string` | — | Small muted text under CenterValue. | | `Labels` | `ChartLabels` (MAUI) · `ChartLabels?` (Avalonia) | `null` | The category names along the axis, or the slice names of a pie. | | `ShowLegend` | `bool` | `true` | Shows the series (or slice) names with their colours under the chart. | | `ShowTooltip` | `bool` | `true` | Shows the values under the pointer (or the finger). | | `IsAnimated` | `bool` | `true` | Grows the chart in when it first appears. | | `ValueFormat` | `string` | `"#,0.##"` | A .NET number format for axis and tooltip values. | | `EmptyText` | `string` | `"No data"` | Shown when there are no values. | | `Description` | `string` | — | What the chart shows, for screen readers. | | Method | Description | |---|---| | `Refresh()` | Redraws the chart. Call it after changing the numbers inside a series' Values. | | `PlayAnimation()` | Grows the chart in again. | ### ChartSeries | Property | Type | Default | Description | |---|---|---|---| | `Name` | `string` | — | Shown in the legend and the tooltip. | | `Values` | `ChartValues` | Empty | The numbers, one per category. In XAML, a comma-separated list. | | `Color` | `Color?` | `null` | Replaces the theme's chart color for this series. | --- # Alert > A callout for a message that needs attention, with an icon per variant. Source: https://native.shellui.dev/docs/components/feedback/alert ## Installation ```bash shellui-native add alert ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Variants **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=alert-variants) ## API | Property | Type | Default | Description | |---|---|---|---| | `Title` | `string` | — | Heading text. | | `Message` | `string` | — | Body text. | | `Variant` | `AlertVariant` | `Default` | Visual style. One of `Default`, `Destructive`, `Success`, `Warning`, `Info`. | --- # Callout > A highlighted note on a faint tint of its variant colour. Source: https://native.shellui.dev/docs/components/feedback/callout ## Installation ```bash shellui-native add callout ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Variants **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=callout-variants) ## Custom content Anything inside the tag goes under the text: a button, a link, a list. ```xml ``` ## API XAML children go to `Body`. | Property | Type | Default | Description | |---|---|---|---| | `Variant` | `CalloutVariant` | `Info` | Visual style. One of `Info`, `Warning`, `Danger`, `Tip`, `Default`. | | `Title` | `string` | — | Heading text. | | `Text` | `string` | — | Text shown by the component. | | `Icon` | `IconName` | `None` | Icon to use instead of the variant's own; `None` keeps the variant's. | | `Body` | `View` (MAUI) · `Control?` (Avalonia) | `null` | Content under the text. | --- # Skeleton > A pulsing placeholder shown while content loads. Source: https://native.shellui.dev/docs/components/feedback/skeleton ## Installation ```bash shellui-native add skeleton ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=skeleton-basic) ## MAUI and Avalonia `CornerRadius` is a `double` on MAUI and Avalonia's own `CornerRadius` on Avalonia; `CornerRadius="24"` works on both. ## API | Property | Type | Default | Description | |---|---|---|---| | `CornerRadius` | `double` (MAUI) · `CornerRadius` (Avalonia) | 6 | Corner radius; half the height makes a circle. | --- # Spinner > A rotating loading indicator. Source: https://native.shellui.dev/docs/components/feedback/spinner It spins only while it's on screen and `IsRunning` is true. Buttons have their own spinner: set `IsLoading` on a Button instead. ## Installation ```bash shellui-native add spinner ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Sizes **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=spinner-sizes) ## API | Property | Type | Default | Description | |---|---|---|---| | `Size` | `SpinnerSize` | `Default` | Size preset. One of `Sm`, `Default`, `Lg`. | | `Token` | `ShellToken` | `Foreground` | Theme colour token the icon is drawn with. | | `IsRunning` | `bool` | `true` | Spins while true; hidden while false. | --- # Toast > Sonner-style notifications that stack in a corner and dismiss themselves. Source: https://native.shellui.dev/docs/components/feedback/toast Call `Toast.Show` (or `Success`, `Error`, `Warning`, `Info`) from anywhere. Toasts float above the page, pause while hovered, and go after four seconds. ## Installation ```bash shellui-native add toast ``` **Platforms:** MAUI · Avalonia. Also installs `icon`, `button`, `button-variants`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=toast-basic) ```csharp private void OnShow(object? sender, EventArgs e) => Toast.Show("Event has been created", "Sunday, December 03 at 9:00 AM"); private void OnSuccess(object? sender, EventArgs e) => Toast.Success("Profile saved"); private void OnError(object? sender, EventArgs e) => Toast.Error("Upload failed", "The file is larger than 10 MB."); private void OnWarning(object? sender, EventArgs e) => Toast.Warning("Storage almost full", "92% of your quota used."); ``` ## Action A toast can carry one action button. Pressing it runs the action and dismisses the toast: ```csharp Toast.Show("Message archived", actionText: "Undo", action: Unarchive); ``` ## Position Without a `Toaster`, toasts stack in the bottom-right corner, three at a time. Declare one anywhere to change that: ```xml ``` ## MAUI and Avalonia On MAUI the `Toaster` goes on a page; on Avalonia in a window. Without one, `Toast.Show` uses the page (MAUI) or window (Avalonia) on screen. ## API ### Toast | Method | Description | |---|---| | `Toast.Show(string message, string? description = null, ToastVariant variant = ToastVariant.Default, TimeSpan? duration = null, string? actionText = null, Action? action = null)` | Shows a toast and returns its id. | | `Toast.Success(string message, string? description = null, TimeSpan? duration = null, string? actionText = null, Action? action = null)` | Shows a success toast and returns its id. | | `Toast.Error(string message, string? description = null, TimeSpan? duration = null, string? actionText = null, Action? action = null)` | Shows an error toast and returns its id. | | `Toast.Warning(string message, string? description = null, TimeSpan? duration = null, string? actionText = null, Action? action = null)` | Shows a warning toast and returns its id. | | `Toast.Info(string message, string? description = null, TimeSpan? duration = null, string? actionText = null, Action? action = null)` | Shows an info toast and returns its id. | | `Toast.Dismiss(string id)` | Dismisses the toast with this id. | ### Toaster | Property | Type | Default | Description | |---|---|---|---| | `Position` | `ToasterPosition` | `BottomRight` | Corner (or edge) the toasts stack in. One of `BottomRight`, `BottomCenter`, `TopRight`, `TopCenter`. | | `MaxVisible` | `int` | `3` | Most toasts shown at once; older ones are dismissed. | --- # Copy Button > Copies text to the clipboard and confirms with a check mark. Source: https://native.shellui.dev/docs/components/utility/copy-button ## Installation ```bash shellui-native add copy-button ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=copy-button-basic) Set `Label` for a button with text (`Label="Copy link"`) instead of an icon-only one. ## MAUI and Avalonia MAUI copies with `Clipboard.Default`; Avalonia uses the window's clipboard, so the button does nothing until it is in a window. ## API | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text copied to the clipboard. | | `Label` | `string` | — | Button text; empty shows just the icon. | | Event | Arguments | Description | |---|---|---| | `Copied` | — | The text was copied. | | Method | Description | |---|---| | `CopyAsync()` | Copies `Text` to the clipboard, as a press would. | --- # Icon > Lucide stroke icons drawn as native shapes, tinted by theme tokens. Source: https://native.shellui.dev/docs/components/utility/icon The icons come from [ShellIcons](https://github.com/shellui-dev/shell-icons), which derives them from Lucide. No font or package: they're geometry in `Icon.cs`, crisp at any size. ## Installation ```bash shellui-native add icon ``` **Platforms:** MAUI · Avalonia. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=icon-basic) ### Colour `Token` tints the icon with a theme colour, so it follows light and dark mode; `Color` sets a fixed one. **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=icon-colour) ## Names The icon set has 110 icons, chosen for app UI: `Check`, `X`, `Plus`, `Minus`, `Search`, `Filter`, `Settings`, `SlidersHorizontal`, `Pencil`, `Trash`, `Trash2`, `Copy`, `Clipboard`, `Save`, `Download`, `Upload`, `Share`, `Share2`, `ExternalLink`, `Link`, `RefreshCw`, `RotateCcw`, `Undo2`, `Redo2`, `LogIn`, `LogOut`, `Send`, `Paperclip`, `ChevronDown`, `ChevronUp`, `ChevronLeft`, `ChevronRight`, `ChevronsUpDown`, `ChevronsLeft`, `ChevronsRight`, `ArrowLeft`, `ArrowRight`, `ArrowUp`, `ArrowDown`, `ArrowUpRight`, `Menu`, `Ellipsis`, `EllipsisVertical`, `GripVertical`, `House`, `LayoutDashboard`, `PanelLeft`, `Info`, `CircleAlert`, `CircleCheck`, `CircleX`, `CircleHelp`, `TriangleAlert`, `Ban`, `Loader`, `LoaderCircle`, `Bell`, `Circle`, `CirclePlus`, `Dot`, `User`, `Users`, `UserPlus`, `Lock`, `LockOpen`, `Key`, `Shield`, `Eye`, `EyeOff`, `Mail`, `Inbox`, `Archive`, `MessageCircle`, `Phone`, `Calendar`, `Clock`, `Globe`, `MapPin`, `Image`, `File`, `FileText`, `Folder`, `Tag`, `Bookmark`, `Heart`, `Star`, `ThumbsUp`, `ShoppingCart`, `CreditCard`, `DollarSign`, `Activity`, `TrendingUp`, `ChartColumn`, `Zap`, `Sparkles`, `Command`, `Terminal`, `Code`, `Moon`, `Sun`, `Monitor`, `Smartphone`, `Laptop`, `Wifi`, `Camera`, `Mic`, `Play`, `Pause`, `Volume2`, `Lightbulb`. Icons are generated from ShellIcons by `scripts/generate-icons.py` in the shellui-native repository; add names there to include more. ## MAUI and Avalonia The icon is picked with `Name` on MAUI and `Kind` on Avalonia, because every Avalonia control already has a `Name`. ## API | Property | Type | Default | Description | |---|---|---|---| | `Name` | `IconName` | `None` | Icon to draw. MAUI only. | | `Size` | `double` | `16` | Width and height, in device-independent units. | | `StrokeWidth` | `double` | `2` | Line thickness, in the icon's 24-unit grid. | | `Token` | `ShellToken` | `Foreground` | Theme colour token the icon is drawn with. | | `Color` | `Color` (MAUI) · `Color?` (Avalonia) | `null` | Explicit color; overrides Token when set. | | `Kind` | `IconName` | `None` | Icon to draw. Avalonia only. | --- # Theme Toggle > A button that switches between light and dark mode. Source: https://native.shellui.dev/docs/components/utility/theme-toggle ## Installation ```bash shellui-native add theme-toggle ``` **Platforms:** MAUI · Avalonia. Also installs `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=theme-toggle-basic) From code, `ShellTheme` does the same: ```csharp ShellTheme.ToggleTheme(); var dark = ShellTheme.IsDarkMode; ``` ## API | Event | Arguments | Description | |---|---|---| | `ThemeChanged` | `bool` | The theme switched between light and dark. | | Method | Description | |---|---| | `Toggle()` | Opens it if closed, closes it if open. | --- # Blocks > Ready-made screens built from the components, numbered like ShellUI's dashboard-01. Source: https://native.shellui.dev/docs/blocks > **Next release** > > On the main branch of shellui-native; not in the 0.2.0-beta.1 CLI yet. A block is a whole screen built from the components: an app shell with a [bottom nav](https://native.shellui.dev/docs/components/navigation/bottom-nav.md), or a page with an [edge menu](https://native.shellui.dev/docs/components/navigation/edge-menu.md). `add` writes one file you own to `Components/Blocks/` (namespace `.Components.Blocks`, next to `Components/UI` or `Components/Native`) and installs the components it uses. Each block is a plain view in C#: use it as a page's content and edit it like any other code. The previews are the Avalonia blocks at a phone's size, running in your browser. ## Using a block ```bash shellui-native add bottom-nav-01 ``` **MAUI** ```csharp using MyApp.Components.Blocks; var shell = new BottomNav01(); shell.Pages["home"] = new HomeView(); // one view per tab Value shell.Pages["cards"] = new CardsView(); shell.ActionClicked += (_, _) => StartPayment(); Content = shell; ``` **Avalonia** ```csharp using MyApp.Components.Blocks; var shell = new BottomNav01(); shell.Pages["home"] = new HomeView(); // one view per tab Value shell.Pages["cards"] = new CardsView(); shell.ActionClicked += (_, _) => StartPayment(); Content = shell; ``` Until you put your views in `Pages`, each tab shows a placeholder page: a title over grey cards. Change the tabs, their icons and the variant in the file itself. | Member | Blocks | Description | |---|---|---| | `Pages` | bottom-nav-01 to 05 | One view per tab, keyed by the item's `Value`: `Dictionary` on MAUI, `Dictionary` on Avalonia. | | `Nav` | bottom-nav-01 to 05 | The `BottomNav`, to change the items or the selection. | | `Show(value)` | bottom-nav-01 to 05 | Shows the page for a tab `Value`. A tap on a tab does it; call it after setting `Nav.SelectedValue` from code. | | `ActionClicked` | bottom-nav-01 | The round Pay button in the middle was pressed. | | `Page` | edge-menu-01 | The view under the menu: `View?` on MAUI, `Control?` on Avalonia. | | `Menu` | edge-menu-01 | The `EdgeMenu`, to change the tiles. | | `ToolPicked` | edge-menu-01 | A tile was picked; passes its `Value`. | ## Bottom nav ### bottom-nav-01 An app shell like a wallet app's: a tab bar with a raised Pay button in the middle and the user's avatar on the last tab, with a count badge on Alerts and a dot on the avatar. The active tab is in the primary colour. Uses `bottom-nav` and `avatar`. ```bash shellui-native add bottom-nav-01 ``` [Live preview](https://native.shellui.dev/preview/index.html?c=block-bottom-nav-01) ### bottom-nav-02 An app shell with a Material 3 tab bar: a pill grows behind the active icon. Uses `bottom-nav`. ```bash shellui-native add bottom-nav-02 ``` [Live preview](https://native.shellui.dev/preview/index.html?c=block-bottom-nav-02) ### bottom-nav-03 An app shell with a floating tab bar over the page that slides away while the page scrolls down; only the active tab shows its label. Uses `bottom-nav`. ```bash shellui-native add bottom-nav-03 ``` [Live preview](https://native.shellui.dev/preview/index.html?c=block-bottom-nav-03) ### bottom-nav-04 An app shell with a compact capsule of icons; the active one widens into a pill with its label. The capsule slides away while the page scrolls down too. Uses `bottom-nav`. ```bash shellui-native add bottom-nav-04 ``` [Live preview](https://native.shellui.dev/preview/index.html?c=block-bottom-nav-04) ### bottom-nav-05 An app shell whose active tab rises into a circle over the bar; the bar slides away while the page scrolls down. Uses `bottom-nav`. ```bash shellui-native add bottom-nav-05 ``` [Live preview](https://native.shellui.dev/preview/index.html?c=block-bottom-nav-05) ## Edge menu ### edge-menu-01 A page with a dock of tools on its right edge: a solid rail of five tiles (Settings, Notes, Calendar, Images, Camera) that dims the page while open. Put your view in `Page`, change the tiles to your tools and handle `ToolPicked`. Uses `edge-menu`. ```bash shellui-native add edge-menu-01 ``` **MAUI** ```csharp var page = new EdgeMenu01 { Page = new NotesView() }; page.ToolPicked += (_, tool) => OpenTool(tool); // "settings", "notes", "calendar", ... Content = page; ``` **Avalonia** ```csharp var page = new EdgeMenu01 { Page = new NotesView() }; page.ToolPicked += (_, tool) => OpenTool(tool); // "settings", "notes", "calendar", ... Content = page; ``` [Live preview](https://native.shellui.dev/preview/index.html?c=block-edge-menu-01) --- # Release notes > What's in each ShellUI Native release, and what's coming next. Source: https://native.shellui.dev/docs/release-notes ## Next release On the main branch of shellui-native, not on NuGet yet. Each of these has a MAUI and an Avalonia version. - **[Bottom Nav](https://native.shellui.dev/docs/components/navigation/bottom-nav.md).** A mobile tab bar in five styles (`Default`, `Pill`, `Floating`, `Lifted`, `Expanding`), with badges, dots, an avatar tab, a raised action button and hiding while the page scrolls. - **[Edge Menu](https://native.shellui.dev/docs/components/navigation/edge-menu.md).** A handle on a screen edge that slides out a rail of tool tiles. - **[Blocks](https://native.shellui.dev/docs/blocks.md).** Ready-made screens installed with `add`, like `bottom-nav-01`: five app shells with a bottom nav and a page with an edge menu. ## 0.2.0-beta.1 Released 15 October 2026. The first beta: 18 new components, among them charts, a data table and a command palette, each for .NET MAUI and Avalonia. Change events now report user input only, so read **Upgrading** before you update an existing app. ```bash dotnet tool update -g ShellUI.Native.CLI --prerelease ``` **New components.** 81 component families, 112 CLI targets in all. - **[Button Group](https://native.shellui.dev/docs/components/form/button-group.md).** Buttons joined into one control. - **[Input Group](https://native.shellui.dev/docs/components/form/input-group.md).** A text field with an icon, a short text or any view before or after the text. - **[Menubar](https://native.shellui.dev/docs/components/navigation/menubar.md).** A row of menus, like a desktop app's File, Edit and View. - **[Command](https://native.shellui.dev/docs/components/navigation/command.md).** A search field over a list of grouped commands, plus `CommandPalette`, the same list in a dialog. - **[Navigation Menu](https://native.shellui.dev/docs/components/navigation/navigation-menu.md).** Top-level links for an app header, where an item can open a panel of links. - **[Data Table](https://native.shellui.dev/docs/components/data-display/data-table.md).** A table filled from a list, with a filter, sortable columns, row selection and pages. - **[Chat](https://native.shellui.dev/docs/components/data-display/chat.md).** A conversation panel with message bubbles, a typing indicator and a message box. - **[Form](https://native.shellui.dev/docs/components/form/form.md).** Fields with a label, a description and an error message. - **[Image Viewer](https://native.shellui.dev/docs/components/data-display/image-viewer.md).** A thumbnail that opens the image over the page, with zoom. - **[Prev Next Nav](https://native.shellui.dev/docs/components/navigation/prev-next-nav.md).** Previous and next page links for the foot of a page. - **[Charts](https://native.shellui.dev/docs/components/charts.md).** Bar, line, area, pie, donut, radar and radial charts, drawn by the components with no charting package, in five new theme colours (`Chart1` to `Chart5`). **Change events report user input only.** `Toggled`, `CheckedChanged`, `ValueChanged`, `SelectedIndexChanged`, `SelectedValueChanged`, `PageChanged`, `DateChanged`, `TimeChanged`, `ItemToggled` and the other value and selection events now fire only when the user changes the value (a click, tap, swipe or key), like Radix's `onValueChange`. Setting the value from code or a binding doesn't raise them. Methods meant for code are silent too: `MultiSelect.Toggle`, `TagInput.Add` / `Remove`, `DataTable.ClearSelection`, `DateRangePicker.Clear`, `Stepper.Next` / `Previous`, `Carousel.Next` / `Previous` and its auto-play, `Accordion.Toggle`, `Collapsible.Toggle`. Still reporting every change: text fields' `TextChanged`, overlays' `OpenChanged` / `IsOpenChanged`, `ThemeChanged`, `FileUpload.FilesChanged` and `Sidebar.IsCollapsedChanged`. **CLI.** - In a project that also uses ShellUI for Blazor (it has a `shellui.json`), `init` puts the components in `Components/Native` with the namespace `YourApp.Components.Native`, so the two sets don't clash. The namespace follows the `ComponentsPath` setting. - An unknown name gets suggestions: `shellui-native add donut` answers "Did you mean 'donut-chart'?". - `update shell` and `update --all` include the `shell` utility; projects set up by an older CLI are picked up from the file. **Fixes and additions.** - `shell` builds in a MAUI Blazor Hybrid app; the app's `Components.Layout` namespace used to hide MAUI's `Layout` type (CS0118). - `SheetContent.MaxPanelWidth` sets how wide a left or right sheet gets (384 by default, never more than 75% of the window). - The MAUI `ShellLabel` gains `HorizontalTextAlignment` and `LineBreakMode` (Avalonia's is a `TextBlock` and already has them). **Upgrading from alpha.2.** Installing the new tool doesn't change the components already in your project; `update` rewrites a component's file, so reapply any edits you made to it. - Before adding a chart, run `shellui-native update shell`: it holds the chart colours and the Blazor Hybrid fix. - Before adding `button-group`, run `shellui-native update button`. - Your components keep their old event behaviour until you update them. To move everything at once, run `shellui-native update --all`, then check handlers that relied on values set from code raising events. - Coming from alpha.1, also run `shellui-native update calendar` before adding `date-range-picker`. **Known limitations.** The components were checked on Windows, for MAUI and Avalonia; CI builds the Avalonia demo on Linux, Windows and macOS, but they haven't been run on macOS, Linux, Android or iOS yet. On Windows, MAUI buttons and sidebar items can't be pressed through UI Automation (Narrator, test tools): [#25](https://github.com/shellui-dev/shellui-native/issues/25). The full list is in the [release on GitHub](https://github.com/shellui-dev/shellui-native/releases/tag/v0.2.0-beta.1). ## 0.1.0-alpha.2 Released 11 October 2026. Avalonia support and five new components: every component now has a .NET MAUI and an Avalonia version, installed by the same commands. ```bash dotnet tool update -g ShellUI.Native.CLI --prerelease ``` - **Avalonia.** All 63 component families (94 CLI targets) have an Avalonia 12 version with the same names, properties and variants as MAUI. Where a platform does something differently, the component's page says so under **MAUI and Avalonia**. `init` detects an Avalonia project and prints the setup steps, and `list` shows the components for the project's platform. - **Overlays on Avalonia.** Menus and popovers flip above their trigger when there's no room below, a click outside or Escape closes them, and open dialogs, drawers and sheets keep keyboard focus inside and give it back when they close. - **Keyboard on Avalonia.** Interactive parts are tab stops with shadcn's focus ring, and Enter and Space activate them. - **New components**, for both platforms: [Resizable](https://native.shellui.dev/docs/components/layout/resizable.md), [Navbar](https://native.shellui.dev/docs/components/navigation/navbar.md), [Sidebar](https://native.shellui.dev/docs/components/navigation/sidebar.md), [Date Range Picker](https://native.shellui.dev/docs/components/form/date-range-picker.md) and [File Upload](https://native.shellui.dev/docs/components/form/file-upload.md). `Calendar` gains `RangeStart` and `RangeEnd`, which highlight a span of days. - **CLI.** `init` derives a valid namespace when the project file has no `RootNamespace`. Upgrading from alpha.1: installing the new tool doesn't change the components already in your project. `date-range-picker` needs the new `Calendar`, so if `calendar` is already in your project, run `shellui-native update calendar` before adding it. `update` rewrites the file, so reapply any edits you made to it. Known limitations: Avalonia was checked on Windows only (the demo builds on Linux and macOS in CI); the five new components were checked on Windows and only compile for Android, iOS and Mac Catalyst; File Upload's platform file dialog and file drop haven't been tested beyond the build; very large MAUI pages on Windows can hit WinUI's layout-pass limit. ## 0.1.0-alpha.1 Released 7 October 2026. The first public prerelease: copy-and-own components for **.NET MAUI** with the same design tokens as ShellUI for Blazor. - **58 component families, 89 CLI targets.** Parts such as `dialog-trigger` belong to a family; adding one installs the whole family. - **Theme tokens.** `ShellTheme` holds light and dark palettes keyed like ShellUI's CSS variables and publishes them as `ShellUI` and `ShellUIBrush` resources. - **Sizing.** Every single-line form control is 40px high, like shadcn's `h-10`. - **Icons.** About 110 Lucide icons from ShellIcons, drawn as MAUI shapes, with no icon font or package. - **Overlays.** Dialogs, drawers, sheets, menus, selects, tooltips, hover cards and toasts float in a page-level layer, so you declare them next to their trigger. Escape (Windows) and Back (Android) close the one on top. - **Custom pickers.** Select, Combobox, Date Picker and Time Picker draw their own panels, with no native picker chrome. - **CLI:** `init`, `add`, `list`, `remove` and `update`. Known limitations: tested on Windows and Android only; Escape doesn't close overlays on Mac Catalyst yet; very large pages on Windows can hit WinUI's layout-pass limit.