Skip to content
Skillpedia
Interfaces (UI/UX)48k · #2232

avalonia-layout-zafiro

Teaches how to organize the visual appearance of programs made with Avalonia. Focuses on using styles and components that work for many parts.

What it does

This guide teaches how to create beautiful and maintainable user interfaces for Avalonia applications. It focuses on using smart components and shared styles to avoid repetition and simplify code.

When to use it

  • ✓When starting a new Avalonia project and wanting a good structure.
  • ✓When you need to organize or improve your app's visual styles.
  • ✓If you're having trouble organizing a screen's layout.

Example of what to ask your AI

“How can I organize the visual styles in my Avalonia app so they are easy to reuse?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/avalonia-layout-zafiro/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/avalonia-layout-zafiro/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The AI reads instructions on how to organize layouts in Avalonia, focusing on using ready-made components and shared styles. It avoids code repetition and suggests the best way to structure screens.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill avalonia-layout-zafiro

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/avalonia-layout-zafiro/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Avalonia Layout with Zafiro.Avalonia

Master modern, clean, and maintainable Avalonia UI layouts. Focus on semantic containers, shared styles, and minimal XAML.

🎯 Selective Reading Rule

Read ONLY files relevant to the layout challenge!


📑 Content Map

File Description When to Read
themes.md Theme organization and shared styles Setting up or refining app themes
containers.md Semantic containers (HeaderedContainer, EdgePanel, Card) Structuring views and layouts
icons.md Icon usage with IconExtension and IconOptions Adding and customizing icons
behaviors.md Xaml.Interaction.Behaviors and avoiding Converters Implementing complex interactions
components.md Generic components and avoiding nesting Creating reusable UI elements

🔗 Related Project (Exemplary Implementation)

For a real-world example, refer to the Angor project: /mnt/fast/Repos/angor/src/Angor/Avalonia/Angor.Avalonia.sln


✅ Checklist for Clean Layouts

  • Used semantic containers? (e.g., HeaderedContainer instead of Border with manual header)
  • Avoided redundant properties? Use shared styles in axaml files.
  • Minimized nesting? Flatten layouts using EdgePanel or generic components.
  • Icons via extension? Use {Icon fa-name} and IconOptions for styling.
  • Behaviors over code-behind? Use Interaction.Behaviors for UI-logic.
  • Avoided Converters? Prefer ViewModel properties or Behaviors unless necessary.

❌ Anti-Patterns

DON'T:

  • Use hardcoded colors or sizes (literals) in views.
  • Create deep nesting of Grid and StackPanel.
  • Repeat visual properties across multiple elements (use Styles).
  • Use IValueConverter for simple logic that belongs in the ViewModel.

DO:

  • Use DynamicResource for colors and brushes.
  • Extract repeated layouts into generic components.
  • Leverage Zafiro.Avalonia specific panels like EdgePanel for common UI patterns.

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
FAQ

What are 'semantic containers'?

These are UI building blocks that already have a clear function, like a header or a side panel, instead of using generic elements and having to configure them manually.

Why should I avoid 'redundant properties'?

Repeating the same visual settings (colors, sizes) in multiple places makes the code larger and harder to update. Using shared styles solves this.

What are 'anti-patterns'?

These are common practices that seem to work but cause problems in the future, such as maintenance difficulties or performance issues. This guide shows what to avoid.

Details

Original description by the author

Guidelines for modern Avalonia UI layout using Zafiro.Avalonia, emphasizing shared styles, generic components, and avoiding XAML redundancy.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#2232
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills