# 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. |