@lowdefy/docs-content 0.0.0-experimental-20260710073520

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 (304) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +20 -0
  3. package/content/actions/callapi.md +66 -0
  4. package/content/actions/callmethod.md +41 -0
  5. package/content/actions/copytoclipboard.md +32 -0
  6. package/content/actions/displaymessage.md +53 -0
  7. package/content/actions/downloadcsv.md +89 -0
  8. package/content/actions/fetch.md +50 -0
  9. package/content/actions/geolocationcurrentposition.md +56 -0
  10. package/content/actions/link.md +104 -0
  11. package/content/actions/login.md +85 -0
  12. package/content/actions/logout.md +56 -0
  13. package/content/actions/pdfmake.md +304 -0
  14. package/content/actions/request.md +67 -0
  15. package/content/actions/reset.md +27 -0
  16. package/content/actions/resetvalidation.md +85 -0
  17. package/content/actions/scrollto.md +85 -0
  18. package/content/actions/setdarkmode.md +62 -0
  19. package/content/actions/setfocus.md +33 -0
  20. package/content/actions/setglobal.md +63 -0
  21. package/content/actions/setlocale.md +69 -0
  22. package/content/actions/setstate.md +70 -0
  23. package/content/actions/throw.md +72 -0
  24. package/content/actions/validate.md +87 -0
  25. package/content/actions/wait.md +24 -0
  26. package/content/agents/agent-endpoint-tools.md +190 -0
  27. package/content/agents/agent-mcp-tools.md +124 -0
  28. package/content/agents/agent-multi-agent.md +136 -0
  29. package/content/agents/agent-properties.md +174 -0
  30. package/content/agents/agent-server-hooks.md +336 -0
  31. package/content/agents/agentchat.md +515 -0
  32. package/content/agents/agentconversations.md +148 -0
  33. package/content/concepts/ai-agent-docs.md +190 -0
  34. package/content/concepts/cli.md +213 -0
  35. package/content/concepts/connections-and-requests.md +7 -0
  36. package/content/concepts/custom-html.md +3 -0
  37. package/content/concepts/custom-styling.md +161 -0
  38. package/content/concepts/events-and-actions.md +271 -0
  39. package/content/concepts/hosting-files.md +18 -0
  40. package/content/concepts/i18n.md +320 -0
  41. package/content/concepts/keyboard-shortcuts.md +218 -0
  42. package/content/concepts/layout-overview.md +478 -0
  43. package/content/concepts/lists.md +144 -0
  44. package/content/concepts/logger.md +43 -0
  45. package/content/concepts/lowdefy-schema.md +365 -0
  46. package/content/concepts/menus.md +144 -0
  47. package/content/concepts/module-authoring.md +564 -0
  48. package/content/concepts/modules.md +338 -0
  49. package/content/concepts/operators.md +45 -0
  50. package/content/concepts/overview.md +19 -0
  51. package/content/concepts/references-and-templates.md +207 -0
  52. package/content/concepts/secrets.md +24 -0
  53. package/content/concepts/selectors.md +143 -0
  54. package/content/connections/amazonredshift.md +176 -0
  55. package/content/connections/anthropic.md +232 -0
  56. package/content/connections/awss3.md +313 -0
  57. package/content/connections/azureblobstorage.md +133 -0
  58. package/content/connections/elasticsearch.md +371 -0
  59. package/content/connections/google.md +228 -0
  60. package/content/connections/googlecloudstorage.md +139 -0
  61. package/content/connections/googlesheet.md +313 -0
  62. package/content/connections/knex.md +206 -0
  63. package/content/connections/mariadb.md +177 -0
  64. package/content/connections/mcp.md +134 -0
  65. package/content/connections/mongodb.md +739 -0
  66. package/content/connections/mssql.md +191 -0
  67. package/content/connections/mysql.md +192 -0
  68. package/content/connections/openai-connection.md +228 -0
  69. package/content/connections/postgresql.md +200 -0
  70. package/content/connections/redis.md +116 -0
  71. package/content/connections/sendgridmail.md +94 -0
  72. package/content/connections/smtp.md +149 -0
  73. package/content/connections/sqlite.md +187 -0
  74. package/content/connections/stripe.md +115 -0
  75. package/content/container-blocks/affix.md +413 -0
  76. package/content/container-blocks/alert.md +937 -0
  77. package/content/container-blocks/badge.md +1222 -0
  78. package/content/container-blocks/box.md +1453 -0
  79. package/content/container-blocks/card.md +1200 -0
  80. package/content/container-blocks/carousel.md +2247 -0
  81. package/content/container-blocks/collapse.md +1335 -0
  82. package/content/container-blocks/configprovider.md +1070 -0
  83. package/content/container-blocks/confirmmodal.md +1159 -0
  84. package/content/container-blocks/content.md +597 -0
  85. package/content/container-blocks/descriptions.md +870 -0
  86. package/content/container-blocks/drawer.md +1379 -0
  87. package/content/container-blocks/dropdownmenu.md +643 -0
  88. package/content/container-blocks/flex.md +1510 -0
  89. package/content/container-blocks/footer.md +380 -0
  90. package/content/container-blocks/googlemaps.md +546 -0
  91. package/content/container-blocks/googlemapsheatmap.md +607 -0
  92. package/content/container-blocks/googlemapsscript.md +61 -0
  93. package/content/container-blocks/header.md +302 -0
  94. package/content/container-blocks/label.md +739 -0
  95. package/content/container-blocks/layout.md +604 -0
  96. package/content/container-blocks/masonry.md +1090 -0
  97. package/content/container-blocks/mobilemenu.md +1244 -0
  98. package/content/container-blocks/modal.md +1180 -0
  99. package/content/container-blocks/pageheadermenu.md +614 -0
  100. package/content/container-blocks/pagesidebarlayout.md +438 -0
  101. package/content/container-blocks/pagesidermenu.md +651 -0
  102. package/content/container-blocks/popover.md +1421 -0
  103. package/content/container-blocks/result.md +972 -0
  104. package/content/container-blocks/sider.md +1064 -0
  105. package/content/container-blocks/span.md +747 -0
  106. package/content/container-blocks/spinner.md +267 -0
  107. package/content/container-blocks/splitter.md +1735 -0
  108. package/content/container-blocks/tabs.md +1718 -0
  109. package/content/container-blocks/tooltip.md +1274 -0
  110. package/content/container-blocks/watermark.md +515 -0
  111. package/content/controls/for.md +103 -0
  112. package/content/controls/if.md +107 -0
  113. package/content/controls/log.md +50 -0
  114. package/content/controls/parallel.md +71 -0
  115. package/content/controls/parallel_for.md +36 -0
  116. package/content/controls/reject.md +56 -0
  117. package/content/controls/return.md +66 -0
  118. package/content/controls/set_state.md +98 -0
  119. package/content/controls/switch.md +90 -0
  120. package/content/controls/throw.md +79 -0
  121. package/content/controls/try.md +88 -0
  122. package/content/deployment/docker.md +149 -0
  123. package/content/deployment/node-server.md +27 -0
  124. package/content/deployment/vercel.md +101 -0
  125. package/content/display-blocks/aggrid.md +1459 -0
  126. package/content/display-blocks/anchor.md +336 -0
  127. package/content/display-blocks/avatar.md +1154 -0
  128. package/content/display-blocks/breadcrumb.md +517 -0
  129. package/content/display-blocks/button.md +758 -0
  130. package/content/display-blocks/calendar.md +156 -0
  131. package/content/display-blocks/dangeroushtml.md +314 -0
  132. package/content/display-blocks/dangerousmarkdown.md +423 -0
  133. package/content/display-blocks/diffgit.md +44 -0
  134. package/content/display-blocks/difflist.md +225 -0
  135. package/content/display-blocks/diffsidebyside.md +56 -0
  136. package/content/display-blocks/difftimeline.md +94 -0
  137. package/content/display-blocks/divider.md +406 -0
  138. package/content/display-blocks/download.md +60 -0
  139. package/content/display-blocks/dropdownbutton.md +661 -0
  140. package/content/display-blocks/echart.md +418 -0
  141. package/content/display-blocks/floatbutton.md +545 -0
  142. package/content/display-blocks/html.md +311 -0
  143. package/content/display-blocks/icon.md +717 -0
  144. package/content/display-blocks/img.md +479 -0
  145. package/content/display-blocks/markdown.md +520 -0
  146. package/content/display-blocks/markdownwithcode.md +730 -0
  147. package/content/display-blocks/menu.md +1123 -0
  148. package/content/display-blocks/message.md +941 -0
  149. package/content/display-blocks/notification.md +1410 -0
  150. package/content/display-blocks/paragraph.md +643 -0
  151. package/content/display-blocks/progress.md +818 -0
  152. package/content/display-blocks/qrcode.md +519 -0
  153. package/content/display-blocks/s3download.md +240 -0
  154. package/content/display-blocks/search.md +360 -0
  155. package/content/display-blocks/skeleton.md +272 -0
  156. package/content/display-blocks/skeletonavatar.md +222 -0
  157. package/content/display-blocks/skeletonbutton.md +245 -0
  158. package/content/display-blocks/skeletoninput.md +223 -0
  159. package/content/display-blocks/skeletonparagraph.md +201 -0
  160. package/content/display-blocks/statistic.md +485 -0
  161. package/content/display-blocks/steps.md +585 -0
  162. package/content/display-blocks/tag.md +620 -0
  163. package/content/display-blocks/title.md +654 -0
  164. package/content/display-blocks/tour.md +2359 -0
  165. package/content/input-blocks/autocomplete.md +786 -0
  166. package/content/input-blocks/buttonselector.md +964 -0
  167. package/content/input-blocks/checkboxselector.md +765 -0
  168. package/content/input-blocks/checkboxswitch.md +497 -0
  169. package/content/input-blocks/colorselector.md +884 -0
  170. package/content/input-blocks/daterangeselector.md +777 -0
  171. package/content/input-blocks/dateselector.md +693 -0
  172. package/content/input-blocks/datetimeselector.md +791 -0
  173. package/content/input-blocks/inputgallery.md +528 -0
  174. package/content/input-blocks/monthselector.md +717 -0
  175. package/content/input-blocks/multipleselector.md +1337 -0
  176. package/content/input-blocks/numberinput.md +855 -0
  177. package/content/input-blocks/pagination.md +679 -0
  178. package/content/input-blocks/paragraphinput.md +1664 -0
  179. package/content/input-blocks/passwordinput.md +480 -0
  180. package/content/input-blocks/phonenumberinput.md +688 -0
  181. package/content/input-blocks/radioselector.md +820 -0
  182. package/content/input-blocks/ratingslider.md +684 -0
  183. package/content/input-blocks/s3uploadbutton.md +384 -0
  184. package/content/input-blocks/s3uploaddragger.md +305 -0
  185. package/content/input-blocks/s3uploadphoto.md +288 -0
  186. package/content/input-blocks/segmentedselector.md +782 -0
  187. package/content/input-blocks/selector.md +1162 -0
  188. package/content/input-blocks/switch.md +552 -0
  189. package/content/input-blocks/textarea.md +714 -0
  190. package/content/input-blocks/textinput.md +639 -0
  191. package/content/input-blocks/tiptapinput.md +226 -0
  192. package/content/input-blocks/tiptapmentioninput.md +471 -0
  193. package/content/input-blocks/titleinput.md +1094 -0
  194. package/content/input-blocks/treeinput.md +144 -0
  195. package/content/input-blocks/treemultipleselector.md +162 -0
  196. package/content/input-blocks/treeselector.md +185 -0
  197. package/content/input-blocks/upload.md +149 -0
  198. package/content/input-blocks/uploaddragger.md +85 -0
  199. package/content/input-blocks/uploadphoto.md +84 -0
  200. package/content/input-blocks/weekselector.md +630 -0
  201. package/content/list-blocks/controlledlist.md +498 -0
  202. package/content/list-blocks/list.md +529 -0
  203. package/content/list-blocks/listselector.md +301 -0
  204. package/content/list-blocks/masonrylist.md +230 -0
  205. package/content/migration/upgrade-guide.md +106 -0
  206. package/content/migration/v4-to-v5.md +589 -0
  207. package/content/migration/v5-to-v6.md +36 -0
  208. package/content/operators/_actions.md +58 -0
  209. package/content/operators/_and.md +76 -0
  210. package/content/operators/_api.md +254 -0
  211. package/content/operators/_app.md +114 -0
  212. package/content/operators/_args.md +65 -0
  213. package/content/operators/_array.md +331 -0
  214. package/content/operators/_base64.md +49 -0
  215. package/content/operators/_boolean.md +33 -0
  216. package/content/operators/_build.md +166 -0
  217. package/content/operators/_change_case.md +357 -0
  218. package/content/operators/_date.md +415 -0
  219. package/content/operators/_dayjs.md +128 -0
  220. package/content/operators/_diff.md +61 -0
  221. package/content/operators/_divide.md +32 -0
  222. package/content/operators/_eq.md +52 -0
  223. package/content/operators/_event.md +86 -0
  224. package/content/operators/_function.md +52 -0
  225. package/content/operators/_get.md +92 -0
  226. package/content/operators/_global.md +86 -0
  227. package/content/operators/_gt.md +50 -0
  228. package/content/operators/_gte.md +50 -0
  229. package/content/operators/_hash.md +112 -0
  230. package/content/operators/_if.md +30 -0
  231. package/content/operators/_if_none.md +47 -0
  232. package/content/operators/_index.md +48 -0
  233. package/content/operators/_input.md +86 -0
  234. package/content/operators/_intl.md +135 -0
  235. package/content/operators/_item.md +166 -0
  236. package/content/operators/_js.md +113 -0
  237. package/content/operators/_json.md +120 -0
  238. package/content/operators/_jsonata.md +152 -0
  239. package/content/operators/_locale.md +65 -0
  240. package/content/operators/_location.md +40 -0
  241. package/content/operators/_log.md +22 -0
  242. package/content/operators/_lt.md +50 -0
  243. package/content/operators/_lte.md +50 -0
  244. package/content/operators/_math.md +407 -0
  245. package/content/operators/_media.md +83 -0
  246. package/content/operators/_menu.md +62 -0
  247. package/content/operators/_module.md +340 -0
  248. package/content/operators/_mql.md +95 -0
  249. package/content/operators/_ne.md +62 -0
  250. package/content/operators/_not.md +33 -0
  251. package/content/operators/_number.md +159 -0
  252. package/content/operators/_nunjucks.md +117 -0
  253. package/content/operators/_object.md +253 -0
  254. package/content/operators/_operator.md +33 -0
  255. package/content/operators/_or.md +67 -0
  256. package/content/operators/_product.md +45 -0
  257. package/content/operators/_random.md +90 -0
  258. package/content/operators/_ref.md +80 -0
  259. package/content/operators/_regex.md +69 -0
  260. package/content/operators/_request.md +35 -0
  261. package/content/operators/_request_details.md +29 -0
  262. package/content/operators/_secret.md +56 -0
  263. package/content/operators/_state.md +134 -0
  264. package/content/operators/_step.md +98 -0
  265. package/content/operators/_string.md +327 -0
  266. package/content/operators/_subtract.md +24 -0
  267. package/content/operators/_sum.md +45 -0
  268. package/content/operators/_switch.md +37 -0
  269. package/content/operators/_t.md +96 -0
  270. package/content/operators/_theme.md +65 -0
  271. package/content/operators/_type.md +78 -0
  272. package/content/operators/_uri.md +49 -0
  273. package/content/operators/_url_query.md +92 -0
  274. package/content/operators/_user.md +154 -0
  275. package/content/operators/_uuid.md +118 -0
  276. package/content/operators/_var.md +88 -0
  277. package/content/operators/_yaml.md +96 -0
  278. package/content/other/introduction.md +39 -0
  279. package/content/other/next-auth-providers.md +3 -0
  280. package/content/other/updatesession.md +26 -0
  281. package/content/plugins/plugins-actions.md +80 -0
  282. package/content/plugins/plugins-connections.md +98 -0
  283. package/content/plugins/plugins-dev.md +138 -0
  284. package/content/plugins/plugins-introduction.md +29 -0
  285. package/content/plugins/plugins-operators.md +71 -0
  286. package/content/testing/e2e-auth.md +108 -0
  287. package/content/testing/e2e-configuration.md +107 -0
  288. package/content/testing/e2e-getting-started.md +96 -0
  289. package/content/testing/e2e-introduction.md +53 -0
  290. package/content/testing/e2e-mocking.md +155 -0
  291. package/content/testing/e2e-writing-tests.md +214 -0
  292. package/content/tutorial/tutorial-actions-operators.md +222 -0
  293. package/content/tutorial/tutorial-add-blocks.md +86 -0
  294. package/content/tutorial/tutorial-create-page.md +57 -0
  295. package/content/tutorial/tutorial-display-data-page.md +181 -0
  296. package/content/tutorial/tutorial-next-steps.md +53 -0
  297. package/content/tutorial/tutorial-requests-sql.md +22 -0
  298. package/content/tutorial/tutorial-start.md +71 -0
  299. package/content/user-authentication/auth-providers.md +15 -0
  300. package/content/user-authentication/login-and-logout.md +122 -0
  301. package/content/user-authentication/users-introduction.md +31 -0
  302. package/index.json +2281 -0
  303. package/package.json +34 -0
  304. package/scripts/extractAgentDocs.js +130 -0
@@ -0,0 +1,218 @@
1
+ # Keyboard Shortcuts
2
+
3
+ Blocks can bind keyboard shortcuts to events. When the key combination is pressed, the event fires — same as if the user clicked the block.
4
+
5
+ Add a `shortcut` property to the event's long-form object:
6
+
7
+ ###### Shortcut on a button click event:
8
+ ```yaml
9
+ - id: search_btn
10
+ type: Button
11
+ properties:
12
+ title: Search
13
+ events:
14
+ onClick:
15
+ shortcut: mod+K
16
+ try:
17
+ - id: open_search
18
+ type: SetState
19
+ params:
20
+ searchOpen: true
21
+ ```
22
+
23
+ ## Shortcut badge
24
+
25
+ Some blocks render a visual keyboard shortcut badge next to the action label. This helps users discover available shortcuts at a glance.
26
+
27
+ | Block | Shortcut source | Badge location |
28
+ |---|---|---|
29
+ | [Button](/Button) | `events.onClick.shortcut` | Next to button title |
30
+ | [Tag](/Tag) | `events.onClick.shortcut` | Next to tag content |
31
+ | [Anchor](/Anchor) | `events.onClick.shortcut` | Next to anchor text |
32
+ | [Search](/Search) | `properties.shortcut` | Inside search trigger |
33
+ | [Menu](/Menu) | `links[].properties.shortcut` | Next to menu item label |
34
+ | [DropdownMenu](/DropdownMenu) | `links[].properties.shortcut` | Next to dropdown item label |
35
+ | [DropdownButton](/DropdownButton) | `items[].shortcut` | Next to dropdown item label |
36
+
37
+ All blocks can bind keyboard shortcuts to events — the badge is just a visual indicator that these blocks render automatically. See the individual block documentation for examples.
38
+
39
+ ## Shortcut string format
40
+
41
+ Format: `modifier+modifier+key`
42
+
43
+ **Modifiers:**
44
+ - `mod` — `Cmd` on Mac, `Ctrl` on Windows/Linux (platform-aware)
45
+ - `shift` — Shift key
46
+ - `alt` — `Option` on Mac, `Alt` on Windows/Linux
47
+ - `ctrl` — always `Ctrl`, even on Mac
48
+
49
+ **Keys:** Letters (`a`–`z`), numbers (`0`–`9`), and special keys (`Escape`, `Enter`, `Backspace`, `Delete`, `ArrowUp`, `ArrowDown`, `ArrowLeft`, `ArrowRight`, `Tab`, `Space`, `/`, `.`, `,`).
50
+
51
+ **Key sequences** (space-separated): `g i` means press `g`, then `i` within 1 second.
52
+
53
+ | Shortcut | Mac | Windows |
54
+ |---|---|---|
55
+ | `mod+K` | ⌘ K | Ctrl K |
56
+ | `mod+shift+P` | ⌘ ⇧ P | Ctrl Shift P |
57
+ | `Escape` | Esc | Esc |
58
+ | `mod+Enter` | ⌘ ↵ | Ctrl ↵ |
59
+ | `alt+N` | ⌥ N | Alt N |
60
+ | `g i` | G then I | G then I |
61
+
62
+ ## Multiple shortcuts for one event
63
+
64
+ Use an array to bind multiple key combinations to the same event:
65
+
66
+ ```yaml
67
+ events:
68
+ onClick:
69
+ shortcut:
70
+ - mod+K
71
+ - /
72
+ try:
73
+ - id: open_search
74
+ type: SetState
75
+ ```
76
+
77
+ ## Shortcuts on multiple events
78
+
79
+ Each event on a block can have its own shortcut:
80
+
81
+ ```yaml
82
+ - id: users_table
83
+ type: AgGridTable
84
+ events:
85
+ onNewRow:
86
+ shortcut: alt+N
87
+ try:
88
+ - id: new_row
89
+ type: SetState
90
+ onDeleteRow:
91
+ shortcut: mod+Backspace
92
+ try:
93
+ - id: delete_row
94
+ type: Request
95
+ params:
96
+ requestId: deleteUser
97
+ ```
98
+
99
+ ## Common shortcuts
100
+
101
+ Recommended shortcuts for common actions:
102
+
103
+ | Action | Shortcut | Notes |
104
+ |--------|----------|-------|
105
+ | Open search | `mod+K` or `/` | `/` suppressed in text inputs |
106
+ | Close modal or drawer | `Escape` | See note below |
107
+ | Save or submit form | `mod+S` or `mod+Enter` | `mod+S` overrides browser "Save Page" |
108
+ | New record | `alt+N` | Avoids `mod+N` (browser new window) |
109
+ | Delete record | `mod+Backspace` | |
110
+ | Focus search input | `/` | Suppressed while typing |
111
+ | Navigate home | `alt+H` | |
112
+
113
+ > Ant Design's [Modal](/Modal) and [Drawer](/Drawer) components already handle Escape internally. Adding `shortcut: Escape` on an `onClose` event lets you run custom Lowdefy actions (like [`SetState`](/SetState)) when Escape is pressed, but may cause the event to fire twice if the component also closes itself. Use this when you need custom close behavior beyond the component's built-in Escape handling.
114
+
115
+ ## Input field behavior
116
+
117
+ Shortcuts with modifiers (`mod`, `ctrl`, `alt`) fire even when focus is in a text input. Single-key shortcuts (like `Escape` or `/`) are suppressed when focus is in an editable field — pressing `/` while typing won't trigger a shortcut.
118
+
119
+ ## Visibility
120
+
121
+ Shortcuts only fire for visible blocks. If a block's `visible` property evaluates to `false`, its shortcuts are inactive.
122
+
123
+ ## Browser defaults
124
+
125
+ When a shortcut matches, the browser's default action for that key combination is suppressed.
126
+
127
+ > **Warning:** Some browser shortcuts cannot be reliably overridden. Avoid binding these — they may not work or may confuse users:
128
+ > - `mod+N` (new window), `mod+T` (new tab), `mod+W` (close tab)
129
+ > - `mod+R` (reload), `mod+Q` (quit), `mod+L` (address bar)
130
+ >
131
+ > The build warns when a shortcut matches a known browser default.
132
+
133
+ ## Recipes
134
+
135
+ **Search with Cmd+K:**
136
+
137
+ ```yaml
138
+ - id: search_btn
139
+ type: Button
140
+ properties:
141
+ title: Search
142
+ icon: AiOutlineSearch
143
+ events:
144
+ onClick:
145
+ shortcut: mod+K
146
+ try:
147
+ - id: open_search
148
+ type: SetState
149
+ params:
150
+ searchOpen: true
151
+ ```
152
+
153
+ **Save form with Cmd+S:**
154
+
155
+ ```yaml
156
+ - id: save_btn
157
+ type: Button
158
+ properties:
159
+ title: Save
160
+ icon: AiOutlineSave
161
+ events:
162
+ onClick:
163
+ shortcut: mod+S
164
+ try:
165
+ - id: validate
166
+ type: Validate
167
+ - id: save_data
168
+ type: Request
169
+ params:
170
+ requestId: saveRecord
171
+ - id: show_saved
172
+ type: DisplayMessage
173
+ params:
174
+ content: Saved!
175
+ ```
176
+
177
+ **Tab navigation with Alt+1/2/3:**
178
+
179
+ ```yaml
180
+ - id: nav_dashboard
181
+ type: Button
182
+ properties:
183
+ title: Dashboard
184
+ events:
185
+ onClick:
186
+ shortcut: alt+1
187
+ try:
188
+ - id: go
189
+ type: Link
190
+ params:
191
+ pageId: dashboard
192
+
193
+ - id: nav_users
194
+ type: Button
195
+ properties:
196
+ title: Users
197
+ events:
198
+ onClick:
199
+ shortcut: alt+2
200
+ try:
201
+ - id: go
202
+ type: Link
203
+ params:
204
+ pageId: users
205
+
206
+ - id: nav_settings
207
+ type: Button
208
+ properties:
209
+ title: Settings
210
+ events:
211
+ onClick:
212
+ shortcut: alt+3
213
+ try:
214
+ - id: go
215
+ type: Link
216
+ params:
217
+ pageId: settings
218
+ ```
@@ -0,0 +1,478 @@
1
+ # Layout
2
+
3
+ Containers blocks are used to arrange blocks on a page. Blocks of category `container` and `list` all function as container blocks. Container blocks have content slots into which a list of blocks are rendered. `List` category blocks can render content slots for each element in the data array.
4
+
5
+ Blocks on a page can be arranged using a __span__ or __flex__ layout. Blocks in __span__ layout are placed in a 24 column CSS custom properties grid, whereas __flex__ blocks dynamically grows or shrink to fit content into a row depending on content size and screen size.
6
+
7
+ # Content slots
8
+
9
+ Each container has content slots - these are named areas where nested blocks can be placed. All container blocks have a primary content slot. This slot is called `content`. Container blocks might have other content slots, like `header`, `footer`, or `title`. These content slots are implemented specifically by the block.
10
+
11
+ To place blocks in the primary content slot of a container, the block definitions for those blocks can be placed inside the `blocks` array of the container block.
12
+
13
+ > In the following examples, blocks of type `Container` will represent a generic container block, and blocks of type `Block` will represent a generic block. The `Container` block might be a [`Box`](/Box), a [`Card`](/Card), a [`PageHeaderMenu`](/PageHeaderMenu) or any other container block. The `Block` blocks could be any type of block, including other container blocks.
14
+
15
+
16
+ ###### Two blocks in the primary content slot (`content`) of a container:
17
+ ```yaml
18
+ - id: container
19
+ type: Container
20
+ blocks:
21
+ - id: block1
22
+ type: Block
23
+ - id: block2
24
+ type: Block
25
+
26
+ To place blocks in other content slots, the block definitions can be placed in the `blocks` array of the specific slot in the `slots` object:
27
+
28
+ > Note the blocks are placed under `slots.[slotName].blocks`
29
+
30
+
31
+ ###### Blocks in the `header`, `content` and `footer` slots:
32
+ ```yaml
33
+ - id: container
34
+ type: Container
35
+ slots:
36
+ header:
37
+ blocks:
38
+ - id: block1
39
+ type: Block
40
+ content:
41
+ blocks:
42
+ - id: block2
43
+ type: Block
44
+ footer:
45
+ blocks:
46
+ - id: block3
47
+ type: Block
48
+
49
+ Placing blocks both in the `blocks` array, as well as under the `slots.content.blocks` array is an anti-pattern, and in this case the blocks under `blocks` will overwrite those under `slots.content.blocks`.
50
+
51
+ ###### Anti-pattern: Blocks in the `blocks` and `slots.content.blocks`:
52
+ ```yaml
53
+ - id: container
54
+ type: Container
55
+ blocks:
56
+ - id: block1
57
+ type: Block
58
+ slots:
59
+ content:
60
+ blocks:
61
+ - id: block2
62
+ type: Block
63
+
64
+ # Layouts using span
65
+
66
+ Each content slot has 24 columns. Blocks have a `span` property, which determines how many columns the block occupies. Blocks are laid out horizontally, until the sum of the spans is more than 24, then the last block block is wrapped to the next row.
67
+
68
+ By default a block is given a span of 24. This is what makes blocks lay out vertically below each other.
69
+
70
+ > Blocks are also given a default span of 24 for mobile layouts, even if another span is given, to provide a good default mobile experience. Read more about responsive layouts below.
71
+
72
+ ###### Block spans example:
73
+ ```
74
+ - id: container
75
+ type: Container
76
+ blocks:
77
+ - id: block1
78
+ type: Block # Default span of 24
79
+ - id: block2
80
+ type: Block
81
+ layout:
82
+ span: 16 # Two thirds of the area
83
+ - id: block3
84
+ type: Block
85
+ layout:
86
+ span: 8 # Remaining one third of the area
87
+ - id: block4
88
+ type: Block
89
+ layout:
90
+ span: 12
91
+ - id: block5
92
+ type: Block
93
+ layout:
94
+ span: 18 # Sum would be over 24, so wraps to the next row
95
+ ```
96
+
97
+ # Layouts using flex
98
+
99
+ Blocks can also be laid out using [CSS flexbox](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox) properties. These properties are `grow` (`flex-grow`), `shrink` (`flex-shrink`), `size` (`flex-basis`) and `flex` (`flex`). If any of these properties are set, the default span of 24 or any span set in the configuration is not applied. If one of `grow`, `shrink`, or `size` are set, the other properties take their default values. The `flex` property overwrites the `grow`, `shrink`, and `size` properties.
100
+
101
+ # Block layout properties
102
+
103
+ The `layout` object on blocks can be used to control how a block is placed in the layout. The `layout` properties that can be defined are:
104
+
105
+ - `selfAlign`: _Enum_ - Align block vertically in the area. Options are `top`, `middle`, and `bottom`. Default `top.`
106
+ - `align`: _Enum_ - Align content area children vertically. Options are `top`, `middle`, and `bottom`. Default `top.` This value flows to the content area as a default.
107
+ - `flex`: _String_ - Set the [`flex`](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) CSS property. This overwrites the `grow`, `shrink`, and `size` properties.
108
+ - `gap`: _Number_ | _Array_ - Set the gap (space) between blocks in the content area. If an array, the first element is the horizontal gap, and the second is the vertical gap. This value flows to the content area as a default.
109
+ - `grow`: _Number_ - Set the [`flex-grow`](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow) CSS property. Default 0.
110
+ - `justify`: _Enum_ - Justify content area children horizontally. Options are `start`, `end`, `center`, `space-around`, and `space-between`. Default `start`. This value flows to the content area as a default.
111
+ - `direction`: _Enum_ - Set the flex-direction for the content area. Options are `row`, `row-reverse`, `column`, and `column-reverse`. Default `row`. This value flows to the content area as a default.
112
+ - `wrap`: _Enum_ - Set the flex-wrap for the content area. Options are `wrap`, `nowrap`, and `wrap-reverse`. Default `wrap`. This value flows to the content area as a default.
113
+ - `overflow`: _Enum_ - Set the overflow for the content area. Options are `visible`, `hidden`, `scroll`, and `auto`. Default `visible`. This value flows to the content area as a default.
114
+ - `order`: _Number_ - Change the order blocks are rendered in. By default blocks are rendered in the order they appear in the blocks array.
115
+ - `offset`: _Number_ - Number of grid cells to shift the block to the right.
116
+ - `pull`: _Number_ - Shift the block this number of cells to the left. This will make it overlap above with previous blocks.
117
+ - `push`: _Number_ - Shift the block this number of cells to the right. This will make it overlap under with the following blocks.
118
+ - `shrink`: _Number_ - Set the [`flex-shrink`](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink) CSS property. Default 1.
119
+ - `size`: _String_ | _Number_ - Set the [`flex-basis`](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis) CSS property. Default `auto`.
120
+ - `span`: _Number_ - Number of grid cells the block should occupy. Setting `span: 0` hides the block (`display: none`).
121
+
122
+ ### Responsive layouts
123
+
124
+ All the settings defined in the Block `layout` properties can be defined for the various responsive breakpoints. Breakpoints apply to all window width sizes smaller than the breakpoint width, where the smallest breakpoint setting takes precedence.
125
+
126
+ The responsive breakpoints are:
127
+
128
+ - `xs`: window width less than 640px
129
+ - `sm`: window width greater than 640px
130
+ - `md`: window width greater than 768px
131
+ - `lg`: window width greater than 1024px
132
+ - `xl`: window width greater than 1280px
133
+ - `2xl`: window width greater than 1536px
134
+
135
+ The responsive layout settings are applied to the `layout` object. For example making a block half container width and full container width for devices like tablets or smaller:
136
+ ```yaml
137
+ id: responsive_block
138
+ type: Box
139
+ layout:
140
+ span: 12
141
+ md:
142
+ span: 24
143
+ ```
144
+
145
+ > **Note:** Responsive breakpoint settings on `style` have been removed. Only `layout` supports responsive breakpoints. Use Tailwind responsive classes via `class` for responsive styling instead.
146
+
147
+ See the [Migration Guide](/v4-to-v5) for details on all layout changes.
148
+
149
+ ### Block layout properties usage examples:
150
+
151
+ ```
152
+ - id: container
153
+ type: Container
154
+ blocks:
155
+ - id: block1
156
+ type: Block
157
+ layout:
158
+ span: 6
159
+ - id: block2
160
+ type: Block
161
+ layout:
162
+ selfAlign: top
163
+ span: 6
164
+ - id: block3
165
+ type: Block
166
+ layout:
167
+ selfAlign: middle
168
+ span: 6
169
+ - id: block4
170
+ type: Block
171
+ layout:
172
+ selfAlign: bottom
173
+ span: 6
174
+ ```
175
+
176
+ ```
177
+ - id: container
178
+ type: Container
179
+ blocks:
180
+ - id: block1
181
+ type: Block
182
+ layout:
183
+ order: 1
184
+ - id: block2
185
+ type: Block
186
+ ```
187
+
188
+ ```
189
+ - id: container
190
+ type: Container
191
+ blocks:
192
+ - id: block1
193
+ type: Block
194
+ layout:
195
+ offset: 4
196
+ - id: block2
197
+ type: Block
198
+ layout:
199
+ offset: 4
200
+ span: 10
201
+ ```
202
+
203
+ ```
204
+ - id: container
205
+ type: Container
206
+ blocks:
207
+ - id: block1
208
+ type: Block
209
+ layout:
210
+ span: 12
211
+ - id: block2
212
+ type: Block
213
+ style:
214
+ opacity: 0.5
215
+ layout:
216
+ pull: 3
217
+ span: 12
218
+ ```
219
+
220
+ ```
221
+ - id: container
222
+ type: Container
223
+ blocks:
224
+ - id: block1
225
+ type: Block
226
+ layout:
227
+ push: 3
228
+ span: 12
229
+ - id: block2
230
+ type: Block
231
+ style:
232
+ opacity: 0.5
233
+ layout:
234
+ span: 12
235
+ ```
236
+
237
+ # Area layout properties
238
+
239
+ Properties can be set on each area to control how blocks are layed out inside that area. These properties are set under the `areaName` key:
240
+
241
+ The properties that can be set are:
242
+ - `align`: _Enum_ - Align blocks vertically in the area. Options are `top`, `middle`, and `bottom`. Default `top.`
243
+ - `direction`: _Enum_ - Set the [`flex-direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction) CSS property for the area. Options are `row`, `row-reverse`, `column`, and and `column-reverse`. Default `row`.
244
+ - `gap`: _Number_ | _Array_ - Create gap (space) between blocks placed in the area. If an array, the first element is the horizontal gap, and the second is the vertical gap.
245
+ - `justify`: _Enum_ - Justify blocks horizontally inside the area. Options are `start`, `end`, `center`, `space-around`, and `space-between`. Default `start`.
246
+ - `overflow`: _Enum_ - Set the [`overflow`](https://developer.mozilla.org/en-US/docs/Web/CSS/overflow) CSS property for the area. Options are `visible`, `hidden`, `scroll`, and `space-between`. Default `visible`.
247
+ - `wrap`: _Enum_ - Set the [`flex-wrap`](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap) CSS property for the area. Options are `wrap`, `nowrap`, and `wrap-reverse`. Default `wrap`.
248
+
249
+ > **Note:** The `gap`, `align`, `justify`, `direction`, `wrap`, and `overflow` properties can also be set on the parent block's `layout` object, where they flow to the content area as defaults.
250
+
251
+ ### Area layout properties examples:
252
+
253
+ ```yaml
254
+ - id: container
255
+ type: Container
256
+ slots:
257
+ area1:
258
+ align: top
259
+ blocks:
260
+ - id: block1
261
+ type: Block
262
+ layout:
263
+ span: 12
264
+ - id: block2
265
+ type: Block
266
+ layout:
267
+ span: 12
268
+ area2:
269
+ align: middle
270
+ blocks:
271
+ - id: block3
272
+ type: Block
273
+ layout:
274
+ span: 12
275
+ - id: block4
276
+ type: Block
277
+ layout:
278
+ span: 12
279
+ area3:
280
+ align: bottom
281
+ blocks:
282
+ - id: block5
283
+ type: Block
284
+ layout:
285
+ span: 12
286
+ - id: block6
287
+ type: Block
288
+ layout:
289
+ span: 12
290
+
291
+ ##### Area 1 - `align: top`
292
+
293
+ ##### Area 2 - `align: middle`
294
+
295
+ ##### Area 3 - `align: bottom`
296
+
297
+ ```yaml
298
+ - id: container
299
+ type: Container
300
+ slots:
301
+ area1:
302
+ direction: row
303
+ blocks:
304
+ - id: block1
305
+ type: Block
306
+ layout:
307
+ size: auto
308
+ - id: block2
309
+ type: Block
310
+ layout:
311
+ size: auto
312
+ area2:
313
+ direction: row-reverse
314
+ blocks:
315
+ - id: block3
316
+ type: Block
317
+ layout:
318
+ size: auto
319
+ - id: block4
320
+ type: Block
321
+ layout:
322
+ size: auto
323
+ area3:
324
+ direction: column
325
+ blocks:
326
+ - id: block5
327
+ type: Block
328
+ layout:
329
+ size: auto
330
+ - id: block6
331
+ type: Block
332
+ layout:
333
+ size: auto
334
+ area4:
335
+ direction: column-reverse
336
+ blocks:
337
+ - id: block7
338
+ type: Block
339
+ layout:
340
+ size: auto
341
+ - id: block8
342
+ type: Block
343
+ layout:
344
+ size: auto
345
+
346
+ ##### Area 1 - `direction: row`
347
+
348
+ ##### Area 2 - `direction: row-reverse`
349
+
350
+ ##### Area 3 - `direction: column`
351
+
352
+ ##### Area 4 - `direction: column-reverse`
353
+
354
+ ```yaml
355
+ - id: container
356
+ type: Container
357
+ slots:
358
+ area1:
359
+ gap: 16
360
+ blocks:
361
+ - id: block1
362
+ type: Block
363
+ layout:
364
+ span: 12
365
+ - id: block2
366
+ type: Block
367
+ layout:
368
+ span: 12
369
+ - id: block3
370
+ type: Block
371
+
372
+ area2:
373
+ gap: [8, 32]
374
+ blocks:
375
+ - id: block4
376
+ type: Block
377
+ layout:
378
+ span: 12
379
+ - id: block5
380
+ type: Block
381
+ layout:
382
+ span: 12
383
+ - id: block6
384
+ type: Block
385
+
386
+ ##### Area 1 - `gap: 16`
387
+
388
+ ##### Area 2 - `gap: [8, 32]`
389
+
390
+ ```yaml
391
+ - id: container
392
+ type: Container
393
+ slots:
394
+ area1:
395
+ justify: start
396
+ blocks:
397
+ - id: block1
398
+ type: Block
399
+ layout:
400
+ size: auto
401
+ - id: block2
402
+ type: Block
403
+ layout:
404
+ size: auto
405
+ - id: block3
406
+ type: Block
407
+ layout:
408
+ size: auto
409
+ area2:
410
+ justify: end
411
+ blocks:
412
+ - id: block4
413
+ type: Block
414
+ layout:
415
+ size: auto
416
+ - id: block5
417
+ type: Block
418
+ layout:
419
+ size: auto
420
+ - id: block6
421
+ type: Block
422
+ layout:
423
+ size: auto
424
+ area3:
425
+ justify: center
426
+ blocks:
427
+ - id: block7
428
+ type: Block
429
+ layout:
430
+ size: auto
431
+ - id: block8
432
+ type: Block
433
+ layout:
434
+ size: auto
435
+ - id: block9
436
+ type: Block
437
+ layout:
438
+ size: auto
439
+ area4:
440
+ justify: space-around
441
+ blocks:
442
+ - id: block10
443
+ type: Block
444
+ layout:
445
+ size: auto
446
+ - id: block11
447
+ type: Block
448
+ layout:
449
+ size: auto
450
+ - id: block12
451
+ type: Block
452
+ layout:
453
+ size: auto
454
+ area5:
455
+ justify: space-between
456
+ blocks:
457
+ - id: block13
458
+ type: Block
459
+ layout:
460
+ size: auto
461
+ - id: block14
462
+ type: Block
463
+ layout:
464
+ size: auto
465
+ - id: block15
466
+ type: Block
467
+ layout:
468
+ size: auto
469
+
470
+ ##### Area 1 - `justify: start`
471
+
472
+ ##### Area 2 - `justify: end`
473
+
474
+ ##### Area 3 - `justify: center`
475
+
476
+ ##### Area 4 - `justify: space-around`
477
+
478
+ ##### Area 5 - `justify: space-between`