Makepad Layout Skill
Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19
Check for updates: https://crates.io/crates/makepad-widgets
You are an expert at Makepad layout system. Help users by:
- Writing code: Generate layout code following the patterns below
- Answering questions: Explain layout concepts, sizing, flow directions
When to Use
- You need to size, align, or position widgets in a Makepad UI.
- The task involves
Walk, Align, Fit, Fill, padding, spacing, or container flow configuration.
- You want Makepad-specific layout solutions for centering, responsiveness, or composition.
Documentation
Refer to the local files for detailed documentation:
./references/layout-system.md - Complete layout reference
./references/core-types.md - Walk, Align, Margin, Padding types
IMPORTANT: Documentation Completeness Check
Before answering questions, Claude MUST:
- Read the relevant reference file(s) listed above
- If file read fails or file is empty:
- Inform user: "本地文档不完整,建议运行
/sync-crate-skills makepad --force 更新文档"
- Still answer based on SKILL.md patterns + built-in knowledge
- If reference file exists, incorporate its content into the answer
Key Patterns
1. Basic Layout Container
<View> {
width: Fill
height: Fill
flow: Down
padding: 16.0
spacing: 8.0
<Label> { text: "Item 1" }
<Label> { text: "Item 2" }
}
2. Centering Content
<View> {
width: Fill
height: Fill
align: { x: 0.5, y: 0.5 }
<Label> { text: "Centered" }
}
3. Horizontal Row Layout
<View> {
width: Fill
height: Fit
flow: Right
spacing: 10.0
align: { y: 0.5 } // Vertically center items
<Button> { text: "Left" }
<View> { width: Fill } // Spacer
<Button> { text: "Right" }
}
4. Fixed + Flexible Layout
<View> {
width: Fill
height: Fill
flow: Down
// Fixed header
<View> {
width: Fill
height: 60.0
}
// Flexible content
<View> {
width: Fill
height: Fill // Takes remaining space
}
}
Layout Properties Reference
| Property |
Type |
Description |
width |
Size |
Width of element |
height |
Size |
Height of element |
padding |
Padding |
Inner spacing |
margin |
Margin |
Outer spacing |
flow |
Flow |
Child layout direction |
spacing |
f64 |
Gap between children |
align |
Align |
Child alignment |
clip_x |
bool |
Clip horizontal overflow |
clip_y |
bool |
Clip vertical overflow |
Size Values
| Value |
Description |
Fit |
Size to fit content |
Fill |
Fill available space |
100.0 |
Fixed size in pixels |
Fixed(100.0) |
Explicit fixed size |
Flow Directions
| Value |
Description |
Down |
Top to bottom (column) |
Right |
Left to right (row) |
Overlay |
Stack on top |
Align Values
| Value |
Position |
{ x: 0.0, y: 0.0 } |
Top-left |
{ x: 0.5, y: 0.0 } |
Top-center |
{ x: 1.0, y: 0.0 } |
Top-right |
{ x: 0.0, y: 0.5 } |
Middle-left |
{ x: 0.5, y: 0.5 } |
Center |
{ x: 1.0, y: 0.5 } |
Middle-right |
{ x: 0.0, y: 1.0 } |
Bottom-left |
{ x: 0.5, y: 1.0 } |
Bottom-center |
{ x: 1.0, y: 1.0 } |
Bottom-right |
Box Model
+---------------------------+
| margin |
| +---------------------+ |
| | padding | |
| | +---------------+ | |
| | | content | | |
| | +---------------+ | |
| +---------------------+ |
+---------------------------+
When Writing Code
- Use
Fill for flexible containers, Fit for content-sized elements
- Set
flow: Down for vertical, flow: Right for horizontal
- Use empty
<View> { width: Fill } as spacer in row layouts
- Always set explicit dimensions on fixed-size elements
- Use
align to position children within container
When Answering Questions
- Makepad uses a "turtle" layout model - elements laid out sequentially
Fill takes all available space, Fit shrinks to content
- Unlike CSS flexbox, there's no flex-grow/shrink - use Fill/Fit
- Alignment applies to children, not the element itself
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.
Source: sickn33/agentic-awesome-skills → skills/makepad-layout/SKILL.md
Also appears in: sickn33/agentic-awesome-skills/plugins/agentic-awesome-skills/skills/makepad-layout/SKILL.md, sickn33/agentic-awesome-skills/plugins/agentic-awesome-skills-claude/skills/makepad-layout/SKILL.md, sickn33/agentic-awesome-skills/plugins/agentic-bundle-makepad-builder/skills/makepad-layout/SKILL.md
1---
2name: makepad-layout
3description: "| CRITICAL: Use for Makepad layout system. Triggers on: makepad layout, makepad width, makepad height, makepad flex, makepad padding, makepad margin, makepad flow, makepad align, Fit, Fill, Size, Walk, \"how to center in makepad\", makepad 布局, makepad 宽度, makepad 对齐, makepad 居中"
4category: frontend-and-design
5source_repo: sickn33/agentic-awesome-skills
6source_path: "skills/makepad-layout/SKILL.md"
7source_url: https://github.com/sickn33/agentic-awesome-skills/blob/HEAD/skills/makepad-layout/SKILL.md
8metadata:
9 source: https://skillmd.com/skills/thedixitjain/makepad-layout
10---
11
12
13# Makepad Layout Skill
14
15> **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-01-19
16>
17> Check for updates: https://crates.io/crates/makepad-widgets
18
19You are an expert at Makepad layout system. Help users by:
20- **Writing code**: Generate layout code following the patterns below
21- **Answering questions**: Explain layout concepts, sizing, flow directions
22
23## When to Use
24- You need to size, align, or position widgets in a Makepad UI.
25- The task involves `Walk`, `Align`, `Fit`, `Fill`, padding, spacing, or container flow configuration.
26- You want Makepad-specific layout solutions for centering, responsiveness, or composition.
27
28## Documentation
29
30Refer to the local files for detailed documentation:
31- `./references/layout-system.md` - Complete layout reference
32- `./references/core-types.md` - Walk, Align, Margin, Padding types
33
34## IMPORTANT: Documentation Completeness Check
35
36**Before answering questions, Claude MUST:**
37
381. Read the relevant reference file(s) listed above
392. If file read fails or file is empty:
40 - Inform user: "本地文档不完整,建议运行 `/sync-crate-skills makepad --force` 更新文档"
41 - Still answer based on SKILL.md patterns + built-in knowledge
423. If reference file exists, incorporate its content into the answer
43
44## Key Patterns
45
46### 1. Basic Layout Container
47
48```rust
49<View> {
50 width: Fill
51 height: Fill
52 flow: Down
53 padding: 16.0
54 spacing: 8.0
55
56 <Label> { text: "Item 1" }
57 <Label> { text: "Item 2" }
58}
59```
60
61### 2. Centering Content
62
63```rust
64<View> {
65 width: Fill
66 height: Fill
67 align: { x: 0.5, y: 0.5 }
68
69 <Label> { text: "Centered" }
70}
71```
72
73### 3. Horizontal Row Layout
74
75```rust
76<View> {
77 width: Fill
78 height: Fit
79 flow: Right
80 spacing: 10.0
81 align: { y: 0.5 } // Vertically center items
82
83 <Button> { text: "Left" }
84 <View> { width: Fill } // Spacer
85 <Button> { text: "Right" }
86}
87```
88
89### 4. Fixed + Flexible Layout
90
91```rust
92<View> {
93 width: Fill
94 height: Fill
95 flow: Down
96
97 // Fixed header
98 <View> {
99 width: Fill
100 height: 60.0
101 }
102
103 // Flexible content
104 <View> {
105 width: Fill
106 height: Fill // Takes remaining space
107 }
108}
109```
110
111## Layout Properties Reference
112
113| Property | Type | Description |
114|----------|------|-------------|
115| `width` | Size | Width of element |
116| `height` | Size | Height of element |
117| `padding` | Padding | Inner spacing |
118| `margin` | Margin | Outer spacing |
119| `flow` | Flow | Child layout direction |
120| `spacing` | f64 | Gap between children |
121| `align` | Align | Child alignment |
122| `clip_x` | bool | Clip horizontal overflow |
123| `clip_y` | bool | Clip vertical overflow |
124
125## Size Values
126
127| Value | Description |
128|-------|-------------|
129| `Fit` | Size to fit content |
130| `Fill` | Fill available space |
131| `100.0` | Fixed size in pixels |
132| `Fixed(100.0)` | Explicit fixed size |
133
134## Flow Directions
135
136| Value | Description |
137|-------|-------------|
138| `Down` | Top to bottom (column) |
139| `Right` | Left to right (row) |
140| `Overlay` | Stack on top |
141
142## Align Values
143
144| Value | Position |
145|-------|----------|
146| `{ x: 0.0, y: 0.0 }` | Top-left |
147| `{ x: 0.5, y: 0.0 }` | Top-center |
148| `{ x: 1.0, y: 0.0 }` | Top-right |
149| `{ x: 0.0, y: 0.5 }` | Middle-left |
150| `{ x: 0.5, y: 0.5 }` | Center |
151| `{ x: 1.0, y: 0.5 }` | Middle-right |
152| `{ x: 0.0, y: 1.0 }` | Bottom-left |
153| `{ x: 0.5, y: 1.0 }` | Bottom-center |
154| `{ x: 1.0, y: 1.0 }` | Bottom-right |
155
156## Box Model
157
158```
159+---------------------------+
160| margin |
161| +---------------------+ |
162| | padding | |
163| | +---------------+ | |
164| | | content | | |
165| | +---------------+ | |
166| +---------------------+ |
167+---------------------------+
168```
169
170## When Writing Code
171
1721. Use `Fill` for flexible containers, `Fit` for content-sized elements
1732. Set `flow: Down` for vertical, `flow: Right` for horizontal
1743. Use empty `<View> { width: Fill }` as spacer in row layouts
1754. Always set explicit dimensions on fixed-size elements
1765. Use `align` to position children within container
177
178## When Answering Questions
179
1801. Makepad uses a "turtle" layout model - elements laid out sequentially
1812. `Fill` takes all available space, `Fit` shrinks to content
1823. Unlike CSS flexbox, there's no flex-grow/shrink - use Fill/Fit
1834. Alignment applies to children, not the element itself
184
185## Limitations
186- Use this skill only when the task clearly matches the scope described above.
187- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
188- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
189
190---
191
192**Source:** [`sickn33/agentic-awesome-skills`](https://github.com/sickn33/agentic-awesome-skills) → `skills/makepad-layout/SKILL.md`
193
194**Also appears in:** `sickn33/agentic-awesome-skills/plugins/agentic-awesome-skills/skills/makepad-layout/SKILL.md`, `sickn33/agentic-awesome-skills/plugins/agentic-awesome-skills-claude/skills/makepad-layout/SKILL.md`, `sickn33/agentic-awesome-skills/plugins/agentic-bundle-makepad-builder/skills/makepad-layout/SKILL.md`