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/widgets-core.md
./references/widgets-advanced.md
./references/widgets-richtext.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 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.
1---2name: makepad-widgets-23description: "Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19 > > Check for updates: https://crates.io/crates/makepad-widgets"4risk: safe5source: community6date_added: "2026-03-06"7metadata:8 source: https://skillmd.com/skills/iradoweck/makepad-widgets-29---1011## Supporting material availability1213This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:1415- `./references/widgets-core.md`16- `./references/widgets-advanced.md`17- `./references/widgets-richtext.md`1819Ask 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.202122# Makepad Widgets Skill2324> **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-01-1925>26> Check for updates: https://crates.io/crates/makepad-widgets2728You are an expert at Makepad widgets. Help users by:29- **Writing code**: Generate widget code following the patterns below30- **Answering questions**: Explain widget properties, variants, and usage3132## When to Use33- You need to work with core or advanced widgets in Makepad.34- The task involves widget selection, properties, variants, composition, or widget-specific behavior.35- You want examples for `View`, `Button`, labels, rich text, or other `makepad-widgets` building blocks.3637## Documentation3839Refer to the local files for detailed documentation:40- `./references/widgets-core.md` - Core widgets (View, Button, Label, etc.)41- `./references/widgets-advanced.md` - Helper and advanced widgets42- `./references/widgets-richtext.md` - Rich text widgets (Markdown, Html, TextFlow)4344## IMPORTANT: Documentation Completeness Check4546**Before answering questions, Claude MUST:**47481. Read the relevant reference file(s) listed above492. If file read fails or file is empty:50 - Inform user: "本地文档不完整,建议运行 `/sync-crate-skills makepad --force` 更新文档"51 - Still answer based on SKILL.md patterns + built-in knowledge523. If reference file exists, incorporate its content into the answer5354## Key Patterns5556### 1. View (Basic Container)5758```rust59<View> {60 width: Fill61 height: Fill62 flow: Down63 padding: 16.064 show_bg: true65 draw_bg: { color: #1A1A1A }6667 <Label> { text: "Content" }68}69```7071### 2. Button7273```rust74<Button> {75 text: "Click Me"76 draw_bg: {77 color: #0066CC78 color_hover: #0088FF79 border_radius: 4.080 }81 draw_text: {82 color: #FFFFFF83 text_style: { font_size: 14.0 }84 }85}86```8788### 3. Label with Styling8990```rust91<Label> {92 width: Fit93 height: Fit94 text: "Hello World"95 draw_text: {96 color: #FFFFFF97 text_style: {98 font_size: 16.099 line_spacing: 1.4100 }101 }102}103```104105### 4. Image106107```rust108<Image> {109 width: 200.0110 height: 150.0111 source: dep("crate://self/resources/photo.png")112 fit: Contain113}114```115116### 5. TextInput117118```rust119<TextInput> {120 width: Fill121 height: Fit122 text: "Default value"123 draw_text: {124 text_style: { font_size: 14.0 }125 }126}127```128129## Widget Traits (from source)130131```rust132pub trait WidgetNode: LiveApply {133 fn find_widgets(&self, path: &[LiveId], cached: WidgetCache, results: &mut WidgetSet);134 fn walk(&mut self, cx: &mut Cx) -> Walk;135 fn area(&self) -> Area;136 fn redraw(&mut self, cx: &mut Cx);137}138139pub trait Widget: WidgetNode {140 fn handle_event(&mut self, cx: &mut Cx, event: &Event, scope: &mut Scope) {}141 fn draw_walk(&mut self, cx: &mut Cx2d, scope: &mut Scope, walk: Walk) -> DrawStep;142 fn draw(&mut self, cx: &mut Cx2d, scope: &mut Scope) -> DrawStep;143 fn widget(&self, path: &[LiveId]) -> WidgetRef;144}145```146147## All Built-in Widgets (84 files in widgets/src/)148149| Category | Widgets |150|----------|---------|151| **Basic** | `View`, `Label`, `Button`, `Icon`, `Image` |152| **Input** | `TextInput`, `CheckBox`, `RadioButton`, `Slider`, `DropDown`, `ColorPicker` |153| **Container** | `ScrollBars`, `PortalList`, `FlatList`, `StackNavigation`, `Dock`, `Splitter` |154| **Navigation** | `TabBar`, `Tab`, `FoldHeader`, `FoldButton`, `ExpandablePanel` |155| **Overlay** | `Modal`, `Tooltip`, `PopupMenu`, `PopupNotification` |156| **Media** | `Video`, `RotatedImage`, `ImageBlend`, `MultiImage` |157| **Layout** | `AdaptiveView`, `SlidePanel`, `PageFlip`, `SlidesView` |158| **Special** | `Markdown`, `Html`, `TextFlow`, `WebView`, `KeyboardView` |159| **Utility** | `LoadingSpinner`, `DesktopButton`, `LinkLabel`, `ScrollShadow` |160161## Core Widgets Reference162163| Widget | Purpose | Key Properties |164|--------|---------|----------------|165| `View` | Container | `flow`, `align`, `show_bg`, `draw_bg`, `optimize` |166| `Button` | Clickable | `text`, `draw_bg`, `draw_text`, `draw_icon` |167| `Label` | Text display | `text`, `draw_text` |168| `Image` | Image display | `source`, `fit` |169| `TextInput` | Text entry | `text`, `draw_text`, `draw_cursor`, `draw_selection` |170| `CheckBox` | Toggle | `text`, `selected` |171| `RadioButton` | Selection | `text`, `selected` |172| `Slider` | Value slider | `min`, `max`, `step` |173| `DropDown` | Select menu | `labels`, `selected` |174| `PortalList` | Virtual list | Efficient scrolling for large lists |175| `Modal` | Dialog | Overlay dialog boxes |176| `Tooltip` | Hint | Hover tooltips |177178## View Variants179180| Variant | Description |181|---------|-------------|182| `SolidView` | Solid background color |183| `RoundedView` | Rounded corners |184| `RoundedAllView` | Individual corner control |185| `RectView` | Rectangle with border/gradient |186| `CircleView` | Circle/ellipse shape |187| `GradientXView` | Horizontal gradient |188| `GradientYView` | Vertical gradient |189| `RoundedShadowView` | Rounded with shadow |190| `ScrollXView` | Horizontal scroll |191| `ScrollYView` | Vertical scroll |192| `ScrollXYView` | Both directions scroll |193| `CachedView` | Texture-cached |194195## Button Variants196197| Variant | Description |198|---------|-------------|199| `ButtonFlat` | Flat style |200| `ButtonFlatIcon` | Flat with icon |201| `ButtonFlatter` | No background |202| `ButtonGradientX` | Horizontal gradient |203| `ButtonGradientY` | Vertical gradient |204| `ButtonIcon` | Standard with icon |205206## ImageFit Values207208| Value | Description |209|-------|-------------|210| `Stretch` | Stretch to fill |211| `Contain` | Fit within, preserve ratio |212| `Cover` | Cover area, may crop |213| `Fill` | Fill without ratio |214215## When Writing Code2162171. Always set `width` and `height` on widgets2182. Use `show_bg: true` to enable background rendering2193. Access `draw_bg`, `draw_text`, `draw_icon` for shader uniforms2204. Use `dep("crate://self/...")` for resource paths2215. Choose appropriate View variant for visual needs222223## When Answering Questions2242251. Recommend UI Zoo example for widget exploration2262. View is the base container - most visual widgets inherit from it2273. Draw shaders (`draw_bg`, `draw_text`) control appearance2284. All widgets support animation through `animator` property229230## Limitations231- Use this skill only when the task clearly matches the scope described above.232- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.233- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.