AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Avalonia Pro Max/layout Patterns

skill-linuxdevel-avalonia-skills-layout-patterns · by linuxdevel

Use when designing the page-level layout of an Avalonia app — responsive breakpoints, sidebar vs top-nav vs bottom-nav, dashboard grids, master-detail, settings page, mobile vs desktop adaptive layouts. Covers Grid, DockPanel, SplitView, NavigationView, ItemsRepeater layout strategies.

No reviews yet
0 installs
31 views
0.0% view→install

Install

$ agentstack add skill-linuxdevel-avalonia-skills-layout-patterns

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No 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.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-linuxdevel-avalonia-skills-layout-patterns)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
5mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

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 →
Are you the author of Avalonia Pro Max/layout Patterns? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

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.Spacing instead of per-child Margin (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 in ListBox/ItemsRepeater) — never a regular StackPanel for 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 SafeAreaPadding from TopLevel.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.
  • StackPanel for a 500-item list — laggy; use ListBox/ItemsRepeater (virtualized).
  • Two vertical scroll regions stacked — wheel doesn't know which to scroll.
  • No MaxWidth on 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 Window and content in a Window separately — single-window app should use SplitView/NavigationView.
  • Hardcoded margins like 12,8,15,4 — break the spacing scale; use tokens.
  • Forgetting RowDefinitions="Auto,*" — content expands wrongly.
  • Mixing DockPanel and Grid semantics 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.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.