Toggle

A two-state button that stays pressed.

Installation

bash
shellui-native add toggle

Platforms: MAUI · Avalonia. Also installs icon.

Usage

Basic

Rendered with ShellUI for Blazor
<ui:Toggle Icon="Star" />
<ui:Toggle Icon="Star" Text="Favourite" IsPressed="True" />
<ui:Toggle Text="Outline" Variant="Outline" />
<ui:Toggle Text="Small" Size="Sm" Variant="Outline" />
<ui:Toggle Text="Disabled" IsEnabled="False" />
Avalonia, running in your browser

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.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.