# swiftui-layout-components

Guides SwiftUI screen layouts built from stacks, grids, lists, forms, and controls. Use it for settings, collections, and scrollable views.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 4200 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swiftui-layout-components/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/swiftui-layout-components

## What it does

The skill explains when to choose regular stacks and when lazy containers fit large or changing collections. It also covers adaptive grids and `List` sections with row actions. Regular stacks create their children at once, so that choice matters for dynamic content.

Other topics include `ScrollView`, programmatic movement with `ScrollPosition`, forms using `Toggle`, `Picker`, and `Slider`, search with `.searchable`, and overlay patterns. The material targets iOS 26+ and Swift 6.3; many patterns work back to iOS 17 unless a section says otherwise. A `GeometryReader` inside a lazy container forces eager measurement, defeating lazy loading; `.onGeometryChange` is offered for reading dimensions instead.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-layout-components -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/swiftui-layout-components/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/swiftui-layout-components/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-layout-components -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/swiftui-layout-components/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-layout-components -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/swiftui-layout-components/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills swiftui-layout-components
```

2. **Manually: put the files in place**
- File: `.github/skills/swiftui-layout-components/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-layout-components -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swiftui-layout-components
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/swiftui-layout-components/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-layout-components -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swiftui-layout-components/SKILL.md

## When to use it
- choose a container for fixed content or a changing collection
- build an adaptive grid for a gallery
- create a settings list with sections and row actions
- scroll programmatically to an item or edge
- compose an input form with toggles and selection controls

## Example prompts
- Build an adaptive SwiftUI gallery grid from `items`.
- Create a settings screen with sections, toggles, and a theme picker.
- Add programmatic scrolling to the latest message in this list.

## Similar
- [vercel-react-native-skills](https://affpapa.org/en/nevibecode/skills/vercel-react-native-skills.md) — skill · 255200 installs
- [animate-expo](https://affpapa.org/en/nevibecode/skills/animate-expo.md) — skill · 137900 installs
- [mobile-native](https://affpapa.org/en/nevibecode/skills/mobile-native.md) — skill · 86600 installs
- [aso](https://affpapa.org/en/nevibecode/skills/aso.md) — skill · 75400 installs
- [swiftui-pro](https://affpapa.org/en/nevibecode/skills/swiftui-pro.md) — skill · 35200 installs
- [orca-emulator](https://affpapa.org/en/nevibecode/skills/orca-emulator.md) — skill · 5800 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
