@lowdefy/docs-content 0.0.0-experimental-20260928120643 → 6.1.0

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 (226) hide show
  1. package/README.md +0 -1
  2. package/content/actions/link.md +0 -17
  3. package/content/actions/login.md +5 -23
  4. package/content/actions/logout.md +5 -5
  5. package/content/actions/pdfmake.md +2 -2
  6. package/content/actions/setdarkmode.md +2 -2
  7. package/content/agents/agent-properties.md +2 -4
  8. package/content/agents/agentchat.md +6 -21
  9. package/content/agents/agentconversations.md +2 -2
  10. package/content/concepts/ai-agent-docs.md +101 -313
  11. package/content/concepts/cli.md +3 -34
  12. package/content/concepts/connections-and-requests.md +0 -402
  13. package/content/concepts/custom-html.md +0 -40
  14. package/content/concepts/custom-styling.md +5 -50
  15. package/content/concepts/events-and-actions.md +2 -64
  16. package/content/concepts/i18n.md +2 -7
  17. package/content/concepts/keyboard-shortcuts.md +2 -2
  18. package/content/concepts/layout-overview.md +1 -1
  19. package/content/concepts/logger.md +0 -81
  20. package/content/concepts/lowdefy-schema.md +1 -4
  21. package/content/concepts/menus.md +7 -7
  22. package/content/concepts/module-authoring.md +2 -2
  23. package/content/connections/anthropic.md +2 -162
  24. package/content/connections/awss3.md +0 -54
  25. package/content/connections/google.md +2 -162
  26. package/content/connections/mongodb.md +3 -121
  27. package/content/connections/openai-connection.md +2 -162
  28. package/content/container-blocks/affix.md +7 -47
  29. package/content/container-blocks/alert.md +24 -76
  30. package/content/container-blocks/badge.md +24 -100
  31. package/content/container-blocks/box.md +9 -9
  32. package/content/container-blocks/card.md +25 -80
  33. package/content/container-blocks/carousel.md +7 -60
  34. package/content/container-blocks/collapse.md +9 -87
  35. package/content/container-blocks/configprovider.md +13 -35
  36. package/content/container-blocks/confirmmodal.md +23 -69
  37. package/content/container-blocks/content.md +98 -62
  38. package/content/container-blocks/descriptions.md +4 -45
  39. package/content/container-blocks/drawer.md +28 -92
  40. package/content/container-blocks/dropdownmenu.md +31 -119
  41. package/content/container-blocks/flex.md +62 -40
  42. package/content/container-blocks/footer.md +11 -15
  43. package/content/container-blocks/googlemapsheatmap.md +1 -1
  44. package/content/container-blocks/googlemapsscript.md +2 -2
  45. package/content/container-blocks/header.md +36 -71
  46. package/content/container-blocks/label.md +7 -34
  47. package/content/container-blocks/layout.md +34 -52
  48. package/content/container-blocks/masonry.md +71 -17
  49. package/content/container-blocks/mobilemenu.md +88 -131
  50. package/content/container-blocks/modal.md +26 -114
  51. package/content/container-blocks/pageheadermenu.md +31 -81
  52. package/content/container-blocks/pagesidebarlayout.md +26 -169
  53. package/content/container-blocks/pagesidermenu.md +42 -95
  54. package/content/container-blocks/popover.md +31 -34
  55. package/content/container-blocks/result.md +21 -32
  56. package/content/container-blocks/sider.md +122 -85
  57. package/content/container-blocks/span.md +7 -7
  58. package/content/container-blocks/spinner.md +3 -3
  59. package/content/container-blocks/splitter.md +68 -150
  60. package/content/container-blocks/tabs.md +12 -64
  61. package/content/container-blocks/tooltip.md +46 -22
  62. package/content/container-blocks/watermark.md +4 -22
  63. package/content/controls/reject.md +2 -4
  64. package/content/controls/throw.md +0 -1
  65. package/content/controls/try.md +2 -3
  66. package/content/deployment/deployment-environments.md +6 -8
  67. package/content/deployment/docker.md +7 -22
  68. package/content/deployment/node-server.md +0 -4
  69. package/content/deployment/vercel.md +6 -13
  70. package/content/display-blocks/aggrid.md +11 -26
  71. package/content/display-blocks/anchor.md +15 -15
  72. package/content/display-blocks/avatar.md +37 -57
  73. package/content/display-blocks/breadcrumb.md +21 -70
  74. package/content/display-blocks/button.md +18 -92
  75. package/content/display-blocks/calendar.md +0 -12
  76. package/content/display-blocks/dangeroushtml.md +1 -1
  77. package/content/display-blocks/difflist.md +1 -1
  78. package/content/display-blocks/difftimeline.md +1 -1
  79. package/content/display-blocks/divider.md +3 -64
  80. package/content/display-blocks/dropdownbutton.md +28 -79
  81. package/content/display-blocks/echart.md +1 -35
  82. package/content/display-blocks/floatbutton.md +42 -129
  83. package/content/display-blocks/html.md +1 -61
  84. package/content/display-blocks/icon.md +67 -250
  85. package/content/display-blocks/menu.md +73 -145
  86. package/content/display-blocks/message.md +124 -38
  87. package/content/display-blocks/notification.md +222 -94
  88. package/content/display-blocks/paragraph.md +9 -59
  89. package/content/display-blocks/progress.md +17 -96
  90. package/content/display-blocks/qrcode.md +4 -19
  91. package/content/display-blocks/s3download.md +1 -1
  92. package/content/display-blocks/search.md +7 -17
  93. package/content/display-blocks/skeletonbutton.md +0 -1
  94. package/content/display-blocks/skeletoninput.md +0 -1
  95. package/content/display-blocks/statistic.md +17 -75
  96. package/content/display-blocks/steps.md +25 -58
  97. package/content/display-blocks/tag.md +17 -102
  98. package/content/display-blocks/title.md +11 -50
  99. package/content/display-blocks/tour.md +23 -33
  100. package/content/input-blocks/autocomplete.md +9 -81
  101. package/content/input-blocks/buttonselector.md +8 -45
  102. package/content/input-blocks/checkboxselector.md +7 -97
  103. package/content/input-blocks/checkboxswitch.md +3 -33
  104. package/content/input-blocks/colorselector.md +14 -63
  105. package/content/input-blocks/daterangeselector.md +45 -165
  106. package/content/input-blocks/dateselector.md +41 -139
  107. package/content/input-blocks/datetimeselector.md +49 -158
  108. package/content/input-blocks/inputgallery.md +3 -3
  109. package/content/input-blocks/monthselector.md +52 -120
  110. package/content/input-blocks/multipleselector.md +39 -150
  111. package/content/input-blocks/numberinput.md +12 -98
  112. package/content/input-blocks/pagination.md +14 -70
  113. package/content/input-blocks/paragraphinput.md +37 -51
  114. package/content/input-blocks/passwordinput.md +6 -60
  115. package/content/input-blocks/phonenumberinput.md +26 -59
  116. package/content/input-blocks/radioselector.md +7 -83
  117. package/content/input-blocks/ratingslider.md +26 -57
  118. package/content/input-blocks/s3uploadbutton.md +24 -24
  119. package/content/input-blocks/s3uploaddragger.md +3 -3
  120. package/content/input-blocks/s3uploadphoto.md +5 -5
  121. package/content/input-blocks/segmentedselector.md +32 -72
  122. package/content/input-blocks/selector.md +21 -109
  123. package/content/input-blocks/switch.md +17 -65
  124. package/content/input-blocks/textarea.md +3 -32
  125. package/content/input-blocks/textinput.md +28 -69
  126. package/content/input-blocks/tiptapmentioninput.md +1 -1
  127. package/content/input-blocks/titleinput.md +12 -39
  128. package/content/input-blocks/treeinput.md +25 -49
  129. package/content/input-blocks/treemultipleselector.md +10 -127
  130. package/content/input-blocks/treeselector.md +9 -97
  131. package/content/input-blocks/upload.md +15 -64
  132. package/content/input-blocks/uploaddragger.md +1 -17
  133. package/content/input-blocks/uploadphoto.md +1 -18
  134. package/content/input-blocks/weekselector.md +55 -120
  135. package/content/list-blocks/controlledlist.md +15 -24
  136. package/content/list-blocks/list.md +11 -11
  137. package/content/list-blocks/masonrylist.md +34 -7
  138. package/content/migration/upgrade-guide.md +0 -1
  139. package/content/operators/_app.md +1 -2
  140. package/content/operators/_error.md +1 -23
  141. package/content/operators/_get.md +6 -6
  142. package/content/operators/_operator.md +3 -17
  143. package/content/operators/_ref.md +0 -258
  144. package/content/operators/_type.md +3 -14
  145. package/content/operators/_user.md +3 -3
  146. package/content/other/introduction.md +1 -1
  147. package/content/plugins/plugins-dev.md +0 -66
  148. package/content/plugins/plugins-introduction.md +1 -27
  149. package/content/testing/e2e-configuration.md +1 -8
  150. package/content/testing/e2e-getting-started.md +1 -1
  151. package/content/testing/e2e-introduction.md +1 -1
  152. package/content/tutorial/tutorial-actions-operators.md +2 -2
  153. package/content/tutorial/tutorial-add-blocks.md +2 -2
  154. package/content/tutorial/tutorial-create-page.md +2 -48
  155. package/content/tutorial/tutorial-display-data-page.md +3 -3
  156. package/content/tutorial/tutorial-requests-sql.md +0 -153
  157. package/content/tutorial/tutorial-start.md +1 -66
  158. package/content/user-authentication/login-and-logout.md +8 -158
  159. package/content/user-authentication/users-introduction.md +0 -8
  160. package/index.json +2 -6065
  161. package/package.json +1 -7
  162. package/scripts/extractAgentDocs.js +4 -36
  163. package/content/actions/emailotpsend.md +0 -58
  164. package/content/actions/emailotpverify.md +0 -77
  165. package/content/actions/getlocalstorage.md +0 -41
  166. package/content/actions/magiclinkverify.md +0 -113
  167. package/content/actions/posthogalias.md +0 -29
  168. package/content/actions/posthogcapture.md +0 -49
  169. package/content/actions/posthogcapturepageleave.md +0 -38
  170. package/content/actions/posthogfeatureflag.md +0 -50
  171. package/content/actions/posthoggroup.md +0 -37
  172. package/content/actions/posthogidentify.md +0 -54
  173. package/content/actions/posthoginit.md +0 -66
  174. package/content/actions/posthogoptin.md +0 -29
  175. package/content/actions/posthogoptout.md +0 -29
  176. package/content/actions/posthogpageview.md +0 -37
  177. package/content/actions/posthogreloadfeatureflags.md +0 -47
  178. package/content/actions/posthogreset.md +0 -28
  179. package/content/actions/posthogsetpersonproperties.md +0 -36
  180. package/content/actions/removelocalstorage.md +0 -26
  181. package/content/actions/setlocalstorage.md +0 -32
  182. package/content/adapter-reference/mongodbauthadapter.md +0 -46
  183. package/content/agents/agents-introduction.md +0 -107
  184. package/content/callback-reference/auth0logoutcallback.md +0 -54
  185. package/content/concepts/blocks.md +0 -150
  186. package/content/concepts/dynamic-page-content.md +0 -304
  187. package/content/concepts/html-attributes.md +0 -285
  188. package/content/concepts/lowdefy-api.md +0 -1110
  189. package/content/concepts/notifications.md +0 -155
  190. package/content/concepts/page-and-app-state.md +0 -244
  191. package/content/concepts/theming.md +0 -582
  192. package/content/connections/aigateway.md +0 -368
  193. package/content/connections/axioshttp.md +0 -181
  194. package/content/controls/while.md +0 -46
  195. package/content/display-blocks/clickablehtml.md +0 -239
  196. package/content/display-blocks/eventlog.md +0 -363
  197. package/content/display-blocks/pollingtimer.md +0 -263
  198. package/content/input-blocks/captcha.md +0 -40
  199. package/content/input-blocks/placesautocomplete.md +0 -319
  200. package/content/input-blocks/tagmultipleselector.md +0 -114
  201. package/content/input-blocks/tagselector.md +0 -114
  202. package/content/migration/auth-upgrade.md +0 -327
  203. package/content/migration/v3-to-v4.md +0 -417
  204. package/content/migration/v6-to-v7.md +0 -222
  205. package/content/operators/_cron.md +0 -292
  206. package/content/other/mongodbadapter.md +0 -3
  207. package/content/plugins/plugins-icon-sets.md +0 -267
  208. package/content/plugins/posthog.md +0 -275
  209. package/content/provider-reference/auth-js-providers.md +0 -107
  210. package/content/provider-reference/openidconnectprovider.md +0 -44
  211. package/content/testing/config-tests.md +0 -278
  212. package/content/tutorial/tutorial-requests-api.md +0 -155
  213. package/content/user-authentication/auth-configuration.md +0 -266
  214. package/content/user-authentication/auth-steps.md +0 -138
  215. package/content/user-authentication/mcp-oauth.md +0 -292
  216. package/content/user-authentication/organizations.md +0 -221
  217. package/content/user-authentication/protected-pages-apis.md +0 -97
  218. package/content/user-authentication/roles.md +0 -49
  219. package/content/user-authentication/two-factor.md +0 -229
  220. package/content/user-authentication/user-object.md +0 -58
  221. package/content/websockets/websocket-publish.md +0 -108
  222. package/content/websockets/websocket-subscriptions.md +0 -100
  223. package/content/websockets/websockets-introduction.md +0 -97
  224. package/hazards.json +0 -44
  225. package/scripts/hashDocSources.js +0 -38
  226. package/scripts/recordSourceHashes.js +0 -88
@@ -1,582 +0,0 @@
1
- # Theming
2
-
3
- Lowdefy uses the [Ant Design](https://ant.design/) design token system for theming. This allows you to customize colors, typography, spacing, and more at the app level, component type level, or individual block level.
4
-
5
- ## App-level theme
6
-
7
- Configure your app's theme in `lowdefy.yaml` under `theme.antd`:
8
-
9
- ```yaml
10
- lowdefy: 6.0.0
11
- theme:
12
- antd:
13
- token:
14
- colorPrimary: '#6366f1'
15
- colorSuccess: '#22c55e'
16
- colorWarning: '#f59e0b'
17
- colorError: '#ef4444'
18
- fontSize: 14
19
- borderRadius: 8
20
- ```
21
-
22
- ### Seed tokens
23
-
24
- Seed tokens are the base values from which all other tokens are derived. The most commonly used seed tokens are:
25
-
26
- | Token | Type | Description |
27
- |---|---|---|
28
- | `colorPrimary` | string | Primary brand color |
29
- | `colorSuccess` | string | Success state color |
30
- | `colorWarning` | string | Warning state color |
31
- | `colorError` | string | Error state color |
32
- | `colorInfo` | string | Info state color |
33
- | `colorBgBase` | string | Base background color |
34
- | `colorTextBase` | string | Base text color |
35
- | `fontSize` | number | Base font size (px) |
36
- | `borderRadius` | number | Base border radius (px) |
37
- | `wireframe` | boolean | Enable wireframe style |
38
- | `fontFamily` | string | Font family |
39
-
40
- From these seed tokens, antd derives hundreds of map tokens (e.g. `colorPrimaryHover`, `colorBgContainer`, `fontSizeLG`) automatically.
41
-
42
- ## Algorithms
43
-
44
- Algorithms transform seed tokens into map tokens. Antd provides three built-in algorithms:
45
-
46
- ```yaml
47
- # Dark mode
48
- theme:
49
- antd:
50
- algorithm: dark
51
-
52
- # Compact mode
53
- theme:
54
- antd:
55
- algorithm: compact
56
-
57
- # Combine multiple algorithms
58
- theme:
59
- antd:
60
- algorithm:
61
- - dark
62
- - compact
63
- ```
64
-
65
- | Algorithm | Description |
66
- |---|---|
67
- | `default` | Default light theme |
68
- | `dark` | Dark color scheme |
69
- | `compact` | Reduced spacing and smaller sizes |
70
-
71
- ## Per-component-type overrides
72
-
73
- Override design tokens for all instances of a component type:
74
-
75
- ```yaml
76
- theme:
77
- antd:
78
- token:
79
- colorPrimary: '#6366f1'
80
- components:
81
- Button:
82
- fontWeight: 700
83
- paddingInline: 24
84
- Card:
85
- headerBg: '#f5f5f5'
86
- bodyPadding: '24px'
87
- Input:
88
- activeBorderColor: '#6366f1'
89
- ```
90
-
91
- Each antd component has its own set of component tokens. See the individual block documentation pages for commonly used tokens, or the [antd component token reference](https://ant.design/components/overview/) for the full list.
92
-
93
- ## Per-block overrides
94
-
95
- Override design tokens for a single block instance using `properties.theme`:
96
-
97
- ```yaml
98
- - id: special_button
99
- type: Button
100
- properties:
101
- title: Special Button
102
- theme:
103
- fontWeight: 700
104
- paddingInline: 24
105
- primaryColor: '#6366f1'
106
- ```
107
-
108
- Under the hood, `properties.theme` wraps the block in a scoped [ConfigProvider](/ConfigProvider) with the specified component tokens.
109
-
110
- ### Per-item variants in `Menu`
111
-
112
- antd's `Menu` owns the token scope for all its items, so you can't override tokens per item. Instead, set `properties.danger: true` on a `MenuLink` to switch that single item onto the `dangerItem*` token set, and theme the whole danger state at the block level:
113
-
114
- ```yaml
115
- - id: actions_menu
116
- type: Menu
117
- properties:
118
- mode: vertical
119
- theme:
120
- dangerItemColor: '#cf1322'
121
- dangerItemHoverColor: '#ff4d4f'
122
- dangerItemSelectedBg: '#fff1f0'
123
- links:
124
- - id: edit
125
- type: MenuLink
126
- properties:
127
- title: Edit
128
- icon: edit
129
- - id: delete
130
- type: MenuLink
131
- properties:
132
- title: Delete
133
- icon: delete
134
- danger: true
135
- ```
136
-
137
- For per-item visual tweaks beyond `danger`, use `class` (Tailwind / arbitrary CSS) or `style` on the menu item — both support dot-prefixed slot keys (`.element`, `.icon`, `.label`, `.popup`). See [Custom styling](/custom-styling).
138
-
139
- ## ConfigProvider block
140
-
141
- For scoped theming of a group of blocks, use the [ConfigProvider](/ConfigProvider) container block:
142
-
143
- ```yaml
144
- - id: dark_section
145
- type: ConfigProvider
146
- properties:
147
- algorithm: dark
148
- token:
149
- colorPrimary: '#a855f7'
150
- blocks:
151
- - id: themed_card
152
- type: Card
153
- properties:
154
- title: Dark Themed Card
155
- - id: themed_button
156
- type: Button
157
- properties:
158
- title: Click Me
159
- ```
160
-
161
- ConfigProvider creates a theme scope — all child blocks inherit the specified theme tokens and algorithm.
162
-
163
- ## The `_theme` operator
164
-
165
- Access seed tokens in expressions using the `_theme` operator:
166
-
167
- ```yaml
168
- # String form — get a single token
169
- color:
170
- _theme: colorPrimary
171
-
172
- # Object form — with default value
173
- background:
174
- _theme:
175
- key: colorBgContainer
176
- default: '#ffffff'
177
-
178
- # Get all tokens
179
- allTokens:
180
- _theme:
181
- all: true
182
- ```
183
-
184
- The `_theme` operator resolves seed tokens from `theme.antd.token`. For derived tokens (like hover/active variants), use CSS variables instead: `var(--ant-color-primary-hover)`.
185
-
186
- See the [`_theme` operator reference](/_theme) for full documentation.
187
-
188
- ## CSS variables
189
-
190
- All antd design tokens are available as CSS variables with the `--ant-` prefix. This is useful in `public/styles.css` or when using CSS-based customizations:
191
-
192
- ```css
193
- .my-custom-class {
194
- color: var(--ant-color-primary);
195
- background: var(--ant-color-bg-container);
196
- border: 1px solid var(--ant-color-border);
197
- border-radius: var(--ant-border-radius);
198
- }
199
- ```
200
-
201
- Token names are converted from camelCase to kebab-case for the CSS variable name (e.g. `colorPrimary` → `--ant-color-primary`).
202
-
203
- ## Dark mode
204
-
205
- Lowdefy supports three dark mode behaviors, configured via `theme.darkMode`:
206
-
207
- ```yaml
208
- theme:
209
- darkMode: system # 'system' (default), 'light', or 'dark'
210
- ```
211
-
212
- | Value | Behavior |
213
- |---|---|
214
- | `system` | Follows the OS dark mode preference and updates live when it changes. Users can override with `SetDarkMode`. This is the default. |
215
- | `light` | Forces light mode. `SetDarkMode` preferences are stored but have no visual effect. |
216
- | `dark` | Forces dark mode. `SetDarkMode` preferences are stored but have no visual effect. |
217
-
218
- You can also scope dark mode to a section using [ConfigProvider](/ConfigProvider):
219
-
220
- ```yaml
221
- - id: dark_section
222
- type: ConfigProvider
223
- properties:
224
- algorithm: dark
225
- blocks:
226
- # All blocks here will use dark theme
227
- ```
228
-
229
- ### Easy dark mode toggle
230
-
231
- Add a built-in dark mode toggle to your page layout with a single property:
232
-
233
- ```yaml
234
- - id: my_page
235
- type: PageHeaderMenu # or PageSiderMenu
236
- properties:
237
- darkModeToggle: true
238
- ```
239
-
240
- This renders a moon/sun icon in the header that cycles through light, dark, and system preferences. The preference is persisted to `localStorage`.
241
-
242
- For custom toggle implementations, see the programmatic approach below.
243
-
244
- ### Programmatic dark mode toggle
245
-
246
- Use the `SetDarkMode` action with `_media: darkMode` to let users control dark mode at runtime:
247
-
248
- ```yaml
249
- - id: dark_mode_toggle
250
- type: Button
251
- properties:
252
- hideTitle: true
253
- icon:
254
- _if:
255
- test:
256
- _media: darkMode
257
- then: theme-light
258
- else: theme-dark
259
- events:
260
- onClick:
261
- - id: toggle
262
- type: SetDarkMode
263
- ```
264
-
265
- Without params, `SetDarkMode` cycles through `light`, `dark`, and `system`. You can also set a specific preference:
266
-
267
- ```yaml
268
- - id: set_system
269
- type: SetDarkMode
270
- params:
271
- darkMode: system
272
- ```
273
-
274
- The user's preference is persisted to `localStorage` and survives page refreshes. Use `_media: darkModePreference` to read the current preference (`'system'`, `'light'`, or `'dark'`), and `_media: darkMode` for the effective boolean state.
275
-
276
- `SetDarkMode` automatically merges the `dark` algorithm with any existing algorithm configured in `theme.antd.algorithm`. For example, if your app uses `algorithm: compact`, toggling dark mode produces `[compact, dark]`.
277
-
278
- See the [`SetDarkMode` action reference](/SetDarkMode) and [`_media` operator reference](/_media) for full documentation.
279
-
280
- ### Tip: Use CSS variables for dark-mode-safe colors
281
-
282
- When styling blocks with custom colors (e.g. `cellStyle` in AgGrid, or `style` on any block), avoid hardcoded hex values — they won't adapt to dark mode. Use antd CSS variables instead:
283
-
284
- ```yaml
285
- # Bad — hardcoded colors look washed out in dark mode
286
- cellStyle:
287
- backgroundColor: '#e6f7ff'
288
-
289
- # Good — antd palette tokens adapt automatically
290
- cellStyle:
291
- backgroundColor: var(--ant-blue-1)
292
- ```
293
-
294
- Useful palette variables: `var(--ant-blue-1)`, `var(--ant-green-1)`, `var(--ant-orange-1)`, `var(--ant-red-1)`, etc. For semantic colors, use `var(--ant-color-primary-bg)`, `var(--ant-color-success-bg)`, `var(--ant-color-warning-bg)`, `var(--ant-color-error-bg)`.
295
-
296
- ### Customizing base colors per mode
297
-
298
- Antd's default dark algorithm uses pure black (`#000`) for `colorBgLayout`, and the default light algorithm uses a stark off-white. If you want softer, more modern base surfaces, use `lightToken` and `darkToken` on `theme.antd`. These are merged on top of `theme.antd.token` only when the matching mode is active, so you get full per-mode control without juggling two separate theme files:
299
-
300
- ```yaml
301
- theme:
302
- antd:
303
- token: # Shared — applied in both modes
304
- colorPrimary: '#6366f1'
305
- borderRadius: 8
306
- lightToken: # Merged when light mode is active
307
- colorBgLayout: '#fafafa'
308
- colorBgContainer: '#ffffff'
309
- darkToken: # Merged when dark mode is active
310
- colorBgLayout: '#0f1117'
311
- colorBgContainer: '#18181b'
312
- colorBgElevated: '#1f2937'
313
- darkMode: system
314
- ```
315
-
316
- Tokens to customize for a softer base surface:
317
-
318
- | Token | Where it shows up |
319
- |---|---|
320
- | `colorBgLayout` | Page background behind the layout — also applied to the `<html>` element to prevent navigation flash |
321
- | `colorBgContainer` | Card, Table, Input, Modal body fill |
322
- | `colorBgElevated` | Popover, Dropdown, Tooltip-host surfaces |
323
- | `colorText` | Primary text color |
324
- | `colorTextSecondary` | Secondary / muted text |
325
-
326
- The pre-hydration script reads `darkToken.colorBgLayout` and `lightToken.colorBgLayout` directly, so the `<html>` background matches your configured color on first paint — there is no flash of `#000` or `#fff` before hydration. If you don't set a `lightToken.colorBgLayout`, light mode keeps the browser default white (today's behavior).
327
-
328
- ### Per-mode component overrides
329
-
330
- `colorBg*` seed tokens don't reach every component — Layout's header/sider and Menu have their own component tokens (`Layout.headerBg`, `Layout.siderBg`, `Menu.darkItemBg`, etc.). Use `darkComponents` and `lightComponents` alongside `darkToken`/`lightToken` to soften these surfaces in the active mode only:
331
-
332
- ```yaml
333
- theme:
334
- antd:
335
- darkToken:
336
- colorBgLayout: '#0f172a'
337
- colorBgContainer: '#111a2e'
338
- darkComponents:
339
- Layout:
340
- bodyBg: '#0f172a'
341
- headerBg: '#0b1120'
342
- siderBg: '#0b1120'
343
- triggerBg: '#111a2e'
344
- triggerColor: '#e2e8f0'
345
- Menu:
346
- darkItemBg: '#0b1120'
347
- darkSubMenuItemBg: '#0b1120'
348
- darkPopupBg: '#111a2e'
349
- darkItemSelectedBg: '#1e293b'
350
- darkItemHoverBg: '#111a2e'
351
- ```
352
-
353
- `darkComponents` / `lightComponents` are merged per-component (deep at the component name level) on top of the shared `components`, so you only need to specify the per-mode deltas.
354
-
355
- See antd's [design token reference](https://ant.design/docs/react/customize-theme#theme) for the full list of tokens you can override.
356
-
357
- ## Tailwind theme bridge (`theme.tailwind`)
358
-
359
- Lowdefy automatically bridges antd design tokens to Tailwind CSS theme variables. This means Tailwind utility classes like `text-primary` or `bg-bg-container` resolve to the current antd theme — including when you switch to dark mode.
360
-
361
- ### Default bridged tokens
362
-
363
- The following Tailwind tokens are mapped to antd CSS variables by default:
364
-
365
- | Tailwind class prefix | Maps to antd token |
366
- |---|---|
367
- | `text-primary`, `bg-primary`, `border-primary` | `colorPrimary` |
368
- | `*-primary-hover` | `colorPrimaryHover` |
369
- | `*-primary-active` | `colorPrimaryActive` |
370
- | `*-primary-bg` | `colorPrimaryBg` |
371
- | `*-success` | `colorSuccess` |
372
- | `*-warning` | `colorWarning` |
373
- | `*-error` | `colorError` |
374
- | `*-info` | `colorInfo` |
375
- | `*-text-primary` | `colorText` |
376
- | `*-text-secondary` | `colorTextSecondary` |
377
- | `*-bg-container` | `colorBgContainer` |
378
- | `*-bg-layout` | `colorBgLayout` |
379
- | `*-border` | `colorBorder` |
380
- | `rounded`, `rounded-sm`, `rounded-lg` | `borderRadius` variants |
381
- | `text-sm`, `text-lg` (font-size) | `fontSize` variants |
382
- | `font-sans` | `fontFamily` |
383
-
384
- This means you can write:
385
-
386
- ```yaml
387
- - id: themed_box
388
- type: Box
389
- class: "bg-bg-container text-text-primary border border-border rounded-lg p-4"
390
- ```
391
-
392
- And the colors will automatically match your antd theme, including dark mode.
393
-
394
- ### Adding custom Tailwind tokens
395
-
396
- Use `theme.tailwind` in `lowdefy.yaml` to add custom tokens or override bridge defaults:
397
-
398
- ```yaml
399
- theme:
400
- antd:
401
- token:
402
- colorPrimary: '#7c3aed'
403
- tailwind:
404
- color:
405
- accent: '#7c3aed'
406
- surface: '#f8fafc'
407
- on-surface: '#1e293b'
408
- spacing:
409
- section: '3rem'
410
- ```
411
-
412
- You can then use these in `class`:
413
-
414
- ```yaml
415
- - id: my_section
416
- type: Box
417
- class: "bg-surface text-on-surface p-section"
418
- ```
419
-
420
- Custom tokens are deep-merged with the default bridge, so all antd-bridged tokens remain available.
421
-
422
- ### Overriding bridge defaults
423
-
424
- To change how a bridge token resolves, set the same key in `theme.tailwind`:
425
-
426
- ```yaml
427
- theme:
428
- tailwind:
429
- color:
430
- primary: '#ff4d4f' # Now a static color, no longer follows antd token
431
- ```
432
-
433
- ## Icons (`theme.icons`)
434
-
435
- Lowdefy draws icons with [Lucide](https://lucide.dev). An icon name is a semantic name (`edit`), a Lucide name in PascalCase (`Pencil`), or a qualified name (`lucide:Pencil`). The [Icon](/Icon) block describes the three forms and the per-icon settings.
436
-
437
- Use semantic names anywhere an icon name is accepted, and in HTML with `data-icon`:
438
-
439
- ```yaml
440
- - id: edit_button
441
- type: Button
442
- properties:
443
- title: Edit
444
- icon: edit
445
- - id: note
446
- type: Html
447
- properties:
448
- html: '<i data-icon="info"></i> Saved <span data-tooltip="Saved 2 minutes ago">just now</span>'
449
- ```
450
-
451
- `theme.icons` sets the icon defaults for the whole app:
452
-
453
- ```yaml
454
- theme:
455
- icons:
456
- set: lucide
457
- size: 1em
458
- strokeWidth: 1.75
459
- nonScalingStroke: true
460
- aliases:
461
- invoice: Receipt
462
- edit: tabler:Pencil
463
- include:
464
- - Flag
465
- ```
466
-
467
- | Key | Default | Description |
468
- | --- | --- | --- |
469
- | `set` | `lucide` | The default icon set. PascalCase names resolve in this set first, then in Lucide. Set it to an installed [icon set](/plugins-icon-sets). |
470
- | `size` | `1em` | Default width and height. `1em` follows the font size, so icons fit text, buttons and menus. |
471
- | `strokeWidth` | `2` | Default line width, in units of the icon's 24px grid. |
472
- | `nonScalingStroke` | `false` | Keep the line width constant in screen pixels at any size. |
473
- | `aliases` | | Add semantic names, or point a built-in one at another icon. |
474
- | `include` | | Icon names to bundle that only appear at runtime. |
475
-
476
- An icon's own `size`, `strokeWidth` and `nonScalingStroke` win over these defaults: `icon: { name: edit, strokeWidth: 1 }`.
477
-
478
- ### Semantic names
479
-
480
- Each built-in semantic name draws a Lucide icon:
481
-
482
- | Name | Lucide icon | Name | Lucide icon |
483
- | --- | --- | --- | --- |
484
- | `add` | Plus | `info` | Info |
485
- | `add-circle` | CirclePlus | `italic` | Italic |
486
- | `arrow-down` | ArrowDown | `link` | Link |
487
- | `arrow-left` | ArrowLeft | `list` | List |
488
- | `arrow-right` | ArrowRight | `loading` | LoaderCircle |
489
- | `arrow-up` | ArrowUp | `location` | MapPin |
490
- | `attach` | Paperclip | `lock` | Lock |
491
- | `bell` | Bell | `login` | LogIn |
492
- | `bold` | Bold | `logout` | LogOut |
493
- | `bot` | Bot | `mail` | Mail |
494
- | `calendar` | Calendar | `menu` | Menu |
495
- | `camera` | Camera | `message` | MessageSquare |
496
- | `chart` | ChartColumn | `minus` | Minus |
497
- | `check` | Check | `more` | Ellipsis |
498
- | `chevron-down` | ChevronDown | `more-vertical` | EllipsisVertical |
499
- | `chevron-left` | ChevronLeft | `phone` | Phone |
500
- | `chevron-right` | ChevronRight | `print` | Printer |
501
- | `chevron-up` | ChevronUp | `rating-high` | FaceSlightlySmiling |
502
- | `chevrons-left` | ChevronsLeft | `rating-low` | FaceSlightlyFrowning |
503
- | `chevrons-right` | ChevronsRight | `refresh` | RefreshCw |
504
- | `clear` | CircleX | `remove` | CircleMinus |
505
- | `clock` | Clock | `save` | Save |
506
- | `close` | X | `search` | Search |
507
- | `copy` | Copy | `send` | Send |
508
- | `delete` | Trash | `settings` | Settings |
509
- | `document` | FileText | `share` | Share2 |
510
- | `download` | Download | `sidebar-collapse` | PanelLeftClose |
511
- | `drag` | GripVertical | `sidebar-expand` | PanelLeftOpen |
512
- | `edit` | Pencil | `sort` | ArrowUpDown |
513
- | `error` | CircleX | `star` | Star |
514
- | `external-link` | ExternalLink | `strikethrough` | Strikethrough |
515
- | `file` | File | `success` | CircleCheck |
516
- | `filter` | Funnel | `tag` | Tag |
517
- | `folder` | Folder | `theme-dark` | Moon |
518
- | `globe` | Globe | `theme-light` | Sun |
519
- | `grid` | LayoutGrid | `theme-system` | Monitor |
520
- | `heart` | Heart | `unchanged` | CirclePause |
521
- | `help` | CircleQuestionMark | `unlock` | LockOpen |
522
- | `hide` | EyeOff | `upload` | Upload |
523
- | `highlight` | Highlighter | `user` | User |
524
- | `history` | RotateCcwClock | `users` | Users |
525
- | `home` | House | `view` | Eye |
526
- | `icon-missing` | CircleAlert | `warning` | TriangleAlert |
527
- | `image` | Image | | |
528
-
529
- Ant Design icon names also work and map to the same icons: `check-circle` (CircleCheck), `clock-circle` (Clock), `close-circle` (CircleX), `down` (ChevronDown), `ellipsis` (Ellipsis), `environment` (MapPin), `file-text` (FileText), `info-circle` (Info), `left` (ChevronLeft), `plus` (Plus), `printer` (Printer), `reload` (RefreshCw), `right` (ChevronRight), `setting` (Settings), `up` (ChevronUp).
530
-
531
- ### Blocks and Ant Design components follow semantic names
532
-
533
- Blocks choose their own icons by semantic name: the date pickers use `calendar`, input validation uses `error`, `success`, `warning` and `loading`, selectors use `chevron-down`, `clear` and `check`, and the dark mode toggle uses `theme-light`, `theme-dark` and `theme-system`. Ant Design's own icons go through the same names: the close X on modals, drawers, tags and alerts (`close`), alert and message status icons (`success`, `info`, `warning`, `error`), collapse and menu arrows, pagination arrows, and the button spinner (`loading`).
534
-
535
- So an alias restyles your icons and the built-in ones together. This makes every close button a circled X:
536
-
537
- ```yaml
538
- theme:
539
- icons:
540
- aliases:
541
- close: CircleX
542
- ```
543
-
544
- A few Ant Design visuals are not icons and stay as Ant Design draws them: Spin, Progress, QRCode, the Empty and Result illustrations, the date picker panel arrows, and the Switch and Timeline loading states.
545
-
546
- ### Aliases
547
-
548
- Alias names are lowercase kebab-case. An alias target is a set name (`Receipt`) or a qualified name (`tabler:Pencil`), never another semantic name. A semantic name resolves through, from lowest to highest precedence:
549
-
550
- 1. the built-in map above,
551
- 2. the `semantic` maps of the default set's plugins, in `plugins` order,
552
- 3. `theme.icons.aliases`.
553
-
554
- ### Icon sets
555
-
556
- `theme.icons.set` selects an installed [icon set](/plugins-icon-sets). PascalCase names then resolve in that set first and fall back to Lucide, and the set's own semantic map re-skins the block and Ant Design icons it covers. Semantic names the set leaves out keep their Lucide icons. A qualified name such as `lucide:Pencil` always resolves in its own set.
557
-
558
- ### Bundling
559
-
560
- The build bundles only the icons your config names. An icon name that only exists at runtime — read from state or a request — is not in the config, so list it under `theme.icons.include` to bundle it. A name kept in config data, such as `icon: warning` on a status enum that a template turns into `data-icon="{{ status.icon }}"`, is already in the config and gets bundled.
561
-
562
- In production each page loads only its own icons: the names in its config and `_js` functions, the icons its blocks draw, and the icons in `menus` and `global`, which every page can show. The first time a page draws a bundled icon that is not one of its own, such as a name from `include`, from an endpoint or from another page, it loads the rest of the app's icons. The icon keeps its space, empty, until they arrive, and stays loaded for the rest of the visit. A page whose Dynamic content names such an icon loads them before it first renders. The dev server loads every icon.
563
-
564
- An unknown icon name at an icon property fails the build, with a suggestion. Old react-icons names such as `AiOutlineUser` fail too; [V6 to V7](/v6-to-v7) shows how to migrate them.
565
-
566
- ### Icons in HTML
567
-
568
- In any HTML string, `<i data-icon="edit"></i>` renders an icon. [HTML attributes](/html-attributes) describes it with the other attributes HTML understands: tooltips, popovers, links and status tags.
569
-
570
- ## TLDR
571
- - Configure app theme via `theme.antd` in `lowdefy.yaml`.
572
- - Seed tokens (`colorPrimary`, `fontSize`, etc.) drive all derived tokens automatically.
573
- - Use `algorithm: compact` for compact mode. Use `theme.darkMode` for dark mode control.
574
- - Dark mode defaults to `system` (follows OS preference). Set to `light` or `dark` to lock.
575
- - Override tokens per component type via `theme.antd.components`.
576
- - Override tokens per block via `properties.theme`.
577
- - Use [ConfigProvider](/ConfigProvider) block for scoped theming of block groups.
578
- - Access tokens in expressions with the `_theme` operator.
579
- - Icons are Lucide. Use semantic names (`icon: edit`) or Lucide names (`Pencil`), and `data-icon` in HTML; set app-wide `size` and `strokeWidth`, and add names, with `theme.icons`. See [HTML attributes](/html-attributes) for everything HTML understands.
580
- - Access derived tokens in CSS via `var(--ant-color-primary-hover)`.
581
- - Tailwind utility classes (`text-primary`, `bg-bg-container`, etc.) automatically reflect the antd theme.
582
- - Add custom Tailwind tokens via `theme.tailwind` in `lowdefy.yaml`.