Copy Button

Copies text to the clipboard and confirms with a check mark.

Installation

bash
shellui-native add copy-button

Platforms: MAUI · Avalonia. Also installs icon.

Usage

Basic

Rendered with ShellUI for Blazor
shellui-native add button
<Border StrokeShape="RoundRectangle 6" Padding="12,4,4,4" HorizontalOptions="Start">
    <HorizontalStackLayout Spacing="8">
        <Label Text="shellui-native add button" FontFamily="monospace" VerticalOptions="Center" />
        <ui:CopyButton Text="shellui-native add button" Copied="OnCopied" />
    </HorizontalStackLayout>
</Border>
Avalonia, running in your browser

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.

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.