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
<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><ui:Collapsible>
<ui:CollapsibleTrigger>
<ui:Button Text="@shewart starred 3 repositories" Icon="ChevronsUpDown" IconPosition="Right" Variant="Ghost" />
</ui:CollapsibleTrigger>
<ui:CollapsibleContent>
<StackPanel 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" />
</StackPanel>
</ui:CollapsibleContent>
</ui:Collapsible>Not available on yet
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.