Collapsible

Shows and hides a section, animating its height.

Installation

bash
shellui-native add collapsible

Platforms: MAUI · Avalonia. Also installs element-extensions, collapsible-trigger, collapsible-content.

Usage

Basic

Rendered with ShellUI for Blazor
<ui:Collapsible>
    <ui:CollapsibleTrigger>
        <ui:Button Text="@shewart starred 3 repositories" Icon="ChevronsUpDown" IconPosition="Right" Variant="Ghost" />
    </ui:CollapsibleTrigger>
    <ui:CollapsibleContent>
        <VerticalStackLayout Spacing="8">
            <ui:ShellLabel Text="shellui-dev/shellui" Size="Sm" />
            <ui:ShellLabel Text="shellui-dev/shellui-native" Size="Sm" />
            <ui:ShellLabel Text="shellui-dev/shell-icons" Size="Sm" />
        </VerticalStackLayout>
    </ui:CollapsibleContent>
</ui:Collapsible>
Avalonia, running in your browser

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.

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.