Install
$ agentstack add skill-linuxdevel-avalonia-skills-layout-patterns ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Layout Patterns
Breakpoints
Avalonia desktop windows have no fixed viewport, so define your own breakpoint conventions and react in code-behind or via OnSizeChanged. Recommended scale:
| Name | Width | Typical | |---|---|---| | Compact | = 640 && e.NewSize.Width = 1024 && e.NewSize.Width = 1440); }
Then style by class:
```xml
For more granular containers, use ContainerQuery (see avalonia-styling).
Layout Templates
App Shell — Sidebar + Content + Right Panel
Hide the right rail on compact/medium:
Border:nth-child(3)">
Master-Detail with SplitView
For mobile-style adaptive: bind DisplayMode to a converter on window width — Inline on wide, Overlay on compact.
Dashboard Grid (Cards)
For responsive columns, swap to WrapPanel with min card widths:
…and set MinWidth="280" MaxWidth="360" on the card.
For powerful auto-grid behavior, use AvaloniaAutoGrid or custom Layout with ItemsRepeater.
Settings Page
MaxWidth="720" keeps reading length sane on ultrawide.
Centered Single-Column (auth, onboarding)
Navigation Pattern Selection
| Pattern | Use when | Avalonia mechanism | |---|---|---| | Sidebar nav (vertical) | Desktop app, ≤8 top-level destinations | SplitView or FluentAvalonia NavigationView PaneDisplayMode="Left" | | Top tab nav | ≤5 destinations, content-focused | TabControl | | Bottom nav | Mobile, ≤5 destinations | FluentAvalonia NavigationView PaneDisplayMode="LeftMinimal" (mobile-styled) or custom Grid with RadioButtons | | Hamburger drawer | Many destinations + secondary nav | SplitView DisplayMode="Overlay" with toggle | | Command palette | Power users, search-driven | Custom modal with TextBox + filtered ListBox; bind Ctrl+K | | Breadcrumb | Hierarchical content (file system, settings) | Custom ItemsControl with separator template |
Never mix sidebar + bottom nav at the same hierarchy level.
Adaptive nav (single source of truth)
NavigationView.PaneDisplayMode = window.Bounds.Width switch
{
NavigationViewPaneDisplayMode.LeftMinimal,
NavigationViewPaneDisplayMode.LeftCompact,
_ => NavigationViewPaneDisplayMode.Left
};
Spacing Rhythm in Layouts
- Page padding: 24–32 px on desktop, 16 px on compact.
- Section spacing:
Space6(24 px) between major sections,Space4(16 px) within. - Card padding:
PaddingCard(20 px). StackPanel.Spacinginstead of per-childMargin(cleaner, less drift).
Avoid Margin and Padding collision — pick one.
ScrollViewer Discipline
- Wrap only the scrollable region, not the whole window — let headers/footers stay fixed.
- One vertical scroll axis per view; nested scroll regions break wheel/trackpad UX.
- Set
HorizontalScrollBarVisibility="Disabled"on vertical lists to prevent accidental horizontal scroll. - For long lists, use a
VirtualizingStackPanel(default inListBox/ItemsRepeater) — never a regularStackPanelfor 100+ items.
For grid virtualization, use ItemsRepeater with StackLayout or UniformGridLayout.
Window Chrome
Hints:
PreferSystemChrome— keep OS controls (recommended).NoChrome— fully custom (provide your own min/max/close buttons).OSXThickTitleBar— macOS thicker bar with traffic lights inset.
Reserve 40 px top safe area for the drag region. Add a DragRegion element with IsHitTestVisible="True" and listen for pointer drag if going chromeless.
Mobile-Specific (Avalonia.Mobile)
- Use
SafeAreaPaddingfromTopLevel.InsetsManager:
``csharp var insets = TopLevel.GetTopLevel(this)!.InsetsManager; insets.DisplayEdgeToEdge = true; ``
- Bottom nav must respect home-indicator inset.
- Touch targets ≥44×44 dp.
- One vertical scroll axis only.
Common Mistakes
- Fixed pixel widths on the whole layout — breaks at small windows. Use
*Grid columns. StackPanelfor a 500-item list — laggy; useListBox/ItemsRepeater(virtualized).- Two vertical scroll regions stacked — wheel doesn't know which to scroll.
- No
MaxWidthon long-form text — line length exceeds 90 chars and hurts readability. - Sidebar always visible at 800px window — content gets cramped; collapse to overlay.
- Putting nav in a
Windowand content in aWindowseparately — single-window app should useSplitView/NavigationView. - Hardcoded margins like
12,8,15,4— break the spacing scale; use tokens. - Forgetting
RowDefinitions="Auto,*"— content expands wrongly. - Mixing
DockPanelandGridsemantics in the same panel — confusing layout. Pick one root layout per scope.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: linuxdevel
- Source: linuxdevel/Avalonia-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.