Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

docs: add a built-in widget gallery to the Widgets guide (en + zh)

yhhcaec620bd989
diff --git a/docs/astro/src/assets/guides/en/widgets-gallery.png b/docs/astro/src/assets/guides/en/widgets-gallery.png
new file mode 100644
index 000000000..286fb8462
Binary files /dev/null and b/docs/astro/src/assets/guides/en/widgets-gallery.png differ
diff --git a/docs/astro/src/assets/guides/zh/widgets-gallery.png b/docs/astro/src/assets/guides/zh/widgets-gallery.png
new file mode 100644
index 000000000..657453eb4
Binary files /dev/null and b/docs/astro/src/assets/guides/zh/widgets-gallery.png differ
diff --git a/docs/astro/src/content/docs/guides/ui-components.mdx b/docs/astro/src/content/docs/guides/ui-components.mdx
index c704f30e1..fe5a290c2 100644
--- a/docs/astro/src/content/docs/guides/ui-components.mdx
+++ b/docs/astro/src/content/docs/guides/ui-components.mdx
@@ -32,6 +32,12 @@ with `focusable: false`.
per-page field bindings, authorable in the editor.
</Aside>
+![The built-in widgets running — a Button, Toggle, Slider, Progress bar, a Dialog trigger, and more, in one panel](../../../assets/guides/en/widgets-gallery.png)
+
+*The built-in widgets (from the `ui-controls` example): a **Button**, a **Toggle**, a
+**Slider**, a **Progress** bar, and buttons that open a **Dialog** and cycle an accent
+color — each a plain entity tree with the UI components on it.*
+
## Button
`createButton(opts)` spawns a clickable entity (with an optional child label) that
diff --git a/docs/astro/src/content/docs/zh-cn/guides/ui-components.mdx b/docs/astro/src/content/docs/zh-cn/guides/ui-components.mdx
index bcdfd4f03..c3949483b 100644
--- a/docs/astro/src/content/docs/zh-cn/guides/ui-components.mdx
+++ b/docs/astro/src/content/docs/zh-cn/guides/ui-components.mdx
@@ -28,6 +28,12 @@ Tab 能到达、Enter/Space 能点击、方向键能驱动滑块——用 `focus
绑定,可在编辑器里授权。
</Aside>
+![内置控件运行中——一个按钮、开关、滑块、进度条、一个对话框触发按钮等,同在一个面板里](../../../../assets/guides/zh/widgets-gallery.png)
+
+*内置控件(取自 `ui-controls` 示例):一个 **Button(按钮)**、一个 **Toggle(开关)**、一个
+**Slider(滑块)**、一个 **Progress(进度条)**,以及打开 **Dialog(对话框)** 和切换强调色的
+按钮——每个都只是挂了 UI 组件的普通实体树。*
+
## Button 按钮
`createButton(opts)` 生成一个可点击实体(带可选子标签),在各视觉状态间过渡。返回 `ButtonHandle`。