flet-box 1.0.6 → 1.0.8

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 (162) hide show
  1. package/README.md +28 -1
  2. package/bin/cli.js +90 -11
  3. package/bin/commands/auditFix.js +682 -0
  4. package/bin/commands/checkApi.js +20 -6
  5. package/bin/commands/checkUi.js +1369 -0
  6. package/bin/commands/create.js +86 -12
  7. package/bin/commands/createBundle.js +75 -1
  8. package/bin/commands/images.js +349 -0
  9. package/bin/commands/pruneAssets.js +170 -0
  10. package/bin/commands/release.js +34 -1
  11. package/bin/commands/runCloudflare.js +47 -9
  12. package/bin/commands/runServer.js +91 -25
  13. package/bin/commands/toPng.js +346 -0
  14. package/bin/commands/unpack.js +1173 -0
  15. package/bin/ota/loader.js +90 -0
  16. package/bin/utils/appSources.js +101 -0
  17. package/bin/utils/bundleConfig.js +166 -0
  18. package/bin/utils/dtsProps.js +147 -0
  19. package/bin/utils/imageTools.js +271 -0
  20. package/bin/utils/images/bmp.js +99 -0
  21. package/bin/utils/images/gif.js +244 -0
  22. package/bin/utils/images/index.js +163 -0
  23. package/bin/utils/images/jpeg.js +643 -0
  24. package/bin/utils/images/png.js +486 -0
  25. package/bin/utils/images/unsupported.js +29 -0
  26. package/bin/utils/neutralise.js +109 -6
  27. package/bin/utils/pwaShell.js +137 -0
  28. package/bin/utils/templates.js +1653 -471
  29. package/docs/README.md +2 -0
  30. package/docs/cli/README.md +144 -1
  31. package/docs/guides/README.md +2 -0
  32. package/docs/guides/clean-ui.md +211 -0
  33. package/docs/guides/minification-and-protection.md +1 -1
  34. package/docs/guides/online-updates.md +105 -9
  35. package/docs/tools/README.md +1 -1
  36. package/docs/tools/animation.md +1 -1
  37. package/docs/tools/markdown.md +3 -3
  38. package/docs/tools/theme.md +41 -1
  39. package/docs/widget/Accordion.md +4 -0
  40. package/docs/widget/AdMob.md +5 -1
  41. package/docs/widget/AdSense.md +4 -0
  42. package/docs/widget/AnimatedBox.md +7 -3
  43. package/docs/widget/AnimatedText.md +4 -0
  44. package/docs/widget/Audio.md +5 -1
  45. package/docs/widget/Avatar.md +15 -3
  46. package/docs/widget/Badge.md +4 -0
  47. package/docs/widget/Button.md +4 -0
  48. package/docs/widget/COMMON_PROPS.md +52 -0
  49. package/docs/widget/Card.md +4 -0
  50. package/docs/widget/Carousel.md +4 -0
  51. package/docs/widget/Chart.md +4 -0
  52. package/docs/widget/Checkbox.md +4 -0
  53. package/docs/widget/Chip.md +4 -0
  54. package/docs/widget/CircularBar.md +4 -0
  55. package/docs/widget/CircularChart.md +4 -0
  56. package/docs/widget/CodeViewer.md +4 -0
  57. package/docs/widget/Column.md +4 -0
  58. package/docs/widget/Container.md +4 -0
  59. package/docs/widget/DataTable.md +4 -0
  60. package/docs/widget/Divider.md +4 -0
  61. package/docs/widget/DraggBox.md +6 -2
  62. package/docs/widget/Dropdown.md +6 -0
  63. package/docs/widget/DroppBox.md +5 -1
  64. package/docs/widget/FloatingActionButton.md +4 -0
  65. package/docs/widget/GridView.md +4 -0
  66. package/docs/widget/Icon.md +4 -0
  67. package/docs/widget/Image.md +14 -3
  68. package/docs/widget/Input.md +4 -0
  69. package/docs/widget/Inspector.md +2 -2
  70. package/docs/widget/InstallButton.md +4 -0
  71. package/docs/widget/ListTile.md +4 -0
  72. package/docs/widget/ListView.md +4 -0
  73. package/docs/widget/Maps.md +191 -0
  74. package/docs/widget/Markdown.md +4 -0
  75. package/docs/widget/MatrixRain.md +4 -0
  76. package/docs/widget/Pagination.md +4 -0
  77. package/docs/widget/ParallaxBox.md +4 -0
  78. package/docs/widget/ProgressBar.md +4 -0
  79. package/docs/widget/QRCode.md +4 -0
  80. package/docs/widget/README.md +12 -10
  81. package/docs/widget/Radio.md +5 -1
  82. package/docs/widget/Rating.md +4 -0
  83. package/docs/widget/Row.md +4 -0
  84. package/docs/widget/Skeleton.md +4 -0
  85. package/docs/widget/Slider.md +4 -0
  86. package/docs/widget/Stack.md +4 -0
  87. package/docs/widget/Stepper.md +4 -0
  88. package/docs/widget/Switch.md +4 -0
  89. package/docs/widget/Tabs.md +5 -5
  90. package/docs/widget/Text.md +4 -0
  91. package/docs/widget/Tooltip.md +14 -13
  92. package/docs/widget/TreeView.md +4 -0
  93. package/docs/widget/Video.md +6 -2
  94. package/package.json +2 -2
  95. package/src/animations/AnimatedBox.js +4 -1
  96. package/src/animations/MatrixRain.js +3 -3
  97. package/src/core/hmr-client.js +129 -34
  98. package/src/index.d.ts +195 -7
  99. package/src/index.js +2 -0
  100. package/src/navigations/AppBar.js +22 -16
  101. package/src/navigations/BottomNavigation.js +8 -13
  102. package/src/navigations/CollapsibleSideBar.js +30 -8
  103. package/src/navigations/Drawer.js +25 -15
  104. package/src/navigations/DrawerItem.js +3 -1
  105. package/src/navigations/Scaffold.js +26 -12
  106. package/src/navigations/Tabs.js +104 -59
  107. package/src/tools/color.js +54 -0
  108. package/src/tools/index.js +9 -1
  109. package/src/tools/scale.js +41 -0
  110. package/src/tools/shadow.js +20 -0
  111. package/src/utils/index.js +1 -0
  112. package/src/utils/readableInk.js +19 -0
  113. package/src/utils/syntaxHighlight.js +78 -10
  114. package/src/utils/themes.js +217 -54
  115. package/src/utils/units.js +33 -11
  116. package/src/widget-factory/effects.js +56 -5
  117. package/src/widget-factory/processProps.js +10 -1
  118. package/src/widget-factory/remTool.js +15 -29
  119. package/src/widget-factory/stackPosition.js +18 -3
  120. package/src/widget-factory/translateProps.js +60 -1
  121. package/src/widgets/Accordion.js +20 -23
  122. package/src/widgets/AdMob.js +7 -2
  123. package/src/widgets/Avatar.js +236 -133
  124. package/src/widgets/Badge.js +3 -2
  125. package/src/widgets/BottomSheet.js +14 -13
  126. package/src/widgets/Button.js +69 -30
  127. package/src/widgets/Card.js +6 -2
  128. package/src/widgets/Carousel.js +12 -10
  129. package/src/widgets/Chart.js +28 -5
  130. package/src/widgets/Checkbox.js +76 -18
  131. package/src/widgets/Chip.js +31 -10
  132. package/src/widgets/CircularBar.js +7 -7
  133. package/src/widgets/CircularChart.js +26 -8
  134. package/src/widgets/CodeViewer.js +93 -20
  135. package/src/widgets/Container.js +13 -0
  136. package/src/widgets/DataTable.js +17 -11
  137. package/src/widgets/DraggBox.js +2 -1
  138. package/src/widgets/Dropdown.js +59 -14
  139. package/src/widgets/DroppBox.js +4 -2
  140. package/src/widgets/FloatingActionButton.js +13 -7
  141. package/src/widgets/Icon.js +3 -1
  142. package/src/widgets/Image.js +102 -3
  143. package/src/widgets/Input.js +30 -23
  144. package/src/widgets/Inspector.js +54 -1
  145. package/src/widgets/InstallButton.js +6 -4
  146. package/src/widgets/ListTile.js +4 -3
  147. package/src/widgets/ListView.js +30 -12
  148. package/src/widgets/Maps.js +1495 -0
  149. package/src/widgets/Markdown.js +37 -26
  150. package/src/widgets/Modal.js +14 -11
  151. package/src/widgets/Pagination.js +16 -11
  152. package/src/widgets/ProgressBar.js +6 -4
  153. package/src/widgets/Radio.js +73 -15
  154. package/src/widgets/Rating.js +24 -6
  155. package/src/widgets/Skeleton.js +31 -31
  156. package/src/widgets/Slider.js +29 -18
  157. package/src/widgets/SnackBar.js +35 -39
  158. package/src/widgets/Stepper.js +13 -9
  159. package/src/widgets/Switch.js +59 -18
  160. package/src/widgets/Tooltip.js +24 -12
  161. package/src/widgets/TreeView.js +27 -15
  162. package/src/widgets/index.js +1 -0
@@ -24,9 +24,9 @@ import { parseMarkdown, markdownToWidgets, escapeHtml } from "flet-box";
24
24
  | `parseMarkdown` | `parseMarkdown(text)` | `string` | Reserved API: currently returns the input unchanged. Use `markdownToWidgets`. |
25
25
  | `parseInlineMarkdown` | `parseInlineMarkdown(text)` | `string` | Reserved API: currently returns the input unchanged. Use `parseInlineToWidgets`. |
26
26
  | `tokenize` | `tokenize(code)` | `{ type, value }[]` | Split code into token objects. |
27
- | `generateHighlightedHtml` | `generateHighlightedHtml(code)` | `string` | Code → highlighted HTML. |
27
+ | `generateHighlightedHtml` | `generateHighlightedHtml(code, palette?)` | `string` | Code → highlighted HTML. Picks the light or dark token map automatically; pass a map to override. |
28
28
  | `escapeHtml` | `escapeHtml(text)` | `string` | Escape `<`, `>`, `&`, quotes so text is safe as HTML. |
29
- | `highlightColors` | const | `Record<string, string>` | The token color map used by the highlighter. |
29
+ | `highlightColors` | const | `Record<string, string>` | The dark-theme token map (One Dark scale). |
30
30
 
31
31
  `markdownToWidgets` options: `{ codeMaxHeight?: number, codeFontSize?: number }`.
32
32
 
@@ -61,7 +61,7 @@ const safe = escapeHtml(userInput); // safe to put into innerHTML
61
61
  - `markdownToWidgets` builds real widget elements (headings, paragraphs, code blocks, lists) that you can place inside any container — this is what the `Markdown` widget uses.
62
62
  - `parseMarkdown` and `parseInlineMarkdown` are reserved placeholders that currently pass text through unchanged; the widget rendering is `markdownToWidgets`/`parseInlineToWidgets`.
63
63
  - `escapeHtml` should be used for **any** text you insert into the DOM that you did not write yourself. Never trust raw input.
64
- - `tokenize` returns flat token objects and is the base for custom highlighters; `highlightColors` lets you theme them.
64
+ - `tokenize` returns flat token objects and is the base for custom highlighters; `generateHighlightedHtml` reads the active theme, and its second argument accepts a token map when you paint your own surface.
65
65
 
66
66
  ## Related pages
67
67
  - [Themes](theme.md) — previous chapter.
@@ -11,7 +11,7 @@ FletBox ships a built-in color system: `colors` is the palette of the current th
11
11
  ## Import
12
12
 
13
13
  ```javascript
14
- import { colors, setTheme, toggleTheme, subscribeTheme, ThemeProvider } from "flet-box";
14
+ import { colors, setTheme, registerPalette, toggleTheme, subscribeTheme, ThemeProvider } from "flet-box";
15
15
  ```
16
16
 
17
17
  ## Functions
@@ -19,6 +19,7 @@ import { colors, setTheme, toggleTheme, subscribeTheme, ThemeProvider } from "fl
19
19
  | Function | Signature | Returns | Description |
20
20
  | --- | --- | --- | --- |
21
21
  | `setTheme` | `setTheme('light' \| 'dark')` | `Record<string, string>` | Switch the active palette. |
22
+ | `registerPalette` | `registerPalette(themeName, palette)` | `Record<string, string>` | Merge brand tokens into a named palette and repaint the page. |
22
23
  | `getTheme` | `getTheme()` | `string` | The active theme name. |
23
24
  | `toggleTheme` | `toggleTheme()` | `string` | Flip light/dark and return the new name. |
24
25
  | `getColor` | `getColor(name, opacity?)` | `string` | Resolve a token (optionally with alpha). |
@@ -38,9 +39,47 @@ Every token is available on `colors`:
38
39
  - **Surfaces:** `background`, `surface`, `card`, `overlay`.
39
40
  - **Text:** `text`, `textSecondary`, `textDisabled`, `divider`, `border`, `shadow`.
40
41
  - **Tints:** `gray50` … `gray900`, plus the soft backgrounds `errorBg`, `successBg`, `warningBg`, `infoBg`.
42
+ - **Glass:** `glass` (the translucent surface) and `glassBorder` (its rim), meant to pair with `backdropFilter`. Light is white glass, dark is a slate pane with a light rim.
41
43
 
42
44
  The `dark` palette overrides the surface/text tokens; `gray*` and brand colors also shift to keep contrast. Read [the palette walkthrough](../guides/utilities.md) for usage patterns.
43
45
 
46
+ ## Brand colors: `registerPalette`
47
+
48
+ A generated app ships a `src/database/themes.js` with its own `lightColors` and
49
+ `darkColors` objects. Assigning onto `colors` from that file changes nothing:
50
+ every widget reads the framework's live `colors`, and the next theme switch
51
+ re-applies a registered palette over whatever you wrote there. The call that
52
+ reaches the page is `registerPalette`:
53
+
54
+ ```javascript
55
+ import { registerPalette } from "flet-box";
56
+ import { lightColors, darkColors } from "./database/themes.js";
57
+
58
+ registerPalette("light", lightColors);
59
+ registerPalette("dark", darkColors);
60
+ ```
61
+
62
+ What it does:
63
+
64
+ - **Merges**, it does not replace. Tokens you leave out keep the framework's
65
+ value, so a palette that only carries `primary` and `surface` stays legal.
66
+ - **Repaints when that palette is on screen.** If the name matches the active
67
+ theme the tokens are applied, the `--color-*` custom properties are rewritten,
68
+ and theme subscribers are notified. Registering the other theme only stores it
69
+ for the next `setTheme`.
70
+ - **Never writes the theme preference.** Supplying your brand is not the user
71
+ choosing light or dark; that is the one difference from `setTheme`.
72
+ - **A token the framework has never heard of is added to `colors`**, so
73
+ `colors.brandSand` resolves in your own code. Widgets will still not use it —
74
+ they read the tokens they know — and because the built-in palettes do not
75
+ carry it, a custom key keeps its registered value across a theme switch unless
76
+ you register it in both palettes.
77
+
78
+ Run it once, at startup, before the first screen renders. The generated app does
79
+ it at the bottom of `src/database/themes.js` — the same file that declares
80
+ `lightColors` and `darkColors` — so a project that edits its brand colors is
81
+ already correct without touching `src/app.js`.
82
+
44
83
  ## Examples
45
84
 
46
85
  ### Everyday example
@@ -83,6 +122,7 @@ runApp(ThemeProvider({ children: ThemedApp() }), "root");
83
122
  ## Notes
84
123
 
85
124
  - The shared palette tokens are updated across all widgets when you switch themes; widgets referencing `colors.*` at build time pick up the active palette.
125
+ - `colors.glass` is genuinely see-through: its contrast depends on whatever is behind it, so use it over photography or gradients with a scrim, and keep body copy off the most colourful part of the backdrop. The dark token is a dark pane, not white glass.
86
126
  - `watchSystemTheme()` and `applySystemTheme()` read `prefers-color-scheme`; both return/need cleanup to release listeners.
87
127
  - `subscribeTheme(callback)` fires with the new palette object — remember to unsubscribe when a feature is destroyed.
88
128
 
@@ -58,10 +58,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
58
58
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
59
59
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
60
60
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
61
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
61
62
  | `color` | `Color` | Foreground color, usually the text or icon color. |
62
63
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
63
64
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
64
65
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
66
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
67
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
68
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
65
69
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
66
70
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
67
71
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -31,7 +31,7 @@ const banner = AdMob({
31
31
  | `margin` | `number` | Space outside the widget, between it and its neighbors. |
32
32
  | `interstitialId` | `string` | AdMob interstitial ad unit id. |
33
33
  | `rewardedId` | `string` | AdMob rewarded ad unit id. |
34
- | `autoShow` | `boolean` | Shows the ad automatically when it is ready. |
34
+ | `autoShow` | `boolean` | Shows the banner automatically on mount. false silences only the mount; show() still asks for the ad. |
35
35
  | `autoInitialize` | `boolean` | The `autoInitialize` value for the widget. |
36
36
  | `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
37
37
  | `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
@@ -57,10 +57,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
57
57
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
58
58
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
59
59
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
60
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
60
61
  | `color` | `Color` | Foreground color, usually the text or icon color. |
61
62
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
62
63
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
63
64
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
65
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
66
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
67
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
64
68
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
65
69
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
66
70
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -51,10 +51,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
51
51
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
52
52
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
53
53
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
54
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
54
55
  | `color` | `Color` | Foreground color, usually the text or icon color. |
55
56
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
56
57
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
57
58
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
59
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
60
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
61
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
58
62
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
59
63
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
60
64
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -45,10 +45,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
45
45
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
46
46
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
47
47
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
48
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
48
49
  | `color` | `Color` | Foreground color, usually the text or icon color. |
49
50
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
50
51
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
51
52
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
53
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
54
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
55
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
52
56
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
53
57
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
54
58
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -95,9 +99,9 @@ const toast = AnimatedBox({
95
99
  ## Tips
96
100
 
97
101
  - Each animation is { effect, from, to } where effect is a CSS property like opacity,
98
- - scale, translateY, or backgroundColor.
99
- - Set timing (ease, ease-out, linear) and delay at the widget level; per-step reverse
100
- - cycles the animation back instead of running it once.
102
+ - scale, translateY, or backgroundColor. It runs once and holds `to` at the end.
103
+ - Set timing (ease, ease-out, linear) and delay at the widget level; add reverse: true
104
+ - to cycle back to `from`, together with loop: true for a breathing pulse.
101
105
  - top, right, bottom, and left are forwarded to the child as positioning hints for
102
106
  - layout systems.
103
107
 
@@ -41,10 +41,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
41
41
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
42
42
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
43
43
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
44
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
44
45
  | `color` | `Color` | Foreground color, usually the text or icon color. |
45
46
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
46
47
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
47
48
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
49
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
50
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
51
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
48
52
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
49
53
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
50
54
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -48,10 +48,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
48
48
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
49
49
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
50
50
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
51
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
51
52
  | `color` | `Color` | Foreground color, usually the text or icon color. |
52
53
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
53
54
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
54
55
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
56
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
57
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
58
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
55
59
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
56
60
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
57
61
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -132,4 +136,4 @@ const track = Audio({
132
136
  - **Next:** [Video](Video.md)
133
137
  - **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
134
138
 
135
- You are reading **Chapter 7 · Media and drag & drop** (1 of 4).
139
+ You are reading **Chapter 7 · Media and drag & drop** (1 of 5).
@@ -1,6 +1,6 @@
1
1
  # Avatar
2
2
 
3
- A compact identity chip that shows a profile image, the person's initials, or a fallback icon. It falls back gracefully when no image is available.
3
+ A compact identity chip that shows a profile image, the person's initials, or a fallback icon. It falls back gracefully when no image is available and can carry a presence dot.
4
4
 
5
5
  ## When to use it
6
6
 
@@ -29,6 +29,8 @@ const user = Avatar({
29
29
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
30
30
  | `textColor` | `Color` | Color of the button label. |
31
31
  | `shape` | `'circle' \| 'rounded' \| 'square'` | The `shape` value for the widget. |
32
+ | `online` | `boolean` | Shows a presence dot in the corner of the avatar. |
33
+ | `badgeColor` | `Color` | Color of the presence dot. |
32
34
  | `onPress` | `(widget: Widget) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
33
35
 
34
36
  ### Common props
@@ -43,10 +45,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
43
45
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
44
46
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
45
47
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
48
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
46
49
  | `color` | `Color` | Foreground color, usually the text or icon color. |
47
50
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
48
51
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
49
52
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
53
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
54
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
55
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
50
56
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
51
57
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
52
58
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -69,6 +75,7 @@ const user = Avatar({
69
75
  name: "Ada Lovelace",
70
76
  size: 48,
71
77
  shape: "circle",
78
+ online: true,
72
79
  });
73
80
  ```
74
81
 
@@ -84,14 +91,17 @@ const user = Avatar({
84
91
  shape: "rounded",
85
92
  bgColor: "#2563eb",
86
93
  textColor: "#ffffff",
94
+ online: true,
95
+ badgeColor: "#f59e0b",
87
96
  onPress: () => console.log("open profile"),
88
97
  });
89
98
  ```
90
99
 
91
100
  ## Tips
92
101
 
93
- - Provide both src and name so initials render if the image fails.
102
+ - Provide both src and name so the initials are ready if you swap the image out.
94
103
  - Use shape: "circle" for people and shape: "rounded" for organizations or bots.
104
+ - Leave badgeColor at its default for an available dot; pass another color to signal away or busy.
95
105
 
96
106
  ## Accessibility
97
107
 
@@ -99,8 +109,10 @@ const user = Avatar({
99
109
 
100
110
  ## Behavior
101
111
 
102
- - When src is missing or errors, the widget automatically shows initials from name.
112
+ - Content is picked once, in order: src, then icon, then initials from name, then a generic person icon. A failing src does not swap the image for initials by itself.
103
113
  - onPress makes the whole avatar interactive, which is useful for opening profiles.
114
+ - online draws a dot in the bottom-right corner. It sits inside the edge and is sized from the avatar, so a circular avatar clips it no more than a square one.
115
+ - Every own prop applies again through update() or updateContent(), so an avatar bound to a state key changes without rebuilding the element.
104
116
 
105
117
  ## Related widgets
106
118
 
@@ -47,10 +47,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
47
47
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
48
48
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
49
49
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
50
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
50
51
  | `color` | `Color` | Foreground color, usually the text or icon color. |
51
52
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
52
53
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
53
54
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
55
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
56
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
57
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
54
58
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
55
59
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
56
60
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -54,10 +54,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
54
54
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
55
55
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
56
56
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
57
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
57
58
  | `color` | `Color` | Foreground color, usually the text or icon color. |
58
59
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
59
60
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
60
61
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
62
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
63
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
64
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
61
65
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
62
66
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
63
67
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -74,6 +74,37 @@ These expand to two sides at once (numeric values are pixels):
74
74
  `flexBasis`, `gap`, `boxSizing`, `overflow`, `overflowX`, `overflowY`,
75
75
  `position` (`pos`), `top`, `right`, `bottom`, `left`, `inset`, `zIndex` (`z`).
76
76
 
77
+ ### Stack positioning
78
+
79
+ `position: 'stack'` takes the widget out of normal flow and pins it to its
80
+ nearest positioned ancestor. The placement shorthands below apply **only** in
81
+ that mode; the plain offsets still work with any CSS `position` value.
82
+
83
+ | Prop | Effect |
84
+ | --- | --- |
85
+ | `top` / `right` / `bottom` / `left` | Edge offsets. A number is pixels on the 16px base, written as rem. |
86
+ | `start` / `end` | `left` / `right` under the logical names. |
87
+ | `centerX` / `centerY` | Centre on one axis. |
88
+ | `center` | Centre on both axes. |
89
+ | `fullWidth` / `fullHeight` | Stretch to the parent's width / height. |
90
+ | `full` | Stretch on both axes. |
91
+
92
+ ```js
93
+ Stack({
94
+ width: "100%",
95
+ height: 320,
96
+ children: [
97
+ Image({ src: "cover.jpg", position: "stack", full: true, fit: "cover" }),
98
+ Text({ text: "Centred", position: "stack", center: true }),
99
+ ],
100
+ });
101
+ ```
102
+
103
+ A `false` shorthand means "do not apply", so `full: false` leaves the widget at
104
+ its natural size. [`Button`](Button.md), [`Input`](Input.md) and
105
+ [`Tabs`](Tabs.md) also read `fullWidth` as a plain layout prop, independent of
106
+ `position`.
107
+
77
108
  ## Size and spacing
78
109
 
79
110
  `width` (`w`), `height` (`h`), `minWidth`/`maxWidth`, `minHeight`/`maxHeight`,
@@ -107,6 +138,27 @@ shorthands `roundedTop`, `roundedBottom`, `roundedLeft`, `roundedRight`, plus
107
138
  `transition`, `animation`, `transform`, `cursor`, `visibility`, `pointerEvents`,
108
139
  `userSelect`, `touchAction`.
109
140
 
141
+ ## Glass and filters
142
+
143
+ `backdropFilter`, `filter`, `maskImage`. Each takes a raw CSS value string, not an
144
+ object.
145
+
146
+ ```js
147
+ Card({
148
+ bgColor: colors.glass,
149
+ borderColor: colors.glassBorder,
150
+ borderWidth: 1,
151
+ backdropFilter: 'blur(14px) saturate(160%)',
152
+ });
153
+ ```
154
+
155
+ > A translucent `bgColor` alone is only see-through. `backdropFilter` blurs what is
156
+ > behind the widget, which is what makes the card read as frosted glass.
157
+ > `backdropFilter` and `maskImage` also write their `-webkit-` twin, so the effect
158
+ > reaches Safari and the `WKWebView` inside a wrapped iOS app.
159
+ > `filter` affects the widget's own pixels; `backdropFilter` affects only the
160
+ > backdrop, so the widget's text stays sharp.
161
+
110
162
  ## Text content
111
163
 
112
164
  These set the element's text: `text`, `label`, `title`, `caption`, `description`,
@@ -45,10 +45,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
45
45
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
46
46
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
47
47
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
48
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
48
49
  | `color` | `Color` | Foreground color, usually the text or icon color. |
49
50
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
50
51
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
51
52
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
53
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
54
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
55
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
52
56
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
53
57
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
54
58
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -54,10 +54,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
54
54
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
55
55
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
56
56
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
57
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
57
58
  | `color` | `Color` | Foreground color, usually the text or icon color. |
58
59
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
59
60
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
60
61
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
62
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
63
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
64
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
61
65
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
62
66
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
63
67
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -60,10 +60,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
60
60
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
61
61
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
62
62
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
63
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
63
64
  | `color` | `Color` | Foreground color, usually the text or icon color. |
64
65
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
65
66
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
66
67
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
68
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
69
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
70
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
67
71
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
68
72
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
69
73
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -41,10 +41,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
41
41
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
42
42
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
43
43
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
44
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
44
45
  | `color` | `Color` | Foreground color, usually the text or icon color. |
45
46
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
46
47
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
47
48
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
49
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
50
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
51
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
48
52
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
49
53
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
50
54
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -47,10 +47,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
47
47
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
48
48
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
49
49
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
50
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
50
51
  | `color` | `Color` | Foreground color, usually the text or icon color. |
51
52
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
52
53
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
53
54
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
55
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
56
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
57
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
54
58
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
55
59
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
56
60
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -72,10 +72,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
72
72
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
73
73
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
74
74
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
75
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
75
76
  | `color` | `Color` | Foreground color, usually the text or icon color. |
76
77
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
77
78
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
78
79
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
80
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
81
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
82
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
79
83
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
80
84
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
81
85
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -67,10 +67,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
67
67
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
68
68
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
69
69
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
70
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
70
71
  | `color` | `Color` | Foreground color, usually the text or icon color. |
71
72
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
72
73
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
73
74
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
75
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
76
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
77
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
74
78
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
75
79
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
76
80
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -47,10 +47,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
47
47
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
48
48
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
49
49
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
50
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
50
51
  | `color` | `Color` | Foreground color, usually the text or icon color. |
51
52
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
52
53
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
53
54
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
55
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
56
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
57
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
54
58
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
55
59
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
56
60
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -44,10 +44,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
44
44
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
45
45
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
46
46
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
47
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
47
48
  | `color` | `Color` | Foreground color, usually the text or icon color. |
48
49
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
49
50
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
50
51
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
52
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
53
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
54
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
51
55
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
52
56
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
53
57
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -51,10 +51,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
51
51
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
52
52
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
53
53
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
54
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
54
55
  | `color` | `Color` | Foreground color, usually the text or icon color. |
55
56
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
56
57
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
57
58
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
59
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
60
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
61
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
58
62
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
59
63
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
60
64
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -55,10 +55,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
55
55
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
56
56
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
57
57
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
58
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
58
59
  | `color` | `Color` | Foreground color, usually the text or icon color. |
59
60
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
60
61
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
61
62
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
63
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
64
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
65
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
62
66
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
63
67
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
64
68
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -37,10 +37,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
37
37
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
38
38
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
39
39
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
40
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
40
41
  | `color` | `Color` | Foreground color, usually the text or icon color. |
41
42
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
42
43
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
43
44
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
45
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
46
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
47
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
44
48
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
45
49
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
46
50
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -46,10 +46,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
46
46
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
47
47
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
48
48
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
49
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
49
50
  | `color` | `Color` | Foreground color, usually the text or icon color. |
50
51
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
51
52
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
52
53
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
54
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
55
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
56
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
53
57
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
54
58
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
55
59
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -122,8 +126,8 @@ const task = DraggBox({
122
126
 
123
127
  ## Continue reading
124
128
 
125
- - **Previous:** [Video](Video.md)
129
+ - **Previous:** [Maps](Maps.md)
126
130
  - **Next:** [DroppBox](DroppBox.md)
127
131
  - **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
128
132
 
129
- You are reading **Chapter 7 · Media and drag & drop** (3 of 4).
133
+ You are reading **Chapter 7 · Media and drag & drop** (4 of 5).