Loading...
Loading...
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 居中
npx skill4agent add zhanghandong/makepad-skills makepad-layoutVersion: makepad-widgets (dev branch) | Last Updated: 2026-01-19Check for updates: https://crates.io/crates/makepad-widgets
./references/layout-system.md./references/core-types.md/sync-crate-skills makepad --force<View> {
width: Fill
height: Fill
flow: Down
padding: 16.0
spacing: 8.0
<Label> { text: "Item 1" }
<Label> { text: "Item 2" }
}<View> {
width: Fill
height: Fill
align: { x: 0.5, y: 0.5 }
<Label> { text: "Centered" }
}<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" }
}<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
}
}| Property | Type | Description |
|---|---|---|
| Size | Width of element |
| Size | Height of element |
| Padding | Inner spacing |
| Margin | Outer spacing |
| Flow | Child layout direction |
| f64 | Gap between children |
| Align | Child alignment |
| bool | Clip horizontal overflow |
| bool | Clip vertical overflow |
| Value | Description |
|---|---|
| Size to fit content |
| Fill available space |
| Fixed size in pixels |
| Explicit fixed size |
| Value | Description |
|---|---|
| Top to bottom (column) |
| Left to right (row) |
| Stack on top |
| Value | Position |
|---|---|
| Top-left |
| Top-center |
| Top-right |
| Middle-left |
| Center |
| Middle-right |
| Bottom-left |
| Bottom-center |
| Bottom-right |
+---------------------------+
| margin |
| +---------------------+ |
| | padding | |
| | +---------------+ | |
| | | content | | |
| | +---------------+ | |
| +---------------------+ |
+---------------------------+FillFitflow: Downflow: Right<View> { width: Fill }alignFillFit