axiom-swiftui-layout

Create SwiftUI layouts that adapt to container size using ViewThatFits, AnyLayout, and onGeometryChange.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/pradeepmouli/swift-template --skill axiom-swiftui-layout-pradeepmouli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: axiom-swiftui-layout
Source: https://github.com/pradeepmouli/swift-template/tree/main/.agents/skills/axiom-swiftui-layout
Command: npx skills add https://github.com/pradeepmouli/swift-template --skill axiom-swiftui-layout-pradeepmouli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Discipline-enforcing skill for building layouts that respond to available space rather than device assumptions. Covers tool selection, size class limitations, iOS 26 free-form windows, and common anti-patterns.

Core Features & Use Cases

  • ViewThatFits to pick the first layout that fits among alternatives.
  • AnyLayout for animated transitions and state-aware switching.
  • onGeometryChange to read container size and thresholds for adaptive logic.
  • GeometryReader usage guidance and anti-pattern avoidance for robust layouts.

Quick Start

Design a SwiftUI layout that adapts to available space using onGeometryChange, ViewThatFits, or AnyLayout as the container dictates.

Frequently Asked Questions about axiom-swiftui-layout

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build adaptive SwiftUI layouts that respond to container size instead of device type?

Adaptive SwiftUI layouts use ViewThatFits, AnyLayout, and onGeometryChange to read container dimensions and switch layouts dynamically, ensuring interfaces fit available space rather than relying on device identity.

What is the best way to handle SwiftUI layout changes during iPad multitasking or Stage Manager?

Use onGeometryChange to monitor container size thresholds and AnyLayout for animated transitions, allowing your SwiftUI layout to adapt smoothly as iPad multitasking or Stage Manager windows resize.

How does ViewThatFits work for selecting between multiple SwiftUI layout options?

ViewThatFits evaluates multiple layout alternatives in order and automatically applies the first one that fits the available container space, making it ideal for responsive SwiftUI design without manual size checks.

When should I avoid GeometryReader in SwiftUI and what are the common anti-patterns?

GeometryReader should be avoided when it pushes layout decisions upstream or breaks parent sizing, common anti-patterns this approach addresses by preferring onGeometryChange and geometry-based thresholds for robust adaptive layouts.

Can I animate transitions between different SwiftUI layouts using AnyLayout?

AnyLayout enables animated, state-aware transitions between different SwiftUI layout containers, allowing smooth visual switches when container size or layout thresholds change dynamically.

Does this adaptive layout approach support iOS 26 free-form windows?

Yes, this approach targets iOS 26 free-form window resizing features by using geometry-based thresholds and ViewThatFits to adapt layouts to arbitrary container sizes rather than fixed device assumptions.