opencode-skills-collection 4.0.69 → 4.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +39 -1
  2. package/bundled-skills/api-integration-architect/SKILL.md +241 -0
  3. package/bundled-skills/apify-generate-output-schema/SKILL.md +438 -0
  4. package/bundled-skills/apify-integration-development/SKILL.md +168 -0
  5. package/bundled-skills/apify-integration-development/references/ai-framework-package.md +158 -0
  6. package/bundled-skills/apify-integration-development/references/ai-harness-plugin.md +192 -0
  7. package/bundled-skills/apify-integration-development/references/sdk-integration.md +236 -0
  8. package/bundled-skills/apify-integration-development/references/workflow-automation.md +163 -0
  9. package/bundled-skills/architecture-review/README.md +42 -0
  10. package/bundled-skills/architecture-review/SKILL.md +77 -0
  11. package/bundled-skills/architecture-review/examples.md +11 -0
  12. package/bundled-skills/architecture-review/reference/best-practices.md +7 -0
  13. package/bundled-skills/architecture-review/reference/capabilities.md +20 -0
  14. package/bundled-skills/architecture-review/reference/fallbacks.md +11 -0
  15. package/bundled-skills/architecture-review/reference/graph.md +15 -0
  16. package/bundled-skills/architecture-review/reference/mcp.md +14 -0
  17. package/bundled-skills/architecture-review/reference/workflow.md +15 -0
  18. package/bundled-skills/architecture-review/templates/architecture-review.md +21 -0
  19. package/bundled-skills/code-review-sensei/SKILL.md +177 -0
  20. package/bundled-skills/codebase-onboarding/README.md +42 -0
  21. package/bundled-skills/codebase-onboarding/SKILL.md +77 -0
  22. package/bundled-skills/codebase-onboarding/examples.md +11 -0
  23. package/bundled-skills/codebase-onboarding/reference/best-practices.md +7 -0
  24. package/bundled-skills/codebase-onboarding/reference/capabilities.md +20 -0
  25. package/bundled-skills/codebase-onboarding/reference/fallbacks.md +11 -0
  26. package/bundled-skills/codebase-onboarding/reference/graph.md +15 -0
  27. package/bundled-skills/codebase-onboarding/reference/mcp.md +14 -0
  28. package/bundled-skills/codebase-onboarding/reference/workflow.md +15 -0
  29. package/bundled-skills/codebase-onboarding/templates/repository-onboarding.md +21 -0
  30. package/bundled-skills/connection-auth-rules/SKILL.md +199 -0
  31. package/bundled-skills/connection-auth-rules/fetch_schema.py +320 -0
  32. package/bundled-skills/dependency-analysis/README.md +42 -0
  33. package/bundled-skills/dependency-analysis/SKILL.md +76 -0
  34. package/bundled-skills/dependency-analysis/examples.md +11 -0
  35. package/bundled-skills/dependency-analysis/reference/best-practices.md +7 -0
  36. package/bundled-skills/dependency-analysis/reference/capabilities.md +20 -0
  37. package/bundled-skills/dependency-analysis/reference/fallbacks.md +11 -0
  38. package/bundled-skills/dependency-analysis/reference/graph.md +15 -0
  39. package/bundled-skills/dependency-analysis/reference/mcp.md +14 -0
  40. package/bundled-skills/dependency-analysis/reference/workflow.md +15 -0
  41. package/bundled-skills/dependency-analysis/templates/dependency-review.md +21 -0
  42. package/bundled-skills/devops-pipeline-builder/SKILL.md +200 -0
  43. package/bundled-skills/eas-app-stores/SKILL.md +197 -0
  44. package/bundled-skills/eas-app-stores/agents/openai.yaml +4 -0
  45. package/bundled-skills/eas-app-stores/references/app-store-metadata.md +497 -0
  46. package/bundled-skills/eas-app-stores/references/ios-app-store.md +376 -0
  47. package/bundled-skills/eas-app-stores/references/native-ios.md +167 -0
  48. package/bundled-skills/eas-app-stores/references/play-store.md +244 -0
  49. package/bundled-skills/eas-app-stores/references/testflight.md +62 -0
  50. package/bundled-skills/eas-app-stores/references/workflows.md +120 -0
  51. package/bundled-skills/eas-hosting/SKILL.md +448 -0
  52. package/bundled-skills/eas-hosting/agents/openai.yaml +4 -0
  53. package/bundled-skills/eas-observe/SKILL.md +75 -0
  54. package/bundled-skills/eas-observe/agents/openai.yaml +4 -0
  55. package/bundled-skills/eas-observe/references/metrics.md +98 -0
  56. package/bundled-skills/eas-observe/references/queries.md +403 -0
  57. package/bundled-skills/eas-observe/references/setup.md +476 -0
  58. package/bundled-skills/eas-observe/references/third-party.md +136 -0
  59. package/bundled-skills/eas-simulator/SKILL.md +251 -0
  60. package/bundled-skills/eas-simulator/agents/openai.yaml +4 -0
  61. package/bundled-skills/eas-simulator/references/controllers.md +135 -0
  62. package/bundled-skills/eas-simulator/references/run-your-app.md +240 -0
  63. package/bundled-skills/eas-simulator/references/troubleshooting.md +47 -0
  64. package/bundled-skills/eas-workflows/SKILL.md +119 -0
  65. package/bundled-skills/eas-workflows/agents/openai.yaml +4 -0
  66. package/bundled-skills/eas-workflows/scripts/fetch.js +109 -0
  67. package/bundled-skills/expo-animation/LICENSE +21 -0
  68. package/bundled-skills/expo-animation/RECIPES.md +385 -0
  69. package/bundled-skills/expo-animation/SKILL.md +295 -0
  70. package/bundled-skills/expo-animation/agents/openai.yaml +4 -0
  71. package/bundled-skills/fact-check-x-unified/SKILL.md +178 -0
  72. package/bundled-skills/fact-check-x-unified/agents/openai.yaml +4 -0
  73. package/bundled-skills/fact-check-x-unified/references/acceptance-criteria.md +44 -0
  74. package/bundled-skills/fact-check-x-unified/references/contracts.md +39 -0
  75. package/bundled-skills/fact-check-x-unified/scripts/common.py +31 -0
  76. package/bundled-skills/fact-check-x-unified/scripts/fact_check_x.py +1832 -0
  77. package/bundled-skills/fact-check-x-unified/scripts/trusted_search_config.py +324 -0
  78. package/bundled-skills/fact-check-x-unified/tests/anchor_downgrade_test.py +90 -0
  79. package/bundled-skills/fact-check-x-unified/tests/multi_platform_test.py +369 -0
  80. package/bundled-skills/fact-check-x-unified/tests/smoke_test.py +740 -0
  81. package/bundled-skills/fact-check-x-unified/tests/stage_checkpoint_test.py +103 -0
  82. package/bundled-skills/fact-check-x-unified/tests/trusted_search_config_test.py +156 -0
  83. package/bundled-skills/gpt-taste/SKILL.md +8 -1
  84. package/bundled-skills/hf-cli/SKILL.md +263 -0
  85. package/bundled-skills/huggingface-community-evals/SKILL.md +228 -0
  86. package/bundled-skills/huggingface-community-evals/examples/.env.example +3 -0
  87. package/bundled-skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
  88. package/bundled-skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
  89. package/bundled-skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
  90. package/bundled-skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
  91. package/bundled-skills/huggingface-datasets/SKILL.md +130 -0
  92. package/bundled-skills/jev-social/SKILL.md +182 -0
  93. package/bundled-skills/longbridge-derivatives/SKILL.md +117 -0
  94. package/bundled-skills/longbridge-derivatives/references/option.md +36 -0
  95. package/bundled-skills/longbridge-derivatives/references/options-advanced.md +101 -0
  96. package/bundled-skills/longbridge-derivatives/references/options-pnl.md +74 -0
  97. package/bundled-skills/longbridge-derivatives/references/options-strategy.md +82 -0
  98. package/bundled-skills/longbridge-derivatives/references/options-volatility.md +70 -0
  99. package/bundled-skills/longbridge-derivatives/references/warrant.md +12 -0
  100. package/bundled-skills/longbridge-quant/SKILL.md +151 -0
  101. package/bundled-skills/longbridge-quant/references/correlation.md +51 -0
  102. package/bundled-skills/longbridge-quant/references/execution-model.md +68 -0
  103. package/bundled-skills/longbridge-quant/references/factor-research.md +95 -0
  104. package/bundled-skills/longbridge-quant/references/factor-screen.md +101 -0
  105. package/bundled-skills/longbridge-quant/references/hedging.md +136 -0
  106. package/bundled-skills/longbridge-quant/references/ml-strategy.md +77 -0
  107. package/bundled-skills/longbridge-quant/references/multifactor.md +68 -0
  108. package/bundled-skills/longbridge-quant/references/pairs-trading.md +61 -0
  109. package/bundled-skills/longbridge-quant/references/quant-cli.md +133 -0
  110. package/bundled-skills/longbridge-quant/references/quant-stats.md +150 -0
  111. package/bundled-skills/longbridge-quant/references/seasonality.md +50 -0
  112. package/bundled-skills/longbridge-quant/references/strategy-optimizer.md +68 -0
  113. package/bundled-skills/longbridge-quant/references/volatility-strategy.md +52 -0
  114. package/bundled-skills/longbridge-research/SKILL.md +187 -0
  115. package/bundled-skills/longbridge-research/references/company-profile.md +96 -0
  116. package/bundled-skills/longbridge-research/references/company-tearsheet.md +82 -0
  117. package/bundled-skills/longbridge-research/references/competitive-analysis.md +81 -0
  118. package/bundled-skills/longbridge-research/references/consensus.md +92 -0
  119. package/bundled-skills/longbridge-research/references/coverage-initiation.md +76 -0
  120. package/bundled-skills/longbridge-research/references/defi-yield.md +60 -0
  121. package/bundled-skills/longbridge-research/references/finance-calendar.md +165 -0
  122. package/bundled-skills/longbridge-research/references/financial-planning.md +77 -0
  123. package/bundled-skills/longbridge-research/references/forecast-eps.md +39 -0
  124. package/bundled-skills/longbridge-research/references/fund-holder.md +44 -0
  125. package/bundled-skills/longbridge-research/references/hkipo-analysis.md +101 -0
  126. package/bundled-skills/longbridge-research/references/industry-peers.md +46 -0
  127. package/bundled-skills/longbridge-research/references/industry-rank.md +62 -0
  128. package/bundled-skills/longbridge-research/references/insider-trades.md +48 -0
  129. package/bundled-skills/longbridge-research/references/institution-rating.md +62 -0
  130. package/bundled-skills/longbridge-research/references/investment-ideas.md +69 -0
  131. package/bundled-skills/longbridge-research/references/investment-proposal.md +95 -0
  132. package/bundled-skills/longbridge-research/references/investors.md +87 -0
  133. package/bundled-skills/longbridge-research/references/onchain.md +70 -0
  134. package/bundled-skills/longbridge-research/references/post-investment.md +76 -0
  135. package/bundled-skills/longbridge-research/references/shareholder.md +72 -0
  136. package/bundled-skills/longbridge-research/references/short-positions.md +50 -0
  137. package/bundled-skills/longbridge-research/references/short-trades.md +50 -0
  138. package/bundled-skills/longbridge-research/references/stock-research.md +61 -0
  139. package/bundled-skills/longbridge-research/references/thesis-tracker.md +64 -0
  140. package/bundled-skills/makepad-2-0-animation/SKILL.md +318 -0
  141. package/bundled-skills/makepad-2-0-animation/references/animator-reference.md +433 -0
  142. package/bundled-skills/makepad-2-0-dsl/SKILL.md +492 -0
  143. package/bundled-skills/makepad-2-0-dsl/references/dsl-syntax-reference.md +511 -0
  144. package/bundled-skills/makepad-2-0-dsl/references/extended-guide.md +56 -0
  145. package/bundled-skills/makepad-2-0-dsl/references/property-system.md +757 -0
  146. package/bundled-skills/makepad-2-0-events/SKILL.md +497 -0
  147. package/bundled-skills/makepad-2-0-events/references/event-patterns.md +802 -0
  148. package/bundled-skills/makepad-2-0-events/references/extended-guide.md +590 -0
  149. package/bundled-skills/makepad-2-0-layout/SKILL.md +499 -0
  150. package/bundled-skills/makepad-2-0-layout/references/extended-guide.md +243 -0
  151. package/bundled-skills/makepad-2-0-layout/references/layout-patterns.md +881 -0
  152. package/bundled-skills/makepad-2-0-widgets/SKILL.md +261 -0
  153. package/bundled-skills/makepad-2-0-widgets/references/widget-advanced.md +648 -0
  154. package/bundled-skills/makepad-2-0-widgets/references/widget-catalog.md +547 -0
  155. package/bundled-skills/meeting-distiller-pro/SKILL.md +120 -0
  156. package/bundled-skills/monte-carlo-analyze-root-cause/SKILL.md +12 -1
  157. package/bundled-skills/monte-carlo-asset-health/SKILL.md +12 -1
  158. package/bundled-skills/monte-carlo-context-detection/SKILL.md +170 -0
  159. package/bundled-skills/monte-carlo-context-detection/references/signal-definitions.md +46 -0
  160. package/bundled-skills/remotion-captions/SKILL.md +57 -0
  161. package/bundled-skills/remotion-captions/agents/openai.yaml +7 -0
  162. package/bundled-skills/remotion-captions/assets/remotion-icon.svg +4 -0
  163. package/bundled-skills/remotion-captions/display-captions.md +190 -0
  164. package/bundled-skills/remotion-captions/import-srt-captions.md +73 -0
  165. package/bundled-skills/remotion-captions/transcribe-captions.md +70 -0
  166. package/bundled-skills/remotion-create/SKILL.md +106 -0
  167. package/bundled-skills/remotion-create/agents/openai.yaml +7 -0
  168. package/bundled-skills/remotion-create/assets/remotion-icon.svg +4 -0
  169. package/bundled-skills/remotion-create/tailwind.md +11 -0
  170. package/bundled-skills/remotion-create/video-layout.md +9 -0
  171. package/bundled-skills/remotion-docs/SKILL.md +67 -0
  172. package/bundled-skills/remotion-docs/agents/openai.yaml +7 -0
  173. package/bundled-skills/remotion-docs/assets/remotion-icon.svg +4 -0
  174. package/bundled-skills/remotion-interactivity/SKILL.md +270 -0
  175. package/bundled-skills/remotion-interactivity/agents/openai.yaml +7 -0
  176. package/bundled-skills/remotion-interactivity/assets/remotion-icon.svg +4 -0
  177. package/bundled-skills/remotion-render/SKILL.md +48 -0
  178. package/bundled-skills/remotion-render/agents/openai.yaml +7 -0
  179. package/bundled-skills/remotion-render/assets/remotion-icon.svg +4 -0
  180. package/bundled-skills/remotion-render/transparent-videos.md +106 -0
  181. package/bundled-skills/saas-pricing-strategist/SKILL.md +169 -0
  182. package/bundled-skills/score-eval/SKILL.md +35 -0
  183. package/bundled-skills/writing-guidelines/SKILL.md +60 -0
  184. package/package.json +1 -1
  185. package/skills_index.json +980 -3
@@ -0,0 +1,499 @@
1
+ ---
2
+ name: makepad-2-0-layout
3
+ description: Makepad 2.0 guidance for layout; use when building or debugging Makepad UI code.
4
+ source_repo: zhanghandong/makepad-skills
5
+ source_type: community
6
+ source: community
7
+ date_added: '2026-09-21'
8
+ risk: unknown
9
+ ---
10
+
11
+ ## Limitations
12
+
13
+ - Verify against current Makepad 2.0 docs; upstream APIs change frequently.
14
+ - Do not run bundled scripts without explicit user approval.
15
+
16
+ ## When to Use
17
+ - Use when this upstream workflow matches the user's stated goal.
18
+ - Use when the task requires the procedures documented in this skill.
19
+
20
+ # Makepad 2.0 Layout System
21
+
22
+ Makepad uses a **layout turtle** system -- not CSS flexbox, not CSS grid. The turtle walks
23
+ through children one by one, placing each widget according to two core concepts:
24
+
25
+ - **Walk** -- how a widget sizes itself (width, height, margin)
26
+ - **Layout** -- how a container arranges its children (flow, spacing, padding, align)
27
+
28
+ Every container widget (View, SolidView, RoundedView, ScrollYView, etc.) has both Walk
29
+ properties (its own size) and Layout properties (how it lays out children).
30
+
31
+ ---
32
+
33
+ ## Walk System (Widget Sizing)
34
+
35
+ Walk controls how an individual widget claims space inside its parent.
36
+
37
+ ### width / height
38
+
39
+ | Syntax | Meaning |
40
+ |--------|---------|
41
+ | `width: Fill` | Fill all remaining horizontal space (default) |
42
+ | `width: Fit` | Shrink to fit content |
43
+ | `width: 200` | Fixed 200 pixels |
44
+ | `width: Fill{min: 100 max: 500}` | Fill with constraints |
45
+ | `width: Fit{max: Abs(300)}` | Fit content, capped at 300px |
46
+ | `height: Fill` | Fill all remaining vertical space (default) |
47
+ | `height: Fit` | Shrink to fit content |
48
+ | `height: 100` | Fixed 100 pixels |
49
+
50
+ ```
51
+ use mod.prelude.widgets.*
52
+
53
+ // Fill: takes all available width
54
+ View{
55
+ width: Fill height: Fit
56
+ flow: Down
57
+ Label{text: "I stretch to fill the width"}
58
+ }
59
+
60
+ // Fit: shrinks to content
61
+ View{
62
+ width: Fit height: Fit
63
+ padding: 10
64
+ Label{text: "I am only as wide as this text"}
65
+ }
66
+
67
+ // Fixed: exact pixel size
68
+ View{
69
+ width: 300 height: 200
70
+ Label{text: "I am exactly 300x200 pixels"}
71
+ }
72
+
73
+ // Constrained Fill: fills but within bounds
74
+ View{
75
+ width: Fill{min: 200 max: 600} height: Fit
76
+ flow: Down padding: 16
77
+ Label{text: "I fill available space but stay between 200-600px"}
78
+ }
79
+ ```
80
+
81
+ ### CRITICAL: height: Fit on Containers
82
+
83
+ **This is the number one layout bug in Makepad.**
84
+
85
+ The default height is `Fill`. When your output renders inside a `Fit` container,
86
+ `Fill` inside `Fit` creates a circular dependency and resolves to **0 pixels**.
87
+ Your entire UI becomes invisible.
88
+
89
+ **Rule: ALWAYS set `height: Fit` on every View, SolidView, RoundedView, and similar
90
+ container unless the parent has a fixed or Fill height.**
91
+
92
+ ```
93
+ // CORRECT -- height: Fit makes the container visible
94
+ View{
95
+ width: Fill height: Fit
96
+ flow: Down padding: 10
97
+ Label{text: "I am visible"}
98
+ }
99
+
100
+ // WRONG -- defaults to height: Fill, resolves to 0px, invisible
101
+ View{
102
+ width: Fill
103
+ flow: Down padding: 10
104
+ Label{text: "I am invisible (0px tall)"}
105
+ }
106
+ ```
107
+
108
+ **Exceptions where height: Fill is acceptable:**
109
+ 1. Inside a fixed-height parent:
110
+ ```
111
+ View{
112
+ height: 400
113
+ View{
114
+ height: Fill
115
+ Label{text: "I fill the 400px parent"}
116
+ }
117
+ }
118
+ ```
119
+ 2. Inside a `height: Fill` chain that ultimately reaches a known size (e.g., Window body).
120
+ 3. ScrollYView always uses `height: Fill` because it must fill its parent to scroll.
121
+
122
+ ### margin
123
+
124
+ Margin adds space around the outside of a widget.
125
+
126
+ ```
127
+ // Uniform margin on all sides
128
+ Label{text: "Hello" margin: 10}
129
+
130
+ // Selective margin with Inset
131
+ Label{
132
+ text: "Indented"
133
+ margin: Inset{top: 5 bottom: 5 left: 20 right: 20}
134
+ }
135
+
136
+ // Zero margin (note the trailing dot for float literal)
137
+ Label{text: "Flush" margin: 0.}
138
+ ```
139
+
140
+ ---
141
+
142
+ ## Layout System (Child Arrangement)
143
+
144
+ Layout controls how a container positions its children.
145
+
146
+ ### flow (Direction)
147
+
148
+ | Syntax | Meaning | CSS Equivalent |
149
+ |--------|---------|----------------|
150
+ | `flow: Right` | Left-to-right, single line (default) | `flex-direction: row` |
151
+ | `flow: Down` | Top-to-bottom, single column | `flex-direction: column` |
152
+ | `flow: Overlay` | Stack children on top of each other | `position: absolute` stacking |
153
+ | `flow: Flow.Right{wrap: true}` | Left-to-right with wrapping | `flex-wrap: wrap` |
154
+ | `flow: Flow.Down{wrap: true}` | Top-to-bottom with wrapping | column wrap |
155
+
156
+ ```
157
+ use mod.prelude.widgets.*
158
+
159
+ // Vertical stack (most common)
160
+ View{
161
+ width: Fill height: Fit
162
+ flow: Down spacing: 10
163
+ Label{text: "First"}
164
+ Label{text: "Second"}
165
+ Label{text: "Third"}
166
+ }
167
+
168
+ // Horizontal row
169
+ View{
170
+ width: Fill height: Fit
171
+ flow: Right spacing: 10
172
+ Label{text: "Left"}
173
+ Label{text: "Center"}
174
+ Label{text: "Right"}
175
+ }
176
+
177
+ // Overlay -- children stacked on top of each other
178
+ View{
179
+ width: Fill height: 200
180
+ flow: Overlay
181
+ Image{width: Fill height: Fill fit: ImageFit.Biggest}
182
+ View{
183
+ width: Fill height: Fit
184
+ align: Align{x: 0.5 y: 1.0}
185
+ padding: 10
186
+ Label{text: "Caption overlay" draw_text.color: #fff}
187
+ }
188
+ }
189
+
190
+ // Wrapping flow -- like a tag cloud or grid of cards
191
+ View{
192
+ width: Fill height: Fit
193
+ flow: Flow.Right{wrap: true}
194
+ spacing: 8
195
+ padding: 10
196
+ Label{text: "Tag 1" margin: 4}
197
+ Label{text: "Tag 2" margin: 4}
198
+ Label{text: "Tag 3" margin: 4}
199
+ Label{text: "Tag 4" margin: 4}
200
+ }
201
+ ```
202
+
203
+ ### spacing
204
+
205
+ Gap between children. A single number applies uniformly.
206
+
207
+ ```
208
+ View{
209
+ flow: Down spacing: 12
210
+ Label{text: "12px gap below me"}
211
+ Label{text: "12px gap above and below me"}
212
+ Label{text: "12px gap above me"}
213
+ }
214
+ ```
215
+
216
+ ### padding
217
+
218
+ Inner space between the container edge and its children.
219
+
220
+ ```
221
+ // Uniform padding
222
+ View{
223
+ width: Fill height: Fit
224
+ padding: 20
225
+ Label{text: "20px padding on all sides"}
226
+ }
227
+
228
+ // Selective padding with Inset
229
+ View{
230
+ width: Fill height: Fit
231
+ padding: Inset{top: 10 bottom: 10 left: 24 right: 24}
232
+ Label{text: "Different padding per side"}
233
+ }
234
+ ```
235
+
236
+ ### align (Child Alignment)
237
+
238
+ Alignment positions children within the remaining space of the container.
239
+ Values range from 0.0 (start) to 1.0 (end) on each axis.
240
+
241
+ #### Alignment Reference Table
242
+
243
+ | Shorthand | Equivalent | Description |
244
+ |-----------|-----------|-------------|
245
+ | `Center` | `Align{x: 0.5 y: 0.5}` | Center on both axes |
246
+ | `HCenter` | `Align{x: 0.5 y: 0.0}` | Horizontal center, top-aligned |
247
+ | `VCenter` | `Align{x: 0.0 y: 0.5}` | Left-aligned, vertical center |
248
+ | `TopLeft` | `Align{x: 0.0 y: 0.0}` | Top-left corner (default) |
249
+ | `Align{x: 1.0 y: 0.0}` | -- | Top-right corner |
250
+ | `Align{x: 0.0 y: 1.0}` | -- | Bottom-left corner |
251
+ | `Align{x: 1.0 y: 1.0}` | -- | Bottom-right corner |
252
+ | `Align{x: 0.5 y: 1.0}` | -- | Bottom center |
253
+
254
+ ```
255
+ use mod.prelude.widgets.*
256
+
257
+ // Center everything
258
+ View{
259
+ width: Fill height: 300
260
+ align: Center
261
+ Label{text: "I am centered"}
262
+ }
263
+
264
+ // Horizontal center only (children flow from top)
265
+ View{
266
+ width: Fill height: Fit
267
+ flow: Down
268
+ align: HCenter
269
+ Label{text: "I am horizontally centered"}
270
+ }
271
+
272
+ // Vertically center children in a horizontal row
273
+ View{
274
+ width: Fill height: 60
275
+ flow: Right spacing: 10
276
+ align: Align{y: 0.5}
277
+ Label{text: "Vertically centered" draw_text.text_style.font_size: 14}
278
+ Label{text: "Small text" draw_text.text_style.font_size: 9}
279
+ }
280
+ ```
281
+
282
+ ### clip_x / clip_y
283
+
284
+ Controls whether overflowing content is clipped.
285
+
286
+ ```
287
+ // Clip overflow (default behavior)
288
+ View{
289
+ width: 200 height: 100
290
+ clip_x: true
291
+ clip_y: true
292
+ Label{text: "Very long text that will be clipped at the container boundary"}
293
+ }
294
+
295
+ // Allow overflow to be visible
296
+ View{
297
+ width: 200 height: 100
298
+ clip_x: false
299
+ clip_y: false
300
+ Label{text: "This text can overflow beyond the container"}
301
+ }
302
+ ```
303
+
304
+ **Important boundary:** `clip_x: false` / `clip_y: false` only allow a local child to
305
+ paint outside its parent. They do NOT turn that child into a true window-level overlay.
306
+ If the UI element is a popup/menu/tooltip that should float independently of the local
307
+ layout tree, use a top-level `Modal`/overlay owner instead of relying on local overflow.
308
+
309
+ ### Overlay Popups: `walk.abs_pos` vs `margin`
310
+
311
+ For popup-style positioning inside an overlay (`Modal`, tooltip layer, popup owner),
312
+ prefer `walk.abs_pos` over runtime `margin` tweaks.
313
+
314
+ - `margin` is layout spacing. It is best for nudging normal flow children.
315
+ - `walk.abs_pos` is an explicit turtle anchor for overlay-style placement.
316
+ - `button.area().clipped_rect(cx)` gives you the trigger's actual screen-space rect,
317
+ including `view_shift` and clipping.
318
+ - For overlay content, compute the popup's absolute screen-space target, then write
319
+ that into `popup.walk.abs_pos = Some(dvec2(x, y))`.
320
+
321
+ ```rust
322
+ let button_rect = button.area().clipped_rect(cx);
323
+ let popup_pos = dvec2(button_rect.pos.x, button_rect.pos.y - 294.0);
324
+
325
+ if let Some(mut popup) = self.view(cx, ids!(popup)).borrow_mut() {
326
+ popup.walk.abs_pos = Some(popup_pos);
327
+ }
328
+ ```
329
+
330
+ **Rule of thumb:**
331
+ - Popup inside normal layout tree, only slight overflow needed: local child + `clip_x/clip_y: false`
332
+ - Popup anchored to a button but visually outside the component: top-level overlay + `walk.abs_pos`
333
+
334
+ **Common mistake:** Using `script_apply_eval!` to push `margin.top` / `margin.left` on
335
+ overlay content and expecting stable popup coordinates. That often produces misleading
336
+ results because you are still negotiating with layout, not explicitly anchoring the popup.
337
+
338
+ ---
339
+
340
+ ## Inset Syntax
341
+
342
+ The `Inset` type is used for both `padding` and `margin`. It supports two forms:
343
+
344
+ ```
345
+ // Bare number -- uniform on all four sides
346
+ padding: 10
347
+ margin: 5
348
+
349
+ // Inset struct -- specify individual sides
350
+ padding: Inset{top: 10 bottom: 10 left: 20 right: 20}
351
+ margin: Inset{top: 0 bottom: 8 left: 0 right: 0}
352
+
353
+ // Zero (use trailing dot for float literal)
354
+ margin: 0.
355
+
356
+ // You can omit sides you do not need -- they default to 0
357
+ padding: Inset{left: 16 right: 16}
358
+ ```
359
+
360
+ Both `padding` and `margin` accept the same Inset syntax. Padding is inside the
361
+ container, margin is outside.
362
+
363
+ ---
364
+
365
+ ## Scrollable Containers
366
+
367
+ Makepad provides three scrollable view variants. They inherit all View properties
368
+ and add scrollbar behavior.
369
+
370
+ | Widget | Scroll Direction | Typical Use |
371
+ |--------|-----------------|-------------|
372
+ | `ScrollYView` | Vertical only | Long lists, page content |
373
+ | `ScrollXView` | Horizontal only | Wide tables, timelines |
374
+ | `ScrollXYView` | Both axes | Maps, canvases, large content |
375
+
376
+ ```
377
+ use mod.prelude.widgets.*
378
+
379
+ // Vertical scrolling -- the most common pattern
380
+ // Note: ScrollYView uses height: Fill (not Fit) to define the scroll viewport
381
+ ScrollYView{
382
+ width: Fill height: Fill
383
+ flow: Down padding: 10 spacing: 8
384
+ Label{text: "Item 1"}
385
+ Label{text: "Item 2"}
386
+ Label{text: "Item 3"}
387
+ Label{text: "Item 4"}
388
+ Label{text: "Item 5"}
389
+ Label{text: "Item 6"}
390
+ }
391
+
392
+ // Horizontal scrolling
393
+ ScrollXView{
394
+ width: Fill height: 60
395
+ flow: Right spacing: 10 padding: 10
396
+ align: Align{y: 0.5}
397
+ Label{text: "Tab 1"}
398
+ Label{text: "Tab 2"}
399
+ Label{text: "Tab 3"}
400
+ Label{text: "Tab 4"}
401
+ }
402
+
403
+ // Both-axis scrolling
404
+ ScrollXYView{
405
+ width: Fill height: Fill
406
+ Label{text: "Large content that can be scrolled in both directions"}
407
+ }
408
+ ```
409
+
410
+ **When to use which:**
411
+ - `ScrollYView` -- page body, lists, vertical content. **This is what you need 90% of the time.**
412
+ - `ScrollXView` -- horizontal tab bars, code scrolling, timeline views.
413
+ - `ScrollXYView` -- 2D canvases, maps, spreadsheet-style content.
414
+
415
+ **Important:** Scrollable views use `height: Fill` (not `height: Fit`) because they
416
+ need a fixed viewport to scroll within. The content inside grows beyond the viewport.
417
+
418
+ ---
419
+
420
+ ## Filler (Spacer Widget)
421
+
422
+ `Filler{}` is equivalent to `View{width: Fill height: Fill}`. It pushes siblings apart.
423
+
424
+ **Critical rule: Only use Filler between `width: Fit` siblings.**
425
+
426
+ Do NOT use `Filler{}` next to a `width: Fill` sibling. Both compete for remaining space,
427
+ splitting it 50/50 and clipping text.
428
+
429
+ ```
430
+ use mod.prelude.widgets.*
431
+
432
+ // CORRECT: Filler between Fit siblings
433
+ View{
434
+ width: Fill height: Fit
435
+ flow: Right
436
+ align: Align{y: 0.5}
437
+ Label{text: "Left side"}
438
+ Filler{}
439
+ Label{text: "Right side"}
440
+ }
441
+
442
+ // WRONG: Filler next to a Fill sibling -- text gets clipped
443
+ View{
444
+ width: Fill height: Fit
445
+ flow: Right
446
+ Label{width: Fill text: "This gets clipped to half width"}
447
+ Filler{}
448
+ Label{text: "Tag"}
449
+ }
450
+
451
+ // CORRECT alternative: width: Fill naturally pushes Fit siblings
452
+ View{
453
+ width: Fill height: Fit
454
+ flow: Right
455
+ View{
456
+ width: Fill height: Fit
457
+ flow: Down
458
+ Label{text: "Title takes remaining space"}
459
+ Label{text: "Subtitle"}
460
+ }
461
+ Label{text: "Tag"}
462
+ }
463
+ ```
464
+
465
+ ---
466
+
467
+ ## Common Layout Patterns
468
+
469
+ ### Vertical Page Layout
470
+
471
+ ```
472
+ use mod.prelude.widgets.*
473
+
474
+ View{
475
+ width: Fill height: Fit
476
+ flow: Down spacing: 16 padding: 20
477
+ Label{text: "Page Title" draw_text.color: #fff draw_text.text_style.font_size: 18}
478
+ Label{text: "Subtitle text" draw_text.color: #aaa draw_text.text_style.font_size: 12}
479
+ Hr{}
480
+ Label{text: "Body content goes here" draw_text.color: #ddd}
481
+ }
482
+ ```
483
+
484
+ ### Horizontal Toolbar
485
+
486
+ ```
487
+ use mod.prelude.widgets.*
488
+
489
+ SolidView{
490
+ width: Fill height: 44
491
+ flow: Right spacing: 8
492
+ padding: Inset{left: 12 right: 12}
493
+ align: Align{y: 0.5}
494
+ draw_bg.color: #2a2a3d
495
+
496
+ ## Extended reference
497
+
498
+ See [references/extended-guide.md](references/extended-guide.md) for the full upstream document.
499
+