Resizable
Panels side by side or stacked, with a divider you drag to resize them.
ShellUI for Blazor's Resizable doesn't drag, so the preview below is a still picture of the native component.
Installation
bash
shellui-native add resizable
Platforms: MAUI · Avalonia.
Usage
Basic
One
Two
Three
<ui:Resizable HeightRequest="220">
<ui:ResizablePanel Size="1" MinSize="100">
<Label Text="One" HorizontalOptions="Center" VerticalOptions="Center" />
</ui:ResizablePanel>
<ui:ResizablePanel Size="2" MinSize="140">
<ui:Resizable Orientation="Vertical">
<ui:ResizablePanel Size="1">
<Label Text="Two" HorizontalOptions="Center" VerticalOptions="Center" />
</ui:ResizablePanel>
<ui:ResizablePanel Size="2">
<Label Text="Three" HorizontalOptions="Center" VerticalOptions="Center" />
</ui:ResizablePanel>
</ui:Resizable>
</ui:ResizablePanel>
</ui:Resizable><ui:Resizable Height="220">
<ui:ResizablePanel Size="1" MinSize="100">
<TextBlock Text="One" HorizontalAlignment="Center" VerticalAlignment="Center" />
</ui:ResizablePanel>
<ui:ResizablePanel Size="2" MinSize="140">
<ui:Resizable Orientation="Vertical">
<ui:ResizablePanel Size="1">
<TextBlock Text="Two" HorizontalAlignment="Center" VerticalAlignment="Center" />
</ui:ResizablePanel>
<ui:ResizablePanel Size="2">
<TextBlock Text="Three" HorizontalAlignment="Center" VerticalAlignment="Center" />
</ui:ResizablePanel>
</ui:Resizable>
</ui:ResizablePanel>
</ui:Resizable>Not available on yet
Size is a panel's share of the space: a panel with Size="2" gets twice as much as one with Size="1". Dragging a divider moves space between its two neighbours, and neither goes under its MinSize. Groups nest, so a panel can hold another Resizable with the other orientation. Give the outer group a size.
MAUI and Avalonia
- On Avalonia the dividers are tab stops: the arrow keys move a focused divider 16px.
- The Avalonia pointer shows a resize cursor over a divider.
API
Resizable
XAML children go to Panels.
| Property | Type | Default | Description |
|---|---|---|---|
Orientation |
StackOrientation (MAUI) · Orientation (Avalonia) |
Horizontal |
Horizontal or Vertical. |
ShowHandle |
bool |
true |
Shows the short bar on each divider; the divider drags with or without it. |
| Event | Arguments | Description |
|---|---|---|
Resized |
— | A drag ended. |
ResizablePanel
| Property | Type | Default | Description |
|---|---|---|---|
Size |
double |
1 |
The panel's share of the space: 2 gets twice as much as 1. Two-way bindable. |
MinSize |
double |
48 |
The smallest the panel can be dragged to, in device-independent pixels. |