Wrap Layout

Lays its children out left to right and wraps them onto new rows.

ShellUI for Blazor has no twin (CSS does this with flex-wrap), so the preview below is a flex-wrap row of ShellUI buttons. On Avalonia, use the built-in WrapPanel.

Installation

bash
shellui-native add wrap-layout

Platforms: MAUI · Avalonia.

Usage

Basic

Rendered with CSS flex-wrap
<ui:WrapLayout Spacing="8" LineSpacing="8">
    <ui:Button Text="Default" />
    <ui:Button Text="Secondary" Variant="Secondary" />
    <ui:Button Text="Outline" Variant="Outline" />
    <ui:Button Text="Ghost" Variant="Ghost" />
    <ui:Button Text="Destructive" Variant="Destructive" />
    <ui:Button Text="Link" Variant="Link" />
</ui:WrapLayout>
Avalonia, running in your browser

MAUI and Avalonia

  • MAUI's WrapLayout has Padding; the Avalonia one is a Panel without it.
  • Avalonia's own WrapPanel covers plain wrapping. Use WrapLayout there for LastChildFill, which lets the last child take the rest of its row.

API

Property Type Default Description
Spacing double 8 Gap between children in a row.
LineSpacing double 8 Gap between rows.
LastChildFill bool false The last child takes what is left of its row (or a row of its own when less than MinimumLastChildWidth remains) — e.g. the text field after a run of chips.
MinimumLastChildWidth double 96 Smallest width the stretched last child may take before it wraps.
Method Description
Measure(double widthConstraint, double heightConstraint) MAUI only.
ArrangeChildren(Rect bounds) MAUI only.

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.