Makepad Widgets 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 widgets. Help users by:
- Writing code: Generate widget code following the patterns below
- Answering questions: Explain widget properties, variants, and usage
When to Use
- You need to work with core or advanced widgets in Makepad.
- The task involves widget selection, properties, variants, composition, or widget-specific behavior.
- You want examples for
View, Button, labels, rich text, or other makepad-widgets building blocks.
Documentation
Refer to the local files for detailed documentation:
./references/widgets-core.md - Core widgets (View, Button, Label, etc.)
./references/widgets-advanced.md - Helper and advanced widgets
./references/widgets-richtext.md - Rich text widgets (Markdown, Html, TextFlow)
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. View (Basic Container)
<View> {
width: Fill
height: Fill
flow: Down
padding: 16.0
show_bg: true
draw_bg: { color: #1A1A1A }
<Label> { text: "Content" }
}
2. Button
<Button> {
text: "Click Me"
draw_bg: {
color: #0066CC
color_hover: #0088FF
border_radius: 4.0
}
draw_text: {
color: #FFFFFF
text_style: { font_size: 14.0 }
}
}
3. Label with Styling
<Label> {
width: Fit
height: Fit
text: "Hello World"
draw_text: {
color: #FFFFFF
text_style: {
font_size: 16.0
line_spacing: 1.4
}
}
}
4. Image
<Image> {
width: 200.0
height: 150.0
source: dep("crate://self/resources/photo.png")
fit: Contain
}
5. TextInput
<TextInput> {
width: Fill
height: Fit
text: "Default value"
draw_text: {
text_style: { font_size: 14.0 }
}
}
Widget Traits (from source)
pub trait WidgetNode: LiveApply {
fn find_widgets(&self, path: &[LiveId], cached: WidgetCache, results: &mut WidgetSet);
fn walk(&mut self, cx: &mut Cx) -> Walk;
fn area(&self) -> Area;
fn redraw(&mut self, cx: &mut Cx);
}
pub trait Widget: WidgetNode {
fn handle_event(&mut self, cx: &mut Cx, event: &Event, scope: &mut Scope) {}
fn draw_walk(&mut self, cx: &mut Cx2d, scope: &mut Scope, walk: Walk) -> DrawStep;
fn draw(&mut self, cx: &mut Cx2d, scope: &mut Scope) -> DrawStep;
fn widget(&self, path: &[LiveId]) -> WidgetRef;
}
All Built-in Widgets (84 files in widgets/src/)
| Category |
Widgets |
| Basic |
View, Label, Button, Icon, Image |
| Input |
TextInput, CheckBox, RadioButton, Slider, DropDown, ColorPicker |
| Container |
ScrollBars, PortalList, FlatList, StackNavigation, Dock, Splitter |
| Navigation |
TabBar, Tab, FoldHeader, FoldButton, ExpandablePanel |
| Overlay |
Modal, Tooltip, PopupMenu, PopupNotification |
| Media |
Video, RotatedImage, ImageBlend, MultiImage |
| Layout |
AdaptiveView, SlidePanel, PageFlip, SlidesView |
| Special |
Markdown, Html, TextFlow, WebView, KeyboardView |
| Utility |
LoadingSpinner, DesktopButton, LinkLabel, ScrollShadow |
Core Widgets Reference
| Widget |
Purpose |
Key Properties |
View |
Container |
flow, align, show_bg, draw_bg, optimize |
Button |
Clickable |
text, draw_bg, draw_text, draw_icon |
Label |
Text display |
text, draw_text |
Image |
Image display |
source, fit |
TextInput |
Text entry |
text, draw_text, draw_cursor, draw_selection |
CheckBox |
Toggle |
text, selected |
RadioButton |
Selection |
text, selected |
Slider |
Value slider |
min, max, step |
DropDown |
Select menu |
labels, selected |
PortalList |
Virtual list |
Efficient scrolling for large lists |
Modal |
Dialog |
Overlay dialog boxes |
Tooltip |
Hint |
Hover tooltips |
View Variants
| Variant |
Description |
SolidView |
Solid background color |
RoundedView |
Rounded corners |
RoundedAllView |
Individual corner control |
RectView |
Rectangle with border/gradient |
CircleView |
Circle/ellipse shape |
GradientXView |
Horizontal gradient |
GradientYView |
Vertical gradient |
RoundedShadowView |
Rounded with shadow |
ScrollXView |
Horizontal scroll |
ScrollYView |
Vertical scroll |
ScrollXYView |
Both directions scroll |
CachedView |
Texture-cached |
Button Variants
| Variant |
Description |
ButtonFlat |
Flat style |
ButtonFlatIcon |
Flat with icon |
ButtonFlatter |
No background |
ButtonGradientX |
Horizontal gradient |
ButtonGradientY |
Vertical gradient |
ButtonIcon |
Standard with icon |
ImageFit Values
| Value |
Description |
Stretch |
Stretch to fill |
Contain |
Fit within, preserve ratio |
Cover |
Cover area, may crop |
Fill |
Fill without ratio |
When Writing Code
- Always set
width and height on widgets
- Use
show_bg: true to enable background rendering
- Access
draw_bg, draw_text, draw_icon for shader uniforms
- Use
dep("crate://self/...") for resource paths
- Choose appropriate View variant for visual needs
When Answering Questions
- Recommend UI Zoo example for widget exploration
- View is the base container - most visual widgets inherit from it
- Draw shaders (
draw_bg, draw_text) control appearance
- All widgets support animation through
animator property
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-widgets/SKILL.md
Also appears in: sickn33/agentic-awesome-skills/plugins/agentic-awesome-skills/skills/makepad-widgets/SKILL.md, sickn33/agentic-awesome-skills/plugins/agentic-awesome-skills-claude/skills/makepad-widgets/SKILL.md, sickn33/agentic-awesome-skills/plugins/agentic-bundle-makepad-builder/skills/makepad-widgets/SKILL.md
1---2name: makepad-widgets3description: Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19 > > Check for updates: https://crates.io/crates/makepad-widgets4---5
6
7# Makepad Widgets Skill
8
9> **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-01-19
10>
11> Check for updates: https://crates.io/crates/makepad-widgets
12
13You are an expert at Makepad widgets. Help users by:
14- **Writing code**: Generate widget code following the patterns below
15- **Answering questions**: Explain widget properties, variants, and usage
16
17## When to Use
18- You need to work with core or advanced widgets in Makepad.
19- The task involves widget selection, properties, variants, composition, or widget-specific behavior.
20- You want examples for `View`, `Button`, labels, rich text, or other `makepad-widgets` building blocks.
21
22## Documentation
23
24Refer to the local files for detailed documentation:
25- `./references/widgets-core.md` - Core widgets (View, Button, Label, etc.)
26- `./references/widgets-advanced.md` - Helper and advanced widgets
27- `./references/widgets-richtext.md` - Rich text widgets (Markdown, Html, TextFlow)
28
29## IMPORTANT: Documentation Completeness Check
30
31**Before answering questions, Claude MUST:**
32
331. Read the relevant reference file(s) listed above
342. If file read fails or file is empty:
35 - Inform user: "本地文档不完整,建议运行 `/sync-crate-skills makepad --force` 更新文档"
36 - Still answer based on SKILL.md patterns + built-in knowledge
373. If reference file exists, incorporate its content into the answer
38
39## Key Patterns
40
41### 1. View (Basic Container)
42
43```rust
44<View> {
45 width: Fill
46 height: Fill
47 flow: Down
48 padding: 16.0
49 show_bg: true
50 draw_bg: { color: #1A1A1A }
51
52 <Label> { text: "Content" }
53}
54```
55
56### 2. Button
57
58```rust
59<Button> {
60 text: "Click Me"
61 draw_bg: {
62 color: #0066CC
63 color_hover: #0088FF
64 border_radius: 4.0
65 }
66 draw_text: {
67 color: #FFFFFF
68 text_style: { font_size: 14.0 }
69 }
70}
71```
72
73### 3. Label with Styling
74
75```rust
76<Label> {
77 width: Fit
78 height: Fit
79 text: "Hello World"
80 draw_text: {
81 color: #FFFFFF
82 text_style: {
83 font_size: 16.0
84 line_spacing: 1.4
85 }
86 }
87}
88```
89
90### 4. Image
91
92```rust
93<Image> {
94 width: 200.0
95 height: 150.0
96 source: dep("crate://self/resources/photo.png")
97 fit: Contain
98}
99```
100
101### 5. TextInput
102
103```rust
104<TextInput> {
105 width: Fill
106 height: Fit
107 text: "Default value"
108 draw_text: {
109 text_style: { font_size: 14.0 }
110 }
111}
112```
113
114## Widget Traits (from source)
115
116```rust
117pub trait WidgetNode: LiveApply {
118 fn find_widgets(&self, path: &[LiveId], cached: WidgetCache, results: &mut WidgetSet);
119 fn walk(&mut self, cx: &mut Cx) -> Walk;
120 fn area(&self) -> Area;
121 fn redraw(&mut self, cx: &mut Cx);
122}
123
124pub trait Widget: WidgetNode {
125 fn handle_event(&mut self, cx: &mut Cx, event: &Event, scope: &mut Scope) {}
126 fn draw_walk(&mut self, cx: &mut Cx2d, scope: &mut Scope, walk: Walk) -> DrawStep;
127 fn draw(&mut self, cx: &mut Cx2d, scope: &mut Scope) -> DrawStep;
128 fn widget(&self, path: &[LiveId]) -> WidgetRef;
129}
130```
131
132## All Built-in Widgets (84 files in widgets/src/)
133
134| Category | Widgets |
135|----------|---------|
136| **Basic** | `View`, `Label`, `Button`, `Icon`, `Image` |
137| **Input** | `TextInput`, `CheckBox`, `RadioButton`, `Slider`, `DropDown`, `ColorPicker` |
138| **Container** | `ScrollBars`, `PortalList`, `FlatList`, `StackNavigation`, `Dock`, `Splitter` |
139| **Navigation** | `TabBar`, `Tab`, `FoldHeader`, `FoldButton`, `ExpandablePanel` |
140| **Overlay** | `Modal`, `Tooltip`, `PopupMenu`, `PopupNotification` |
141| **Media** | `Video`, `RotatedImage`, `ImageBlend`, `MultiImage` |
142| **Layout** | `AdaptiveView`, `SlidePanel`, `PageFlip`, `SlidesView` |
143| **Special** | `Markdown`, `Html`, `TextFlow`, `WebView`, `KeyboardView` |
144| **Utility** | `LoadingSpinner`, `DesktopButton`, `LinkLabel`, `ScrollShadow` |
145
146## Core Widgets Reference
147
148| Widget | Purpose | Key Properties |
149|--------|---------|----------------|
150| `View` | Container | `flow`, `align`, `show_bg`, `draw_bg`, `optimize` |
151| `Button` | Clickable | `text`, `draw_bg`, `draw_text`, `draw_icon` |
152| `Label` | Text display | `text`, `draw_text` |
153| `Image` | Image display | `source`, `fit` |
154| `TextInput` | Text entry | `text`, `draw_text`, `draw_cursor`, `draw_selection` |
155| `CheckBox` | Toggle | `text`, `selected` |
156| `RadioButton` | Selection | `text`, `selected` |
157| `Slider` | Value slider | `min`, `max`, `step` |
158| `DropDown` | Select menu | `labels`, `selected` |
159| `PortalList` | Virtual list | Efficient scrolling for large lists |
160| `Modal` | Dialog | Overlay dialog boxes |
161| `Tooltip` | Hint | Hover tooltips |
162
163## View Variants
164
165| Variant | Description |
166|---------|-------------|
167| `SolidView` | Solid background color |
168| `RoundedView` | Rounded corners |
169| `RoundedAllView` | Individual corner control |
170| `RectView` | Rectangle with border/gradient |
171| `CircleView` | Circle/ellipse shape |
172| `GradientXView` | Horizontal gradient |
173| `GradientYView` | Vertical gradient |
174| `RoundedShadowView` | Rounded with shadow |
175| `ScrollXView` | Horizontal scroll |
176| `ScrollYView` | Vertical scroll |
177| `ScrollXYView` | Both directions scroll |
178| `CachedView` | Texture-cached |
179
180## Button Variants
181
182| Variant | Description |
183|---------|-------------|
184| `ButtonFlat` | Flat style |
185| `ButtonFlatIcon` | Flat with icon |
186| `ButtonFlatter` | No background |
187| `ButtonGradientX` | Horizontal gradient |
188| `ButtonGradientY` | Vertical gradient |
189| `ButtonIcon` | Standard with icon |
190
191## ImageFit Values
192
193| Value | Description |
194|-------|-------------|
195| `Stretch` | Stretch to fill |
196| `Contain` | Fit within, preserve ratio |
197| `Cover` | Cover area, may crop |
198| `Fill` | Fill without ratio |
199
200## When Writing Code
201
2021. Always set `width` and `height` on widgets
2032. Use `show_bg: true` to enable background rendering
2043. Access `draw_bg`, `draw_text`, `draw_icon` for shader uniforms
2054. Use `dep("crate://self/...")` for resource paths
2065. Choose appropriate View variant for visual needs
207
208## When Answering Questions
209
2101. Recommend UI Zoo example for widget exploration
2112. View is the base container - most visual widgets inherit from it
2123. Draw shaders (`draw_bg`, `draw_text`) control appearance
2134. All widgets support animation through `animator` property
214
215## Limitations
216- Use this skill only when the task clearly matches the scope described above.
217- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
218- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
219
220---
221
222**Source:** [`sickn33/agentic-awesome-skills`](https://github.com/sickn33/agentic-awesome-skills) → `skills/makepad-widgets/SKILL.md`
223
224**Also appears in:** `sickn33/agentic-awesome-skills/plugins/agentic-awesome-skills/skills/makepad-widgets/SKILL.md`, `sickn33/agentic-awesome-skills/plugins/agentic-awesome-skills-claude/skills/makepad-widgets/SKILL.md`, `sickn33/agentic-awesome-skills/plugins/agentic-bundle-makepad-builder/skills/makepad-widgets/SKILL.md`