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