Supporting material availability
This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:
./references/layout-system.md
./references/core-types.md
Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.
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.
1---2name: makepad-layout-23description: |4 CRITICAL: Use for Makepad layout system. Triggers on:5 makepad layout, makepad width, makepad height, makepad flex,6 makepad padding, makepad margin, makepad flow, makepad align,7 Fit, Fill, Size, Walk, "how to center in makepad",8 makepad 布局, makepad 宽度, makepad 对齐, makepad 居中9risk: safe10source: community11date_added: "2026-03-06"12metadata:13 source: https://skillmd.com/skills/iradoweck/makepad-layout-214---1516## Supporting material availability1718This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:1920- `./references/layout-system.md`21- `./references/core-types.md`2223Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.242526# Makepad Layout Skill2728> **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-01-1929>30> Check for updates: https://crates.io/crates/makepad-widgets3132You are an expert at Makepad layout system. Help users by:33- **Writing code**: Generate layout code following the patterns below34- **Answering questions**: Explain layout concepts, sizing, flow directions3536## When to Use37- You need to size, align, or position widgets in a Makepad UI.38- The task involves `Walk`, `Align`, `Fit`, `Fill`, padding, spacing, or container flow configuration.39- You want Makepad-specific layout solutions for centering, responsiveness, or composition.4041## Documentation4243Refer to the local files for detailed documentation:44- `./references/layout-system.md` - Complete layout reference45- `./references/core-types.md` - Walk, Align, Margin, Padding types4647## IMPORTANT: Documentation Completeness Check4849**Before answering questions, Claude MUST:**50511. Read the relevant reference file(s) listed above522. If file read fails or file is empty:53 - Inform user: "本地文档不完整,建议运行 `/sync-crate-skills makepad --force` 更新文档"54 - Still answer based on SKILL.md patterns + built-in knowledge553. If reference file exists, incorporate its content into the answer5657## Key Patterns5859### 1. Basic Layout Container6061```rust62<View> {63 width: Fill64 height: Fill65 flow: Down66 padding: 16.067 spacing: 8.06869 <Label> { text: "Item 1" }70 <Label> { text: "Item 2" }71}72```7374### 2. Centering Content7576```rust77<View> {78 width: Fill79 height: Fill80 align: { x: 0.5, y: 0.5 }8182 <Label> { text: "Centered" }83}84```8586### 3. Horizontal Row Layout8788```rust89<View> {90 width: Fill91 height: Fit92 flow: Right93 spacing: 10.094 align: { y: 0.5 } // Vertically center items9596 <Button> { text: "Left" }97 <View> { width: Fill } // Spacer98 <Button> { text: "Right" }99}100```101102### 4. Fixed + Flexible Layout103104```rust105<View> {106 width: Fill107 height: Fill108 flow: Down109110 // Fixed header111 <View> {112 width: Fill113 height: 60.0114 }115116 // Flexible content117 <View> {118 width: Fill119 height: Fill // Takes remaining space120 }121}122```123124## Layout Properties Reference125126| Property | Type | Description |127|----------|------|-------------|128| `width` | Size | Width of element |129| `height` | Size | Height of element |130| `padding` | Padding | Inner spacing |131| `margin` | Margin | Outer spacing |132| `flow` | Flow | Child layout direction |133| `spacing` | f64 | Gap between children |134| `align` | Align | Child alignment |135| `clip_x` | bool | Clip horizontal overflow |136| `clip_y` | bool | Clip vertical overflow |137138## Size Values139140| Value | Description |141|-------|-------------|142| `Fit` | Size to fit content |143| `Fill` | Fill available space |144| `100.0` | Fixed size in pixels |145| `Fixed(100.0)` | Explicit fixed size |146147## Flow Directions148149| Value | Description |150|-------|-------------|151| `Down` | Top to bottom (column) |152| `Right` | Left to right (row) |153| `Overlay` | Stack on top |154155## Align Values156157| Value | Position |158|-------|----------|159| `{ x: 0.0, y: 0.0 }` | Top-left |160| `{ x: 0.5, y: 0.0 }` | Top-center |161| `{ x: 1.0, y: 0.0 }` | Top-right |162| `{ x: 0.0, y: 0.5 }` | Middle-left |163| `{ x: 0.5, y: 0.5 }` | Center |164| `{ x: 1.0, y: 0.5 }` | Middle-right |165| `{ x: 0.0, y: 1.0 }` | Bottom-left |166| `{ x: 0.5, y: 1.0 }` | Bottom-center |167| `{ x: 1.0, y: 1.0 }` | Bottom-right |168169## Box Model170171```172+---------------------------+173| margin |174| +---------------------+ |175| | padding | |176| | +---------------+ | |177| | | content | | |178| | +---------------+ | |179| +---------------------+ |180+---------------------------+181```182183## When Writing Code1841851. Use `Fill` for flexible containers, `Fit` for content-sized elements1862. Set `flow: Down` for vertical, `flow: Right` for horizontal1873. Use empty `<View> { width: Fill }` as spacer in row layouts1884. Always set explicit dimensions on fixed-size elements1895. Use `align` to position children within container190191## When Answering Questions1921931. Makepad uses a "turtle" layout model - elements laid out sequentially1942. `Fill` takes all available space, `Fit` shrinks to content1953. Unlike CSS flexbox, there's no flex-grow/shrink - use Fill/Fit1964. Alignment applies to children, not the element itself197198## Limitations199- Use this skill only when the task clearly matches the scope described above.200- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.201- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.