Skill

Generate Makepad Widget Code and Answers

Makepad widget reference and code-pattern guide: View, Button, Label, Image, TextInput, plus their style variants.


91
Spark score
out of 100
Updated 20 days ago
Version 14.1.0
Models
claude

Add to Favorites

Why it matters

Leverage expert knowledge of Makepad widgets to generate custom UI code and provide clear explanations for widget properties, variants, and usage. This skill assists developers in building interfaces with Makepad's core and advanced widgets.

Outcomes

What it gets done

01

Generate Rust code for Makepad widgets like View, Button, and Label.

02

Explain Makepad widget properties, variants, and their specific behaviors.

03

Provide examples for composing complex UI elements using Makepad's building blocks.

04

Answer questions about rich text widgets including Markdown and TextFlow.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-makepad-widgets | bash

Overview

Makepad Widgets Skill

A Makepad Rust UI widget reference with ready-to-use code patterns for View, Button, Label, Image, and TextInput, plus the full 84-file widget catalog and their style variants. Use when writing Makepad UI code, picking between widget variants, or looking up a widget's properties before implementing it.

What it does

Makepad Widgets Skill turns Claude into an expert on Makepad's Rust UI widget system, generating widget code following documented patterns and answering questions about widget properties, variants, and usage. Before answering, it must read the relevant local reference file (widgets-core.md, widgets-advanced.md, or widgets-richtext.md) and incorporate its content; if a reference file is missing or empty, it tells the user to run /sync-crate-skills makepad --force to update the documentation and falls back to the patterns in SKILL.md plus built-in knowledge.

When to use - and when NOT to

Use this when working with core or advanced Makepad widgets, choosing between widget variants, composing widgets, or needing widget-specific behavior explained, or when examples are needed for View, Button, labels, rich text, or other makepad-widgets building blocks.

Inputs and outputs

Key code patterns cover View (a basic Fill/Down-flow container with show_bg/draw_bg), Button (draw_bg/draw_text styling including hover color and border radius), Label (styled text with draw_text/text_style), Image (source via dep("crate://self/...") and a fit mode), and TextInput (default text plus draw_text styling), for example:

<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 }
    }
}

The underlying WidgetNode and Widget traits define find_widgets, walk, area, redraw, handle_event, draw_walk, draw, and widget for custom widget implementations. When writing code, the skill always sets width/height, enables show_bg: true for background rendering, uses draw_bg/draw_text/draw_icon for shader uniforms, and uses dep("crate://self/...") for resource paths.

Integrations

Spans 84 files in widgets/src/ across nine categories: 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), and Utility (LoadingSpinner, DesktopButton, LinkLabel, ScrollShadow). View has 12 style variants (SolidView, RoundedView, RoundedAllView, RectView, CircleView, GradientXView, GradientYView, RoundedShadowView, ScrollXView, ScrollYView, ScrollXYView, CachedView), Button has 6 (ButtonFlat, ButtonFlatIcon, ButtonFlatter, ButtonGradientX, ButtonGradientY, ButtonIcon), and Image supports 4 fit modes (Stretch, Contain, Cover, Fill).

Who it's for

Rust developers building Makepad UIs who need correct widget syntax, the right variant for a visual need such as RoundedShadowView versus a plain View, or a starting point for exploring the widget catalog via the UI Zoo example - keeping in mind that View is the base container most visual widgets inherit from, and all widgets support animation through the animator property.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.