跳到正文
Skillpedia
网站与界面(前端)48k · #5143

makepad-2-0-widgets

它能做什么

这份指南帮你使用 Makepad 2.0 为应用搭建可视化界面(也就是屏幕)。它会介绍可用的构建模块,比如按钮、文本输入框和图片,并告诉你怎么使用它们。

适用场景

  • ✓在设计应用的外观和风格时。
  • ✓当你想添加按钮或文本输入框时。
  • ✓当你需要显示图片或列表时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/makepad-2-0-widgets/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/makepad-2-0-widgets/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“怎样创建一个显示“Save”文字的可点击按钮?”

每周 5 个新技能,1 分钟读完。

工作原理

Makepad 2.0 提供了一种叫“控件”(widget)的东西,它们就像搭建界面的乐高积木。每个控件都有特定的用途(比如显示文字或接收输入),还有一些可以调整的属性。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

When to Use

  • Use when this upstream workflow matches the user's stated goal.
  • Use when the task requires the procedures documented in this skill.

Makepad 2.0 Widget Catalog Skill

Version: makepad-widgets (dev branch) | Last Updated: 2026-03-03

Overview

Makepad 2.0 provides a rich set of built-in widgets for building UIs. All widgets are defined in Splash syntax and registered via script_mod!.

Documentation

Refer to the local files for detailed documentation:

  • ./references/widget-catalog.md - Complete widget list with properties
  • ./references/widget-advanced.md - Advanced patterns: PortalList, Dock, custom widgets, MapView

IMPORTANT: Documentation Completeness Check

Before answering questions, Claude MUST:

  1. Read the relevant reference file(s) listed above
  2. Incorporate reference content into the answer

Widget Categories Quick Reference

Containers (Layout)

Widget Description Key Properties
View Basic container (transparent) width, height, flow, spacing, padding, align
SolidView View with solid background + show_bg: true, draw_bg.color
RoundedView View with rounded corners + draw_bg.border_radius
RoundedAllView All corners same radius + border_radius shorthand
GradientXView Horizontal gradient bg + draw_bg colors
GradientYView Vertical gradient bg + draw_bg colors
ScrollXView Horizontal scrolling scroll property
ScrollYView Vertical scrolling scroll property
ScrollXYView Both-axis scrolling scroll property

Text Widgets

Widget Description Key Properties
Label Single/multi-line text text, draw_text.color, draw_text.text_style.font_size
H1 - H4 Heading levels text (pre-styled)
P Paragraph text text
TextInput Editable text field text, empty_text, password, read_only, numeric_only
Markdown Markdown renderer body
Html HTML renderer body
LinkLabel Clickable link text text, url

Buttons

Widget Description Key Properties
Button Standard button text
ButtonFlat Flat style button text
ButtonFlatter Minimal button text

Toggles

Widget Description Key Properties
CheckBox Check box text, active
Toggle Toggle switch text, active
RadioButton Radio button text, active

Input Widgets

Widget Description Key Properties
Slider Horizontal slider min, max, step, default, precision
DropDown Dropdown select labels: ["a", "b", "c"]

Media

Widget Description Key Properties
Image Image display source, fit (Stretch/Horizontal/Vertical/Smallest/Biggest/Size)
Svg External SVG file renderer draw_svg.svg (crate_resource/http_resource), animating, draw_svg.color
Icon SVG icon (tinted) draw_icon.svg, draw_icon.color, icon_walk
Vector Inline vector graphics viewbox, Path{d: "..."}
LoadingSpinner Loading indicator color, rotation_speed
MapView Map widget center_lon, center_lat, zoom (MUST use fixed height!)

Layout Helpers

Widget Description Usage
Hr Horizontal rule Divider line
Vr Vertical rule Vertical divider
Filler Flexible space Push siblings apart (use between Fit siblings only!)
Splitter Resizable split axis: Horizontal/Vertical, a/b children
FoldHeader Collapsible section header + body children

Lists

Widget Description Usage
PortalList Virtualized list For large lists (100+ items), only renders visible items
FlatList Simple list For small lists, renders all items

Navigation

Widget Description Control
Modal Modal dialog .open(cx) / .close(cx) from Rust
Tooltip Tooltip popup Hover-triggered
PopupNotification Toast notification Timed display
SlidePanel Sliding panel slide_from
ExpandablePanel Expandable area open/close
PageFlip Page switcher active_page: page_name

…

常见问题

`View` 和 `SolidView` 有什么区别?

`View` 是一个基础的透明容器,而 `SolidView` 是可以设置纯色背景的 `View`。

怎样让文字显示在有颜色的背景上?

配合背景颜色属性使用 `new_batch: true`,确保文字能正确绘制在背景之上。

怎样创建可滚动的列表?

水平滚动用 `ScrollXView`,垂直滚动用 `ScrollYView`,两个方向都需要滚动时就用 `ScrollXYView`。

详情

作者的原始描述

Makepad 2.0 guidance for widgets; use when building or debugging Makepad UI code.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5143
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能