flet-box 1.1.2 → 1.1.3
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.
- package/AGENTS_FOR_CODE_GEN.md +284 -0
- package/CONTRIBUTING.md +238 -0
- package/README.md +2 -2
- package/bin/cli.js +88 -1
- package/bin/commands/auditFix.js +181 -27
- package/bin/commands/checkApi.js +14 -3
- package/bin/commands/checkStructure.js +368 -0
- package/bin/commands/checkSyntax.js +293 -0
- package/bin/commands/checkUi.js +666 -14
- package/bin/commands/create.js +14 -0
- package/bin/commands/createBundle.js +2 -2
- package/bin/commands/metrics.js +448 -0
- package/bin/commands/release.js +18 -0
- package/bin/commands/report.js +849 -0
- package/bin/commands/tools.js +76 -0
- package/bin/commands/unpack.js +39 -11
- package/bin/commands/verify.js +879 -0
- package/bin/mcp.js +280 -0
- package/bin/utils/contract.js +27 -0
- package/bin/utils/dtsProps.js +5 -1
- package/bin/utils/migrationGuide.js +146 -0
- package/bin/utils/moduleExports.js +9 -5
- package/bin/utils/templates.js +225 -18
- package/bin/utils/toolkit.js +191 -0
- package/docs/README.md +5 -1
- package/docs/arquitectura.md +1 -1
- package/docs/cli/README.md +168 -2
- package/docs/guides/README.md +6 -0
- package/docs/guides/accessibility.md +2 -1
- package/docs/guides/ai-toolkit.md +166 -0
- package/docs/guides/compatibility.md +1 -1
- package/docs/guides/migration.md +92 -0
- package/docs/guides/minification-and-protection.md +2 -1
- package/docs/guides/mobile-and-platforms.md +1 -1
- package/docs/guides/online-updates.md +2 -0
- package/docs/server/deployment.md +1 -1
- package/docs/tools/styling.md +2 -2
- package/docs/tools/theme.md +139 -4
- package/docs/widget/Accordion.md +74 -8
- package/docs/widget/AdMob.md +68 -3
- package/docs/widget/AdSense.md +67 -2
- package/docs/widget/AlertDialog.md +1 -1
- package/docs/widget/AnimatedBox.md +80 -39
- package/docs/widget/AnimatedText.md +74 -18
- package/docs/widget/Audio.md +73 -14
- package/docs/widget/Avatar.md +69 -4
- package/docs/widget/Badge.md +68 -3
- package/docs/widget/BottomSheet.md +2 -2
- package/docs/widget/Button.md +69 -3
- package/docs/widget/Card.md +69 -4
- package/docs/widget/Carousel.md +67 -2
- package/docs/widget/Chart.md +67 -2
- package/docs/widget/Checkbox.md +74 -8
- package/docs/widget/Chip.md +68 -3
- package/docs/widget/CircularBar.md +74 -15
- package/docs/widget/CircularChart.md +71 -10
- package/docs/widget/CodeViewer.md +67 -2
- package/docs/widget/Column.md +68 -3
- package/docs/widget/Container.md +68 -3
- package/docs/widget/DataTable.md +67 -2
- package/docs/widget/Divider.md +67 -2
- package/docs/widget/DraggBox.md +67 -2
- package/docs/widget/Dropdown.md +76 -10
- package/docs/widget/DroppBox.md +67 -2
- package/docs/widget/FloatingActionButton.md +68 -3
- package/docs/widget/GridView.md +67 -2
- package/docs/widget/Icon.md +71 -5
- package/docs/widget/Image.md +68 -3
- package/docs/widget/Input.md +68 -3
- package/docs/widget/Inspector.md +2 -2
- package/docs/widget/InstallButton.md +73 -13
- package/docs/widget/ListTile.md +69 -3
- package/docs/widget/ListView.md +67 -2
- package/docs/widget/Maps.md +68 -3
- package/docs/widget/Markdown.md +74 -15
- package/docs/widget/MatrixRain.md +72 -11
- package/docs/widget/Menu.md +209 -0
- package/docs/widget/Modal.md +3 -3
- package/docs/widget/Pagination.md +68 -3
- package/docs/widget/ParallaxBox.md +72 -12
- package/docs/widget/ProgressBar.md +69 -4
- package/docs/widget/QRCode.md +67 -2
- package/docs/widget/README.md +54 -50
- package/docs/widget/Radio.md +76 -10
- package/docs/widget/Rating.md +70 -6
- package/docs/widget/Row.md +68 -3
- package/docs/widget/Skeleton.md +68 -3
- package/docs/widget/Slider.md +75 -9
- package/docs/widget/SnackBar.md +2 -2
- package/docs/widget/Stack.md +68 -3
- package/docs/widget/Stepper.md +68 -3
- package/docs/widget/Switch.md +74 -8
- package/docs/widget/Text.md +71 -4
- package/docs/widget/ThemePicker.md +197 -0
- package/docs/widget/Tooltip.md +72 -7
- package/docs/widget/TreeView.md +70 -10
- package/docs/widget/Video.md +71 -10
- package/package.json +10 -3
- package/skills/fletbox-design/SKILL.md +89 -5
- package/skills/fletbox-motion/SKILL.md +1 -1
- package/skills/fletbox-rules/SKILL.md +56 -4
- package/src/core/runApp.js +12 -0
- package/src/index.d.ts +374 -101
- package/src/index.js +9 -0
- package/src/navigations/AdaptiveScaffold.js +2 -2
- package/src/navigations/BottomNavigation.js +1 -1
- package/src/navigations/Scaffold.js +18 -6
- package/src/tools/useState.js +11 -4
- package/src/utils/colors.js +275 -0
- package/src/utils/errorBoundary.js +288 -0
- package/src/utils/index.js +10 -2
- package/src/utils/stackPosition.js +39 -24
- package/src/utils/syntaxHighlight.js +4 -1
- package/src/utils/themes.js +279 -3
- package/src/widget-factory/addChildren.js +17 -10
- package/src/widget-factory/assignProps.js +18 -6
- package/src/widget-factory/createWidget.js +7 -0
- package/src/widget-factory/deprecations.js +77 -0
- package/src/widget-factory/translateProps.js +11 -1
- package/src/widget-factory/warnings.js +1 -27
- package/src/widget-factory/widgetFactory.js +59 -17
- package/src/widgets/Accordion.js +21 -7
- package/src/widgets/Badge.js +11 -2
- package/src/widgets/Button.js +15 -3
- package/src/widgets/Carousel.js +12 -4
- package/src/widgets/Chart.js +7 -2
- package/src/widgets/Checkbox.js +1 -2
- package/src/widgets/Chip.js +24 -10
- package/src/widgets/CircularBar.js +9 -3
- package/src/widgets/CircularChart.js +5 -3
- package/src/widgets/Container.js +6 -0
- package/src/widgets/Divider.js +3 -1
- package/src/widgets/DraggBox.js +9 -0
- package/src/widgets/Dropdown.js +3 -3
- package/src/widgets/DroppBox.js +5 -0
- package/src/widgets/FloatingActionButton.js +1 -1
- package/src/widgets/Icon.js +5 -1
- package/src/widgets/InstallButton.js +4 -2
- package/src/widgets/Markdown.js +171 -103
- package/src/widgets/Menu.js +340 -0
- package/src/widgets/Modal.js +7 -1
- package/src/widgets/Pagination.js +10 -5
- package/src/widgets/ProgressBar.js +5 -4
- package/src/widgets/QRCode.js +4 -0
- package/src/widgets/Radio.js +1 -2
- package/src/widgets/Rating.js +9 -0
- package/src/widgets/Slider.js +4 -1
- package/src/widgets/SnackBar.js +2 -2
- package/src/widgets/Switch.js +1 -2
- package/src/widgets/Text.js +9 -5
- package/src/widgets/ThemePicker.js +234 -0
- package/src/widgets/TreeView.js +2 -1
- package/src/widgets/index.js +2 -0
- package/docs/CONTRIBUTING.md +0 -156
package/docs/widget/Dropdown.md
CHANGED
|
@@ -29,7 +29,7 @@ const city = Dropdown({
|
|
|
29
29
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
30
30
|
| `label` | `string` | Label or caption shown near the control. |
|
|
31
31
|
| `error` | `boolean` | Error flag or message shown under the field. |
|
|
32
|
-
| `variant` | `'outlined' \| 'filled'` | Visual variation or style preset. |
|
|
32
|
+
| `variant` | `'outlined' \| 'filled' \| 'text'` | Visual variation or style preset. |
|
|
33
33
|
| `size` | `'small' \| 'medium' \| 'large'` | Overall size preset or pixel value, depending on the widget. |
|
|
34
34
|
| `borderRadius` | `number` | Rounds the corners of the widget. |
|
|
35
35
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -39,7 +39,8 @@ const city = Dropdown({
|
|
|
39
39
|
| `clearable` | `boolean` | Shows a button that clears the field. |
|
|
40
40
|
| `width` | `number \| string` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
41
41
|
| `portal` | `boolean` | Renders the dropdown menu in a portal above the page. |
|
|
42
|
-
| `onChange` | `(value: any
|
|
42
|
+
| `onChange` | `(value: any) => void` | Deprecated alias of `onPress`. |
|
|
43
|
+
| `onPress` | `(value: any) => void` | Called with the chosen value. |
|
|
43
44
|
|
|
44
45
|
### Common props
|
|
45
46
|
|
|
@@ -47,11 +48,64 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
47
48
|
|
|
48
49
|
| Prop | Type | Description |
|
|
49
50
|
| --- | --- | --- |
|
|
51
|
+
| `full` | `boolean` | Stretches the widget to fill its parent on both axes in stack mode. |
|
|
52
|
+
| `fullHeight` | `boolean` | Stretches the widget to the full height of its parent in stack mode. |
|
|
53
|
+
| `fullWidth` | `boolean` | Stretches the widget to the full width of its parent. |
|
|
54
|
+
| `center` | `boolean` | Centres the widget on both axes in stack mode. |
|
|
55
|
+
| `centerY` | `boolean` | Centres the widget vertically in stack mode. |
|
|
56
|
+
| `centerX` | `boolean` | Centres the widget horizontally in stack mode. |
|
|
57
|
+
| `zIndex` | `number` | Stacking order: a widget with a higher value paints above lower ones. |
|
|
58
|
+
| `z` | `number` | Alias of `zIndex`. |
|
|
59
|
+
| `end` | `Size` | Logical alias of `right`, used by the stack placement shorthands. |
|
|
60
|
+
| `start` | `Size` | Logical alias of `left`, used by the stack placement shorthands. |
|
|
61
|
+
| `inset` | `Size` | Shorthand for the four edge offsets (`top`/`right`/`bottom`/`left`). |
|
|
62
|
+
| `left` | `Size` | Offset from the left edge. A number is pixels; a string uses any CSS unit. |
|
|
63
|
+
| `bottom` | `Size` | Offset from the bottom edge. A number is pixels; a string uses any CSS unit. |
|
|
64
|
+
| `right` | `Size` | Offset from the right edge. A number is pixels; a string uses any CSS unit. |
|
|
65
|
+
| `top` | `Size` | Offset from the top edge. A number is pixels; a string uses any CSS unit. |
|
|
66
|
+
| `pos` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | Alias of `position`. |
|
|
67
|
+
| `position` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | CSS `position` value, or `stack` for centered stacking. |
|
|
50
68
|
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
51
69
|
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
52
70
|
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
71
|
+
| `flex` | `number` | Flex grow/shrink/basis shorthand for a flex child. |
|
|
72
|
+
| `minWidth` | `Size` | Minimum width the widget may shrink to. |
|
|
73
|
+
| `maxWidth` | `Size` | Maximum width the widget may grow to. |
|
|
74
|
+
| `minHeight` | `Size` | Minimum height the widget may shrink to. |
|
|
75
|
+
| `maxHeight` | `Size` | Maximum height the widget may grow to. |
|
|
76
|
+
| `border` | `string` | CSS `border` shorthand for all four edges: width, style and color in one string. |
|
|
77
|
+
| `borderTop` | `string` | The top edge of the border alone, for a widget whose rim differs per side. |
|
|
78
|
+
| `borderBottom` | `string` | The bottom edge of the border alone, for a widget whose rim differs per side. |
|
|
79
|
+
| `borderLeft` | `string` | The left edge of the border alone, for a widget whose rim differs per side. |
|
|
80
|
+
| `borderRight` | `string` | The right edge of the border alone, for a widget whose rim differs per side. |
|
|
81
|
+
| `cursor` | `string` | CSS `cursor` value: what the pointer becomes over the widget (`pointer`, `grab`, `not-allowed`). |
|
|
82
|
+
| `display` | `string` | CSS `display` value for the container. |
|
|
83
|
+
| `boxSizing` | `'border-box' \| 'content-box'` | Which box `width` and `height` measure: `border-box` keeps the size you asked for and pushes padding inward. |
|
|
84
|
+
| `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | Main axis of a flex container: `row` places children side by side, `column` stacks them. |
|
|
85
|
+
| `flexGrow` | `number` | Share of the leftover space this child takes, relative to its siblings. |
|
|
86
|
+
| `flexShrink` | `number` | How readily the child gives space back when the row overflows; `0` keeps its size. |
|
|
87
|
+
| `gap` | `number \| string` | Space between children along the layout axis. |
|
|
88
|
+
| `fontSize` | `number` | Size of the font. |
|
|
89
|
+
| `borderColor` | `Color` | Color used for the border. |
|
|
90
|
+
| `borderWidth` | `number` | Width of the border. |
|
|
53
91
|
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
92
|
+
| `paddingTop` | `Size` | Space inside the widget, on the top edge only. |
|
|
93
|
+
| `paddingRight` | `Size` | Space inside the widget, on the right edge only. |
|
|
94
|
+
| `paddingBottom` | `Size` | Space inside the widget, on the bottom edge only. |
|
|
95
|
+
| `paddingLeft` | `Size` | Space inside the widget, on the left edge only. |
|
|
96
|
+
| `pt` | `Size` | Alias of `paddingTop`. |
|
|
97
|
+
| `pr` | `Size` | Alias of `paddingRight`. |
|
|
98
|
+
| `pb` | `Size` | Alias of `paddingBottom`. |
|
|
99
|
+
| `pl` | `Size` | Alias of `paddingLeft`. |
|
|
54
100
|
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
101
|
+
| `marginTop` | `Size` | Space outside the widget, on the top edge only. |
|
|
102
|
+
| `marginRight` | `Size` | Space outside the widget, on the right edge only. |
|
|
103
|
+
| `marginBottom` | `Size` | Space outside the widget, on the bottom edge only. |
|
|
104
|
+
| `marginLeft` | `Size` | Space outside the widget, on the left edge only. |
|
|
105
|
+
| `mt` | `Size` | Alias of `marginTop`. |
|
|
106
|
+
| `mr` | `Size` | Alias of `marginRight`. |
|
|
107
|
+
| `mb` | `Size` | Alias of `marginBottom`. |
|
|
108
|
+
| `ml` | `Size` | Alias of `marginLeft`. |
|
|
55
109
|
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
56
110
|
| `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
|
|
57
111
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -61,11 +115,23 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
61
115
|
| `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
|
|
62
116
|
| `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. |
|
|
63
117
|
| `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
|
|
118
|
+
| `bgImage` | `string` | Image painted behind the widget's content (CSS `background-image`), placed with `bgSize` and `bgPosition`. |
|
|
119
|
+
| `bgSize` | `string` | How the background image fills its box (`cover`, `contain`, or a length). |
|
|
120
|
+
| `bgPosition` | `string` | Where the background image is anchored (`center`, `top`, `50% 20%`). |
|
|
121
|
+
| `bgRepeat` | `string` | Whether the background image tiles; `no-repeat` for a single cover. |
|
|
64
122
|
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
65
123
|
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
66
124
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
67
|
-
| `onPress` | `(
|
|
68
|
-
| `onClick` | `(
|
|
125
|
+
| `onPress` | `(event?: Event) => void` | Called with the chosen value. |
|
|
126
|
+
| `onClick` | `(event?: Event) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
127
|
+
| `onclick` | `(event?: Event) => void` | Lowercase alias of `onClick`, kept because the shipped templates and the HTML habit write it. |
|
|
128
|
+
| `alignSelf` | `AlignSelf` | Overrides the parent's `alignItems` for this child alone (CSS `align-self`). Alias: `selfAlign`. |
|
|
129
|
+
| `selfAlign` | `AlignSelf` | Alias of `alignSelf`. |
|
|
130
|
+
| `overflow` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | How overflowing content is handled (`hidden`, `auto`, `scroll`). |
|
|
131
|
+
| `overflowX` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowX` value for the widget. |
|
|
132
|
+
| `overflowY` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowY` value for the widget. |
|
|
133
|
+
| `textOverflow` | `'clip' \| 'ellipsis' \| string` | The `textOverflow` value for the widget. |
|
|
134
|
+
| `whiteSpace` | `'normal' \| 'nowrap' \| 'pre' \| 'pre-wrap' \| 'pre-line' \| string` | The `whiteSpace` value for the widget. |
|
|
69
135
|
| `id` | `string` | DOM `id` for the rendered element. |
|
|
70
136
|
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
71
137
|
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
|
@@ -82,7 +148,7 @@ const role = Dropdown({
|
|
|
82
148
|
label: "Role",
|
|
83
149
|
options: ["Admin", "Editor", "Viewer"],
|
|
84
150
|
value: "Editor",
|
|
85
|
-
|
|
151
|
+
onPress: (value) => console.log("role:", value),
|
|
86
152
|
});
|
|
87
153
|
```
|
|
88
154
|
|
|
@@ -106,15 +172,15 @@ const country = Dropdown({
|
|
|
106
172
|
borderRadius: 10,
|
|
107
173
|
bgColor: "#ffffff",
|
|
108
174
|
textColor: "#0f172a",
|
|
109
|
-
|
|
110
|
-
console.log("selected:", value
|
|
175
|
+
onPress: (value) => {
|
|
176
|
+
console.log("selected:", value);
|
|
111
177
|
},
|
|
112
178
|
});
|
|
113
179
|
```
|
|
114
180
|
|
|
115
181
|
## Tips
|
|
116
182
|
|
|
117
|
-
- Pass objects with value/label when the value sent to
|
|
183
|
+
- Pass objects with value/label when the value sent to onPress must differ from the text shown, such as an id versus a name.
|
|
118
184
|
- Set clearable: true to give users an explicit way back to no selection.
|
|
119
185
|
- Bind a useState value to `value` to move the selection from code, such as auto-picking a default after a lookup; pass `''` to clear it back to the placeholder.
|
|
120
186
|
|
|
@@ -126,7 +192,7 @@ const country = Dropdown({
|
|
|
126
192
|
|
|
127
193
|
- The option menu is portaled to document.body by default and repositions on scroll/resize; set portal: false to keep it inline.
|
|
128
194
|
- The returned element exposes value, open(), close() and update(), and removes its listeners on unmount.
|
|
129
|
-
- A value applied from outside — a bound state change or `dropdown.value = x` — re-fires
|
|
195
|
+
- A value applied from outside — a bound state change or `dropdown.value = x` — re-fires onPress when it differs from the current selection, and is ignored when it is the same, so a state → value → onPress → state loop settles after one pass.
|
|
130
196
|
|
|
131
197
|
## Related widgets
|
|
132
198
|
|
|
@@ -142,4 +208,4 @@ const country = Dropdown({
|
|
|
142
208
|
- **Next:** [Rating](Rating.md)
|
|
143
209
|
- **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
|
|
144
210
|
|
|
145
|
-
You are reading **Chapter 2 · Interaction basics** (7 of
|
|
211
|
+
You are reading **Chapter 2 · Interaction basics** (7 of 9).
|
package/docs/widget/DroppBox.md
CHANGED
|
@@ -55,11 +55,64 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
55
55
|
|
|
56
56
|
| Prop | Type | Description |
|
|
57
57
|
| --- | --- | --- |
|
|
58
|
+
| `full` | `boolean` | Stretches the widget to fill its parent on both axes in stack mode. |
|
|
59
|
+
| `fullHeight` | `boolean` | Stretches the widget to the full height of its parent in stack mode. |
|
|
60
|
+
| `fullWidth` | `boolean` | Stretches the widget to the full width of its parent. |
|
|
61
|
+
| `center` | `boolean` | Centres the widget on both axes in stack mode. |
|
|
62
|
+
| `centerY` | `boolean` | Centres the widget vertically in stack mode. |
|
|
63
|
+
| `centerX` | `boolean` | Centres the widget horizontally in stack mode. |
|
|
64
|
+
| `zIndex` | `number` | Stacking order: a widget with a higher value paints above lower ones. |
|
|
65
|
+
| `z` | `number` | Alias of `zIndex`. |
|
|
66
|
+
| `end` | `Size` | Logical alias of `right`, used by the stack placement shorthands. |
|
|
67
|
+
| `start` | `Size` | Logical alias of `left`, used by the stack placement shorthands. |
|
|
68
|
+
| `inset` | `Size` | Shorthand for the four edge offsets (`top`/`right`/`bottom`/`left`). |
|
|
69
|
+
| `left` | `Size` | Offset from the left edge. A number is pixels; a string uses any CSS unit. |
|
|
70
|
+
| `bottom` | `Size` | Offset from the bottom edge. A number is pixels; a string uses any CSS unit. |
|
|
71
|
+
| `right` | `Size` | Offset from the right edge. A number is pixels; a string uses any CSS unit. |
|
|
72
|
+
| `top` | `Size` | Offset from the top edge. A number is pixels; a string uses any CSS unit. |
|
|
73
|
+
| `pos` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | Alias of `position`. |
|
|
74
|
+
| `position` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | CSS `position` value, or `stack` for centered stacking. |
|
|
58
75
|
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
59
76
|
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
60
77
|
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
78
|
+
| `flex` | `number` | Flex grow/shrink/basis shorthand for a flex child. |
|
|
79
|
+
| `minWidth` | `Size` | Minimum width the widget may shrink to. |
|
|
80
|
+
| `maxWidth` | `Size` | Maximum width the widget may grow to. |
|
|
81
|
+
| `minHeight` | `Size` | Minimum height the widget may shrink to. |
|
|
82
|
+
| `maxHeight` | `Size` | Maximum height the widget may grow to. |
|
|
83
|
+
| `border` | `string` | CSS `border` shorthand for all four edges: width, style and color in one string. |
|
|
84
|
+
| `borderTop` | `string` | The top edge of the border alone, for a widget whose rim differs per side. |
|
|
85
|
+
| `borderBottom` | `string` | The bottom edge of the border alone, for a widget whose rim differs per side. |
|
|
86
|
+
| `borderLeft` | `string` | The left edge of the border alone, for a widget whose rim differs per side. |
|
|
87
|
+
| `borderRight` | `string` | The right edge of the border alone, for a widget whose rim differs per side. |
|
|
88
|
+
| `cursor` | `string` | CSS `cursor` value: what the pointer becomes over the widget (`pointer`, `grab`, `not-allowed`). |
|
|
89
|
+
| `display` | `string` | CSS `display` value for the container. |
|
|
90
|
+
| `boxSizing` | `'border-box' \| 'content-box'` | Which box `width` and `height` measure: `border-box` keeps the size you asked for and pushes padding inward. |
|
|
91
|
+
| `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | Main axis of a flex container: `row` places children side by side, `column` stacks them. |
|
|
92
|
+
| `flexGrow` | `number` | Share of the leftover space this child takes, relative to its siblings. |
|
|
93
|
+
| `flexShrink` | `number` | How readily the child gives space back when the row overflows; `0` keeps its size. |
|
|
94
|
+
| `gap` | `number \| string` | Space between children along the layout axis. |
|
|
95
|
+
| `fontSize` | `number` | Size of the font. |
|
|
96
|
+
| `borderColor` | `Color` | Color used for the border. |
|
|
97
|
+
| `borderWidth` | `number` | Width of the border. |
|
|
61
98
|
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
99
|
+
| `paddingTop` | `Size` | Space inside the widget, on the top edge only. |
|
|
100
|
+
| `paddingRight` | `Size` | Space inside the widget, on the right edge only. |
|
|
101
|
+
| `paddingBottom` | `Size` | Space inside the widget, on the bottom edge only. |
|
|
102
|
+
| `paddingLeft` | `Size` | Space inside the widget, on the left edge only. |
|
|
103
|
+
| `pt` | `Size` | Alias of `paddingTop`. |
|
|
104
|
+
| `pr` | `Size` | Alias of `paddingRight`. |
|
|
105
|
+
| `pb` | `Size` | Alias of `paddingBottom`. |
|
|
106
|
+
| `pl` | `Size` | Alias of `paddingLeft`. |
|
|
62
107
|
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
108
|
+
| `marginTop` | `Size` | Space outside the widget, on the top edge only. |
|
|
109
|
+
| `marginRight` | `Size` | Space outside the widget, on the right edge only. |
|
|
110
|
+
| `marginBottom` | `Size` | Space outside the widget, on the bottom edge only. |
|
|
111
|
+
| `marginLeft` | `Size` | Space outside the widget, on the left edge only. |
|
|
112
|
+
| `mt` | `Size` | Alias of `marginTop`. |
|
|
113
|
+
| `mr` | `Size` | Alias of `marginRight`. |
|
|
114
|
+
| `mb` | `Size` | Alias of `marginBottom`. |
|
|
115
|
+
| `ml` | `Size` | Alias of `marginLeft`. |
|
|
63
116
|
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
64
117
|
| `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
|
|
65
118
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -69,11 +122,23 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
69
122
|
| `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
|
|
70
123
|
| `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. |
|
|
71
124
|
| `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
|
|
125
|
+
| `bgImage` | `string` | Image painted behind the widget's content (CSS `background-image`), placed with `bgSize` and `bgPosition`. |
|
|
126
|
+
| `bgSize` | `string` | How the background image fills its box (`cover`, `contain`, or a length). |
|
|
127
|
+
| `bgPosition` | `string` | Where the background image is anchored (`center`, `top`, `50% 20%`). |
|
|
128
|
+
| `bgRepeat` | `string` | Whether the background image tiles; `no-repeat` for a single cover. |
|
|
72
129
|
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
73
130
|
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
74
131
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
75
|
-
| `onPress` | `(
|
|
76
|
-
| `onClick` | `(
|
|
132
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
133
|
+
| `onClick` | `(event?: Event) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
134
|
+
| `onclick` | `(event?: Event) => void` | Lowercase alias of `onClick`, kept because the shipped templates and the HTML habit write it. |
|
|
135
|
+
| `alignSelf` | `AlignSelf` | Overrides the parent's `alignItems` for this child alone (CSS `align-self`). Alias: `selfAlign`. |
|
|
136
|
+
| `selfAlign` | `AlignSelf` | Alias of `alignSelf`. |
|
|
137
|
+
| `overflow` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | How overflowing content is handled (`hidden`, `auto`, `scroll`). |
|
|
138
|
+
| `overflowX` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowX` value for the widget. |
|
|
139
|
+
| `overflowY` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowY` value for the widget. |
|
|
140
|
+
| `textOverflow` | `'clip' \| 'ellipsis' \| string` | The `textOverflow` value for the widget. |
|
|
141
|
+
| `whiteSpace` | `'normal' \| 'nowrap' \| 'pre' \| 'pre-wrap' \| 'pre-line' \| string` | The `whiteSpace` value for the widget. |
|
|
77
142
|
| `id` | `string` | DOM `id` for the rendered element. |
|
|
78
143
|
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
79
144
|
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
|
@@ -39,11 +39,64 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
39
39
|
|
|
40
40
|
| Prop | Type | Description |
|
|
41
41
|
| --- | --- | --- |
|
|
42
|
+
| `full` | `boolean` | Stretches the widget to fill its parent on both axes in stack mode. |
|
|
43
|
+
| `fullHeight` | `boolean` | Stretches the widget to the full height of its parent in stack mode. |
|
|
44
|
+
| `fullWidth` | `boolean` | Stretches the widget to the full width of its parent. |
|
|
45
|
+
| `center` | `boolean` | Centres the widget on both axes in stack mode. |
|
|
46
|
+
| `centerY` | `boolean` | Centres the widget vertically in stack mode. |
|
|
47
|
+
| `centerX` | `boolean` | Centres the widget horizontally in stack mode. |
|
|
48
|
+
| `zIndex` | `number` | Stacking order: a widget with a higher value paints above lower ones. |
|
|
49
|
+
| `z` | `number` | Alias of `zIndex`. |
|
|
50
|
+
| `end` | `Size` | Logical alias of `right`, used by the stack placement shorthands. |
|
|
51
|
+
| `start` | `Size` | Logical alias of `left`, used by the stack placement shorthands. |
|
|
52
|
+
| `inset` | `Size` | Shorthand for the four edge offsets (`top`/`right`/`bottom`/`left`). |
|
|
53
|
+
| `left` | `Size` | Offset from the left edge. A number is pixels; a string uses any CSS unit. |
|
|
54
|
+
| `bottom` | `Size` | Offset from the bottom edge. A number is pixels; a string uses any CSS unit. |
|
|
55
|
+
| `right` | `Size` | Offset from the right edge. A number is pixels; a string uses any CSS unit. |
|
|
56
|
+
| `top` | `Size` | Offset from the top edge. A number is pixels; a string uses any CSS unit. |
|
|
57
|
+
| `pos` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | Alias of `position`. |
|
|
58
|
+
| `position` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | CSS `position` value, or `stack` for centered stacking. |
|
|
42
59
|
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
43
60
|
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
44
61
|
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
62
|
+
| `flex` | `number` | Flex grow/shrink/basis shorthand for a flex child. |
|
|
63
|
+
| `minWidth` | `Size` | Minimum width the widget may shrink to. |
|
|
64
|
+
| `maxWidth` | `Size` | Maximum width the widget may grow to. |
|
|
65
|
+
| `minHeight` | `Size` | Minimum height the widget may shrink to. |
|
|
66
|
+
| `maxHeight` | `Size` | Maximum height the widget may grow to. |
|
|
67
|
+
| `border` | `string` | CSS `border` shorthand for all four edges: width, style and color in one string. |
|
|
68
|
+
| `borderTop` | `string` | The top edge of the border alone, for a widget whose rim differs per side. |
|
|
69
|
+
| `borderBottom` | `string` | The bottom edge of the border alone, for a widget whose rim differs per side. |
|
|
70
|
+
| `borderLeft` | `string` | The left edge of the border alone, for a widget whose rim differs per side. |
|
|
71
|
+
| `borderRight` | `string` | The right edge of the border alone, for a widget whose rim differs per side. |
|
|
72
|
+
| `cursor` | `string` | CSS `cursor` value: what the pointer becomes over the widget (`pointer`, `grab`, `not-allowed`). |
|
|
73
|
+
| `display` | `string` | CSS `display` value for the container. |
|
|
74
|
+
| `boxSizing` | `'border-box' \| 'content-box'` | Which box `width` and `height` measure: `border-box` keeps the size you asked for and pushes padding inward. |
|
|
75
|
+
| `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | Main axis of a flex container: `row` places children side by side, `column` stacks them. |
|
|
76
|
+
| `flexGrow` | `number` | Share of the leftover space this child takes, relative to its siblings. |
|
|
77
|
+
| `flexShrink` | `number` | How readily the child gives space back when the row overflows; `0` keeps its size. |
|
|
78
|
+
| `gap` | `number \| string` | Space between children along the layout axis. |
|
|
79
|
+
| `fontSize` | `number` | Size of the font. |
|
|
80
|
+
| `borderColor` | `Color` | Color used for the border. |
|
|
81
|
+
| `borderWidth` | `number` | Width of the border. |
|
|
45
82
|
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
83
|
+
| `paddingTop` | `Size` | Space inside the widget, on the top edge only. |
|
|
84
|
+
| `paddingRight` | `Size` | Space inside the widget, on the right edge only. |
|
|
85
|
+
| `paddingBottom` | `Size` | Space inside the widget, on the bottom edge only. |
|
|
86
|
+
| `paddingLeft` | `Size` | Space inside the widget, on the left edge only. |
|
|
87
|
+
| `pt` | `Size` | Alias of `paddingTop`. |
|
|
88
|
+
| `pr` | `Size` | Alias of `paddingRight`. |
|
|
89
|
+
| `pb` | `Size` | Alias of `paddingBottom`. |
|
|
90
|
+
| `pl` | `Size` | Alias of `paddingLeft`. |
|
|
46
91
|
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
92
|
+
| `marginTop` | `Size` | Space outside the widget, on the top edge only. |
|
|
93
|
+
| `marginRight` | `Size` | Space outside the widget, on the right edge only. |
|
|
94
|
+
| `marginBottom` | `Size` | Space outside the widget, on the bottom edge only. |
|
|
95
|
+
| `marginLeft` | `Size` | Space outside the widget, on the left edge only. |
|
|
96
|
+
| `mt` | `Size` | Alias of `marginTop`. |
|
|
97
|
+
| `mr` | `Size` | Alias of `marginRight`. |
|
|
98
|
+
| `mb` | `Size` | Alias of `marginBottom`. |
|
|
99
|
+
| `ml` | `Size` | Alias of `marginLeft`. |
|
|
47
100
|
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
48
101
|
| `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
|
|
49
102
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -53,11 +106,23 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
53
106
|
| `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
|
|
54
107
|
| `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
108
|
| `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
|
|
109
|
+
| `bgImage` | `string` | Image painted behind the widget's content (CSS `background-image`), placed with `bgSize` and `bgPosition`. |
|
|
110
|
+
| `bgSize` | `string` | How the background image fills its box (`cover`, `contain`, or a length). |
|
|
111
|
+
| `bgPosition` | `string` | Where the background image is anchored (`center`, `top`, `50% 20%`). |
|
|
112
|
+
| `bgRepeat` | `string` | Whether the background image tiles; `no-repeat` for a single cover. |
|
|
56
113
|
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
57
114
|
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
58
115
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
59
|
-
| `onPress` | `(
|
|
60
|
-
| `onClick` | `(
|
|
116
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
117
|
+
| `onClick` | `(event?: Event) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
118
|
+
| `onclick` | `(event?: Event) => void` | Lowercase alias of `onClick`, kept because the shipped templates and the HTML habit write it. |
|
|
119
|
+
| `alignSelf` | `AlignSelf` | Overrides the parent's `alignItems` for this child alone (CSS `align-self`). Alias: `selfAlign`. |
|
|
120
|
+
| `selfAlign` | `AlignSelf` | Alias of `alignSelf`. |
|
|
121
|
+
| `overflow` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | How overflowing content is handled (`hidden`, `auto`, `scroll`). |
|
|
122
|
+
| `overflowX` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowX` value for the widget. |
|
|
123
|
+
| `overflowY` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowY` value for the widget. |
|
|
124
|
+
| `textOverflow` | `'clip' \| 'ellipsis' \| string` | The `textOverflow` value for the widget. |
|
|
125
|
+
| `whiteSpace` | `'normal' \| 'nowrap' \| 'pre' \| 'pre-wrap' \| 'pre-line' \| string` | The `whiteSpace` value for the widget. |
|
|
61
126
|
| `id` | `string` | DOM `id` for the rendered element. |
|
|
62
127
|
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
63
128
|
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
|
@@ -121,4 +186,4 @@ const create = FloatingActionButton({
|
|
|
121
186
|
- **Next:** [Pagination](Pagination.md)
|
|
122
187
|
- **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
|
|
123
188
|
|
|
124
|
-
You are reading **Chapter 4 · Feedback and overlays** (
|
|
189
|
+
You are reading **Chapter 4 · Feedback and overlays** (10 of 11).
|
package/docs/widget/GridView.md
CHANGED
|
@@ -49,11 +49,64 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
49
49
|
|
|
50
50
|
| Prop | Type | Description |
|
|
51
51
|
| --- | --- | --- |
|
|
52
|
+
| `full` | `boolean` | Stretches the widget to fill its parent on both axes in stack mode. |
|
|
53
|
+
| `fullHeight` | `boolean` | Stretches the widget to the full height of its parent in stack mode. |
|
|
54
|
+
| `fullWidth` | `boolean` | Stretches the widget to the full width of its parent. |
|
|
55
|
+
| `center` | `boolean` | Centres the widget on both axes in stack mode. |
|
|
56
|
+
| `centerY` | `boolean` | Centres the widget vertically in stack mode. |
|
|
57
|
+
| `centerX` | `boolean` | Centres the widget horizontally in stack mode. |
|
|
58
|
+
| `zIndex` | `number` | Stacking order: a widget with a higher value paints above lower ones. |
|
|
59
|
+
| `z` | `number` | Alias of `zIndex`. |
|
|
60
|
+
| `end` | `Size` | Logical alias of `right`, used by the stack placement shorthands. |
|
|
61
|
+
| `start` | `Size` | Logical alias of `left`, used by the stack placement shorthands. |
|
|
62
|
+
| `inset` | `Size` | Shorthand for the four edge offsets (`top`/`right`/`bottom`/`left`). |
|
|
63
|
+
| `left` | `Size` | Offset from the left edge. A number is pixels; a string uses any CSS unit. |
|
|
64
|
+
| `bottom` | `Size` | Offset from the bottom edge. A number is pixels; a string uses any CSS unit. |
|
|
65
|
+
| `right` | `Size` | Offset from the right edge. A number is pixels; a string uses any CSS unit. |
|
|
66
|
+
| `top` | `Size` | Offset from the top edge. A number is pixels; a string uses any CSS unit. |
|
|
67
|
+
| `pos` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | Alias of `position`. |
|
|
68
|
+
| `position` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | CSS `position` value, or `stack` for centered stacking. |
|
|
52
69
|
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
53
70
|
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
54
71
|
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
72
|
+
| `flex` | `number` | Flex grow/shrink/basis shorthand for a flex child. |
|
|
73
|
+
| `minWidth` | `Size` | Minimum width the widget may shrink to. |
|
|
74
|
+
| `maxWidth` | `Size` | Maximum width the widget may grow to. |
|
|
75
|
+
| `minHeight` | `Size` | Minimum height the widget may shrink to. |
|
|
76
|
+
| `maxHeight` | `Size` | Maximum height the widget may grow to. |
|
|
77
|
+
| `border` | `string` | CSS `border` shorthand for all four edges: width, style and color in one string. |
|
|
78
|
+
| `borderTop` | `string` | The top edge of the border alone, for a widget whose rim differs per side. |
|
|
79
|
+
| `borderBottom` | `string` | The bottom edge of the border alone, for a widget whose rim differs per side. |
|
|
80
|
+
| `borderLeft` | `string` | The left edge of the border alone, for a widget whose rim differs per side. |
|
|
81
|
+
| `borderRight` | `string` | The right edge of the border alone, for a widget whose rim differs per side. |
|
|
82
|
+
| `cursor` | `string` | CSS `cursor` value: what the pointer becomes over the widget (`pointer`, `grab`, `not-allowed`). |
|
|
83
|
+
| `display` | `string` | CSS `display` value for the container. |
|
|
84
|
+
| `boxSizing` | `'border-box' \| 'content-box'` | Which box `width` and `height` measure: `border-box` keeps the size you asked for and pushes padding inward. |
|
|
85
|
+
| `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | Main axis of a flex container: `row` places children side by side, `column` stacks them. |
|
|
86
|
+
| `flexGrow` | `number` | Share of the leftover space this child takes, relative to its siblings. |
|
|
87
|
+
| `flexShrink` | `number` | How readily the child gives space back when the row overflows; `0` keeps its size. |
|
|
88
|
+
| `gap` | `number \| string` | Space between children along the layout axis. |
|
|
89
|
+
| `fontSize` | `number` | Size of the font. |
|
|
90
|
+
| `borderColor` | `Color` | Color used for the border. |
|
|
91
|
+
| `borderWidth` | `number` | Width of the border. |
|
|
55
92
|
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
93
|
+
| `paddingTop` | `Size` | Space inside the widget, on the top edge only. |
|
|
94
|
+
| `paddingRight` | `Size` | Space inside the widget, on the right edge only. |
|
|
95
|
+
| `paddingBottom` | `Size` | Space inside the widget, on the bottom edge only. |
|
|
96
|
+
| `paddingLeft` | `Size` | Space inside the widget, on the left edge only. |
|
|
97
|
+
| `pt` | `Size` | Alias of `paddingTop`. |
|
|
98
|
+
| `pr` | `Size` | Alias of `paddingRight`. |
|
|
99
|
+
| `pb` | `Size` | Alias of `paddingBottom`. |
|
|
100
|
+
| `pl` | `Size` | Alias of `paddingLeft`. |
|
|
56
101
|
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
102
|
+
| `marginTop` | `Size` | Space outside the widget, on the top edge only. |
|
|
103
|
+
| `marginRight` | `Size` | Space outside the widget, on the right edge only. |
|
|
104
|
+
| `marginBottom` | `Size` | Space outside the widget, on the bottom edge only. |
|
|
105
|
+
| `marginLeft` | `Size` | Space outside the widget, on the left edge only. |
|
|
106
|
+
| `mt` | `Size` | Alias of `marginTop`. |
|
|
107
|
+
| `mr` | `Size` | Alias of `marginRight`. |
|
|
108
|
+
| `mb` | `Size` | Alias of `marginBottom`. |
|
|
109
|
+
| `ml` | `Size` | Alias of `marginLeft`. |
|
|
57
110
|
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
58
111
|
| `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
|
|
59
112
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -63,11 +116,23 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
63
116
|
| `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
|
|
64
117
|
| `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
118
|
| `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
|
|
119
|
+
| `bgImage` | `string` | Image painted behind the widget's content (CSS `background-image`), placed with `bgSize` and `bgPosition`. |
|
|
120
|
+
| `bgSize` | `string` | How the background image fills its box (`cover`, `contain`, or a length). |
|
|
121
|
+
| `bgPosition` | `string` | Where the background image is anchored (`center`, `top`, `50% 20%`). |
|
|
122
|
+
| `bgRepeat` | `string` | Whether the background image tiles; `no-repeat` for a single cover. |
|
|
66
123
|
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
67
124
|
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
68
125
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
69
|
-
| `onPress` | `(
|
|
70
|
-
| `onClick` | `(
|
|
126
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
127
|
+
| `onClick` | `(event?: Event) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
128
|
+
| `onclick` | `(event?: Event) => void` | Lowercase alias of `onClick`, kept because the shipped templates and the HTML habit write it. |
|
|
129
|
+
| `alignSelf` | `AlignSelf` | Overrides the parent's `alignItems` for this child alone (CSS `align-self`). Alias: `selfAlign`. |
|
|
130
|
+
| `selfAlign` | `AlignSelf` | Alias of `alignSelf`. |
|
|
131
|
+
| `overflow` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | How overflowing content is handled (`hidden`, `auto`, `scroll`). |
|
|
132
|
+
| `overflowX` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowX` value for the widget. |
|
|
133
|
+
| `overflowY` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowY` value for the widget. |
|
|
134
|
+
| `textOverflow` | `'clip' \| 'ellipsis' \| string` | The `textOverflow` value for the widget. |
|
|
135
|
+
| `whiteSpace` | `'normal' \| 'nowrap' \| 'pre' \| 'pre-wrap' \| 'pre-line' \| string` | The `whiteSpace` value for the widget. |
|
|
71
136
|
| `id` | `string` | DOM `id` for the rendered element. |
|
|
72
137
|
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
73
138
|
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
package/docs/widget/Icon.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Icon
|
|
2
2
|
|
|
3
|
-
Material icon glyph rendered as a span. `name`
|
|
3
|
+
Material icon glyph rendered as a span. `name` (or its alias `icon`) names the Material Icons ligature to draw.
|
|
4
4
|
|
|
5
5
|
## When to use it
|
|
6
6
|
|
|
@@ -22,10 +22,11 @@ const settings = Icon({
|
|
|
22
22
|
|
|
23
23
|
| Prop | Type | Description |
|
|
24
24
|
| --- | --- | --- |
|
|
25
|
-
| `name` | `string` |
|
|
25
|
+
| `name` | `string` | Name of the Material icon to draw. Alias: `icon`. |
|
|
26
|
+
| `icon` | `string` | Name of the icon to render. |
|
|
26
27
|
| `size` | `number` | Overall size preset or pixel value, depending on the widget. |
|
|
27
28
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
28
|
-
| `onPress` | `(
|
|
29
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
29
30
|
|
|
30
31
|
### Common props
|
|
31
32
|
|
|
@@ -33,11 +34,64 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
33
34
|
|
|
34
35
|
| Prop | Type | Description |
|
|
35
36
|
| --- | --- | --- |
|
|
37
|
+
| `full` | `boolean` | Stretches the widget to fill its parent on both axes in stack mode. |
|
|
38
|
+
| `fullHeight` | `boolean` | Stretches the widget to the full height of its parent in stack mode. |
|
|
39
|
+
| `fullWidth` | `boolean` | Stretches the widget to the full width of its parent. |
|
|
40
|
+
| `center` | `boolean` | Centres the widget on both axes in stack mode. |
|
|
41
|
+
| `centerY` | `boolean` | Centres the widget vertically in stack mode. |
|
|
42
|
+
| `centerX` | `boolean` | Centres the widget horizontally in stack mode. |
|
|
43
|
+
| `zIndex` | `number` | Stacking order: a widget with a higher value paints above lower ones. |
|
|
44
|
+
| `z` | `number` | Alias of `zIndex`. |
|
|
45
|
+
| `end` | `Size` | Logical alias of `right`, used by the stack placement shorthands. |
|
|
46
|
+
| `start` | `Size` | Logical alias of `left`, used by the stack placement shorthands. |
|
|
47
|
+
| `inset` | `Size` | Shorthand for the four edge offsets (`top`/`right`/`bottom`/`left`). |
|
|
48
|
+
| `left` | `Size` | Offset from the left edge. A number is pixels; a string uses any CSS unit. |
|
|
49
|
+
| `bottom` | `Size` | Offset from the bottom edge. A number is pixels; a string uses any CSS unit. |
|
|
50
|
+
| `right` | `Size` | Offset from the right edge. A number is pixels; a string uses any CSS unit. |
|
|
51
|
+
| `top` | `Size` | Offset from the top edge. A number is pixels; a string uses any CSS unit. |
|
|
52
|
+
| `pos` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | Alias of `position`. |
|
|
53
|
+
| `position` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | CSS `position` value, or `stack` for centered stacking. |
|
|
36
54
|
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
37
55
|
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
38
56
|
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
57
|
+
| `flex` | `number` | Flex grow/shrink/basis shorthand for a flex child. |
|
|
58
|
+
| `minWidth` | `Size` | Minimum width the widget may shrink to. |
|
|
59
|
+
| `maxWidth` | `Size` | Maximum width the widget may grow to. |
|
|
60
|
+
| `minHeight` | `Size` | Minimum height the widget may shrink to. |
|
|
61
|
+
| `maxHeight` | `Size` | Maximum height the widget may grow to. |
|
|
62
|
+
| `border` | `string` | CSS `border` shorthand for all four edges: width, style and color in one string. |
|
|
63
|
+
| `borderTop` | `string` | The top edge of the border alone, for a widget whose rim differs per side. |
|
|
64
|
+
| `borderBottom` | `string` | The bottom edge of the border alone, for a widget whose rim differs per side. |
|
|
65
|
+
| `borderLeft` | `string` | The left edge of the border alone, for a widget whose rim differs per side. |
|
|
66
|
+
| `borderRight` | `string` | The right edge of the border alone, for a widget whose rim differs per side. |
|
|
67
|
+
| `cursor` | `string` | CSS `cursor` value: what the pointer becomes over the widget (`pointer`, `grab`, `not-allowed`). |
|
|
68
|
+
| `display` | `string` | CSS `display` value for the container. |
|
|
69
|
+
| `boxSizing` | `'border-box' \| 'content-box'` | Which box `width` and `height` measure: `border-box` keeps the size you asked for and pushes padding inward. |
|
|
70
|
+
| `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | Main axis of a flex container: `row` places children side by side, `column` stacks them. |
|
|
71
|
+
| `flexGrow` | `number` | Share of the leftover space this child takes, relative to its siblings. |
|
|
72
|
+
| `flexShrink` | `number` | How readily the child gives space back when the row overflows; `0` keeps its size. |
|
|
73
|
+
| `gap` | `number \| string` | Space between children along the layout axis. |
|
|
74
|
+
| `fontSize` | `number` | Size of the font. |
|
|
75
|
+
| `borderColor` | `Color` | Color used for the border. |
|
|
76
|
+
| `borderWidth` | `number` | Width of the border. |
|
|
39
77
|
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
78
|
+
| `paddingTop` | `Size` | Space inside the widget, on the top edge only. |
|
|
79
|
+
| `paddingRight` | `Size` | Space inside the widget, on the right edge only. |
|
|
80
|
+
| `paddingBottom` | `Size` | Space inside the widget, on the bottom edge only. |
|
|
81
|
+
| `paddingLeft` | `Size` | Space inside the widget, on the left edge only. |
|
|
82
|
+
| `pt` | `Size` | Alias of `paddingTop`. |
|
|
83
|
+
| `pr` | `Size` | Alias of `paddingRight`. |
|
|
84
|
+
| `pb` | `Size` | Alias of `paddingBottom`. |
|
|
85
|
+
| `pl` | `Size` | Alias of `paddingLeft`. |
|
|
40
86
|
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
87
|
+
| `marginTop` | `Size` | Space outside the widget, on the top edge only. |
|
|
88
|
+
| `marginRight` | `Size` | Space outside the widget, on the right edge only. |
|
|
89
|
+
| `marginBottom` | `Size` | Space outside the widget, on the bottom edge only. |
|
|
90
|
+
| `marginLeft` | `Size` | Space outside the widget, on the left edge only. |
|
|
91
|
+
| `mt` | `Size` | Alias of `marginTop`. |
|
|
92
|
+
| `mr` | `Size` | Alias of `marginRight`. |
|
|
93
|
+
| `mb` | `Size` | Alias of `marginBottom`. |
|
|
94
|
+
| `ml` | `Size` | Alias of `marginLeft`. |
|
|
41
95
|
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
42
96
|
| `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
|
|
43
97
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -47,11 +101,23 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
47
101
|
| `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
|
|
48
102
|
| `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. |
|
|
49
103
|
| `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
|
|
104
|
+
| `bgImage` | `string` | Image painted behind the widget's content (CSS `background-image`), placed with `bgSize` and `bgPosition`. |
|
|
105
|
+
| `bgSize` | `string` | How the background image fills its box (`cover`, `contain`, or a length). |
|
|
106
|
+
| `bgPosition` | `string` | Where the background image is anchored (`center`, `top`, `50% 20%`). |
|
|
107
|
+
| `bgRepeat` | `string` | Whether the background image tiles; `no-repeat` for a single cover. |
|
|
50
108
|
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
51
109
|
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
52
110
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
53
|
-
| `onPress` | `(
|
|
54
|
-
| `onClick` | `(
|
|
111
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
112
|
+
| `onClick` | `(event?: Event) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
113
|
+
| `onclick` | `(event?: Event) => void` | Lowercase alias of `onClick`, kept because the shipped templates and the HTML habit write it. |
|
|
114
|
+
| `alignSelf` | `AlignSelf` | Overrides the parent's `alignItems` for this child alone (CSS `align-self`). Alias: `selfAlign`. |
|
|
115
|
+
| `selfAlign` | `AlignSelf` | Alias of `alignSelf`. |
|
|
116
|
+
| `overflow` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | How overflowing content is handled (`hidden`, `auto`, `scroll`). |
|
|
117
|
+
| `overflowX` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowX` value for the widget. |
|
|
118
|
+
| `overflowY` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowY` value for the widget. |
|
|
119
|
+
| `textOverflow` | `'clip' \| 'ellipsis' \| string` | The `textOverflow` value for the widget. |
|
|
120
|
+
| `whiteSpace` | `'normal' \| 'nowrap' \| 'pre' \| 'pre-wrap' \| 'pre-line' \| string` | The `whiteSpace` value for the widget. |
|
|
55
121
|
| `id` | `string` | DOM `id` for the rendered element. |
|
|
56
122
|
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
57
123
|
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|