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/Image.md
CHANGED
|
@@ -33,7 +33,7 @@ const photo = Image({
|
|
|
33
33
|
| `downloadFileName` | `string` | File name suggested when saving; defaults to the name in the URL. |
|
|
34
34
|
| `onLoad` | `(widget: Widget) => void` | Fired when the media finishes loading. |
|
|
35
35
|
| `onError` | `(widget: Widget) => void` | Fired when the media fails to load. |
|
|
36
|
-
| `onPress` | `(
|
|
36
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
37
37
|
|
|
38
38
|
### Common props
|
|
39
39
|
|
|
@@ -41,11 +41,64 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
41
41
|
|
|
42
42
|
| Prop | Type | Description |
|
|
43
43
|
| --- | --- | --- |
|
|
44
|
+
| `full` | `boolean` | Stretches the widget to fill its parent on both axes in stack mode. |
|
|
45
|
+
| `fullHeight` | `boolean` | Stretches the widget to the full height of its parent in stack mode. |
|
|
46
|
+
| `fullWidth` | `boolean` | Stretches the widget to the full width of its parent. |
|
|
47
|
+
| `center` | `boolean` | Centres the widget on both axes in stack mode. |
|
|
48
|
+
| `centerY` | `boolean` | Centres the widget vertically in stack mode. |
|
|
49
|
+
| `centerX` | `boolean` | Centres the widget horizontally in stack mode. |
|
|
50
|
+
| `zIndex` | `number` | Stacking order: a widget with a higher value paints above lower ones. |
|
|
51
|
+
| `z` | `number` | Alias of `zIndex`. |
|
|
52
|
+
| `end` | `Size` | Logical alias of `right`, used by the stack placement shorthands. |
|
|
53
|
+
| `start` | `Size` | Logical alias of `left`, used by the stack placement shorthands. |
|
|
54
|
+
| `inset` | `Size` | Shorthand for the four edge offsets (`top`/`right`/`bottom`/`left`). |
|
|
55
|
+
| `left` | `Size` | Offset from the left edge. A number is pixels; a string uses any CSS unit. |
|
|
56
|
+
| `bottom` | `Size` | Offset from the bottom edge. A number is pixels; a string uses any CSS unit. |
|
|
57
|
+
| `right` | `Size` | Offset from the right edge. A number is pixels; a string uses any CSS unit. |
|
|
58
|
+
| `top` | `Size` | Offset from the top edge. A number is pixels; a string uses any CSS unit. |
|
|
59
|
+
| `pos` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | Alias of `position`. |
|
|
60
|
+
| `position` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | CSS `position` value, or `stack` for centered stacking. |
|
|
44
61
|
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
45
62
|
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
46
63
|
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
64
|
+
| `flex` | `number` | Flex grow/shrink/basis shorthand for a flex child. |
|
|
65
|
+
| `minWidth` | `Size` | Minimum width the widget may shrink to. |
|
|
66
|
+
| `maxWidth` | `Size` | Maximum width the widget may grow to. |
|
|
67
|
+
| `minHeight` | `Size` | Minimum height the widget may shrink to. |
|
|
68
|
+
| `maxHeight` | `Size` | Maximum height the widget may grow to. |
|
|
69
|
+
| `border` | `string` | CSS `border` shorthand for all four edges: width, style and color in one string. |
|
|
70
|
+
| `borderTop` | `string` | The top edge of the border alone, for a widget whose rim differs per side. |
|
|
71
|
+
| `borderBottom` | `string` | The bottom edge of the border alone, for a widget whose rim differs per side. |
|
|
72
|
+
| `borderLeft` | `string` | The left edge of the border alone, for a widget whose rim differs per side. |
|
|
73
|
+
| `borderRight` | `string` | The right edge of the border alone, for a widget whose rim differs per side. |
|
|
74
|
+
| `cursor` | `string` | CSS `cursor` value: what the pointer becomes over the widget (`pointer`, `grab`, `not-allowed`). |
|
|
75
|
+
| `display` | `string` | CSS `display` value for the container. |
|
|
76
|
+
| `boxSizing` | `'border-box' \| 'content-box'` | Which box `width` and `height` measure: `border-box` keeps the size you asked for and pushes padding inward. |
|
|
77
|
+
| `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | Main axis of a flex container: `row` places children side by side, `column` stacks them. |
|
|
78
|
+
| `flexGrow` | `number` | Share of the leftover space this child takes, relative to its siblings. |
|
|
79
|
+
| `flexShrink` | `number` | How readily the child gives space back when the row overflows; `0` keeps its size. |
|
|
80
|
+
| `gap` | `number \| string` | Space between children along the layout axis. |
|
|
81
|
+
| `fontSize` | `number` | Size of the font. |
|
|
82
|
+
| `borderColor` | `Color` | Color used for the border. |
|
|
83
|
+
| `borderWidth` | `number` | Width of the border. |
|
|
47
84
|
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
85
|
+
| `paddingTop` | `Size` | Space inside the widget, on the top edge only. |
|
|
86
|
+
| `paddingRight` | `Size` | Space inside the widget, on the right edge only. |
|
|
87
|
+
| `paddingBottom` | `Size` | Space inside the widget, on the bottom edge only. |
|
|
88
|
+
| `paddingLeft` | `Size` | Space inside the widget, on the left edge only. |
|
|
89
|
+
| `pt` | `Size` | Alias of `paddingTop`. |
|
|
90
|
+
| `pr` | `Size` | Alias of `paddingRight`. |
|
|
91
|
+
| `pb` | `Size` | Alias of `paddingBottom`. |
|
|
92
|
+
| `pl` | `Size` | Alias of `paddingLeft`. |
|
|
48
93
|
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
94
|
+
| `marginTop` | `Size` | Space outside the widget, on the top edge only. |
|
|
95
|
+
| `marginRight` | `Size` | Space outside the widget, on the right edge only. |
|
|
96
|
+
| `marginBottom` | `Size` | Space outside the widget, on the bottom edge only. |
|
|
97
|
+
| `marginLeft` | `Size` | Space outside the widget, on the left edge only. |
|
|
98
|
+
| `mt` | `Size` | Alias of `marginTop`. |
|
|
99
|
+
| `mr` | `Size` | Alias of `marginRight`. |
|
|
100
|
+
| `mb` | `Size` | Alias of `marginBottom`. |
|
|
101
|
+
| `ml` | `Size` | Alias of `marginLeft`. |
|
|
49
102
|
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
50
103
|
| `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
|
|
51
104
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -55,11 +108,23 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
55
108
|
| `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
|
|
56
109
|
| `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
110
|
| `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
|
|
111
|
+
| `bgImage` | `string` | Image painted behind the widget's content (CSS `background-image`), placed with `bgSize` and `bgPosition`. |
|
|
112
|
+
| `bgSize` | `string` | How the background image fills its box (`cover`, `contain`, or a length). |
|
|
113
|
+
| `bgPosition` | `string` | Where the background image is anchored (`center`, `top`, `50% 20%`). |
|
|
114
|
+
| `bgRepeat` | `string` | Whether the background image tiles; `no-repeat` for a single cover. |
|
|
58
115
|
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
59
116
|
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
60
117
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
61
|
-
| `onPress` | `(
|
|
62
|
-
| `onClick` | `(
|
|
118
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
119
|
+
| `onClick` | `(event?: Event) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
120
|
+
| `onclick` | `(event?: Event) => void` | Lowercase alias of `onClick`, kept because the shipped templates and the HTML habit write it. |
|
|
121
|
+
| `alignSelf` | `AlignSelf` | Overrides the parent's `alignItems` for this child alone (CSS `align-self`). Alias: `selfAlign`. |
|
|
122
|
+
| `selfAlign` | `AlignSelf` | Alias of `alignSelf`. |
|
|
123
|
+
| `overflow` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | How overflowing content is handled (`hidden`, `auto`, `scroll`). |
|
|
124
|
+
| `overflowX` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowX` value for the widget. |
|
|
125
|
+
| `overflowY` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowY` value for the widget. |
|
|
126
|
+
| `textOverflow` | `'clip' \| 'ellipsis' \| string` | The `textOverflow` value for the widget. |
|
|
127
|
+
| `whiteSpace` | `'normal' \| 'nowrap' \| 'pre' \| 'pre-wrap' \| 'pre-line' \| string` | The `whiteSpace` value for the widget. |
|
|
63
128
|
| `id` | `string` | DOM `id` for the rendered element. |
|
|
64
129
|
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
65
130
|
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
package/docs/widget/Input.md
CHANGED
|
@@ -59,11 +59,64 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
59
59
|
|
|
60
60
|
| Prop | Type | Description |
|
|
61
61
|
| --- | --- | --- |
|
|
62
|
+
| `full` | `boolean` | Stretches the widget to fill its parent on both axes in stack mode. |
|
|
63
|
+
| `fullHeight` | `boolean` | Stretches the widget to the full height of its parent in stack mode. |
|
|
64
|
+
| `fullWidth` | `boolean` | Stretches the widget to the full width of its parent. |
|
|
65
|
+
| `center` | `boolean` | Centres the widget on both axes in stack mode. |
|
|
66
|
+
| `centerY` | `boolean` | Centres the widget vertically in stack mode. |
|
|
67
|
+
| `centerX` | `boolean` | Centres the widget horizontally in stack mode. |
|
|
68
|
+
| `zIndex` | `number` | Stacking order: a widget with a higher value paints above lower ones. |
|
|
69
|
+
| `z` | `number` | Alias of `zIndex`. |
|
|
70
|
+
| `end` | `Size` | Logical alias of `right`, used by the stack placement shorthands. |
|
|
71
|
+
| `start` | `Size` | Logical alias of `left`, used by the stack placement shorthands. |
|
|
72
|
+
| `inset` | `Size` | Shorthand for the four edge offsets (`top`/`right`/`bottom`/`left`). |
|
|
73
|
+
| `left` | `Size` | Offset from the left edge. A number is pixels; a string uses any CSS unit. |
|
|
74
|
+
| `bottom` | `Size` | Offset from the bottom edge. A number is pixels; a string uses any CSS unit. |
|
|
75
|
+
| `right` | `Size` | Offset from the right edge. A number is pixels; a string uses any CSS unit. |
|
|
76
|
+
| `top` | `Size` | Offset from the top edge. A number is pixels; a string uses any CSS unit. |
|
|
77
|
+
| `pos` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | Alias of `position`. |
|
|
78
|
+
| `position` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | CSS `position` value, or `stack` for centered stacking. |
|
|
62
79
|
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
63
80
|
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
64
81
|
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
82
|
+
| `flex` | `number` | Flex grow/shrink/basis shorthand for a flex child. |
|
|
83
|
+
| `minWidth` | `Size` | Minimum width the widget may shrink to. |
|
|
84
|
+
| `maxWidth` | `Size` | Maximum width the widget may grow to. |
|
|
85
|
+
| `minHeight` | `Size` | Minimum height the widget may shrink to. |
|
|
86
|
+
| `maxHeight` | `Size` | Maximum height the widget may grow to. |
|
|
87
|
+
| `border` | `string` | CSS `border` shorthand for all four edges: width, style and color in one string. |
|
|
88
|
+
| `borderTop` | `string` | The top edge of the border alone, for a widget whose rim differs per side. |
|
|
89
|
+
| `borderBottom` | `string` | The bottom edge of the border alone, for a widget whose rim differs per side. |
|
|
90
|
+
| `borderLeft` | `string` | The left edge of the border alone, for a widget whose rim differs per side. |
|
|
91
|
+
| `borderRight` | `string` | The right edge of the border alone, for a widget whose rim differs per side. |
|
|
92
|
+
| `cursor` | `string` | CSS `cursor` value: what the pointer becomes over the widget (`pointer`, `grab`, `not-allowed`). |
|
|
93
|
+
| `display` | `string` | CSS `display` value for the container. |
|
|
94
|
+
| `boxSizing` | `'border-box' \| 'content-box'` | Which box `width` and `height` measure: `border-box` keeps the size you asked for and pushes padding inward. |
|
|
95
|
+
| `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | Main axis of a flex container: `row` places children side by side, `column` stacks them. |
|
|
96
|
+
| `flexGrow` | `number` | Share of the leftover space this child takes, relative to its siblings. |
|
|
97
|
+
| `flexShrink` | `number` | How readily the child gives space back when the row overflows; `0` keeps its size. |
|
|
98
|
+
| `gap` | `number \| string` | Space between children along the layout axis. |
|
|
99
|
+
| `fontSize` | `number` | Size of the font. |
|
|
100
|
+
| `borderColor` | `Color` | Color used for the border. |
|
|
101
|
+
| `borderWidth` | `number` | Width of the border. |
|
|
65
102
|
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
103
|
+
| `paddingTop` | `Size` | Space inside the widget, on the top edge only. |
|
|
104
|
+
| `paddingRight` | `Size` | Space inside the widget, on the right edge only. |
|
|
105
|
+
| `paddingBottom` | `Size` | Space inside the widget, on the bottom edge only. |
|
|
106
|
+
| `paddingLeft` | `Size` | Space inside the widget, on the left edge only. |
|
|
107
|
+
| `pt` | `Size` | Alias of `paddingTop`. |
|
|
108
|
+
| `pr` | `Size` | Alias of `paddingRight`. |
|
|
109
|
+
| `pb` | `Size` | Alias of `paddingBottom`. |
|
|
110
|
+
| `pl` | `Size` | Alias of `paddingLeft`. |
|
|
66
111
|
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
112
|
+
| `marginTop` | `Size` | Space outside the widget, on the top edge only. |
|
|
113
|
+
| `marginRight` | `Size` | Space outside the widget, on the right edge only. |
|
|
114
|
+
| `marginBottom` | `Size` | Space outside the widget, on the bottom edge only. |
|
|
115
|
+
| `marginLeft` | `Size` | Space outside the widget, on the left edge only. |
|
|
116
|
+
| `mt` | `Size` | Alias of `marginTop`. |
|
|
117
|
+
| `mr` | `Size` | Alias of `marginRight`. |
|
|
118
|
+
| `mb` | `Size` | Alias of `marginBottom`. |
|
|
119
|
+
| `ml` | `Size` | Alias of `marginLeft`. |
|
|
67
120
|
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
68
121
|
| `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
|
|
69
122
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -73,11 +126,23 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
73
126
|
| `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
|
|
74
127
|
| `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. |
|
|
75
128
|
| `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
|
|
129
|
+
| `bgImage` | `string` | Image painted behind the widget's content (CSS `background-image`), placed with `bgSize` and `bgPosition`. |
|
|
130
|
+
| `bgSize` | `string` | How the background image fills its box (`cover`, `contain`, or a length). |
|
|
131
|
+
| `bgPosition` | `string` | Where the background image is anchored (`center`, `top`, `50% 20%`). |
|
|
132
|
+
| `bgRepeat` | `string` | Whether the background image tiles; `no-repeat` for a single cover. |
|
|
76
133
|
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
77
134
|
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
78
135
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
79
|
-
| `onPress` | `(
|
|
80
|
-
| `onClick` | `(
|
|
136
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
137
|
+
| `onClick` | `(event?: Event) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
138
|
+
| `onclick` | `(event?: Event) => void` | Lowercase alias of `onClick`, kept because the shipped templates and the HTML habit write it. |
|
|
139
|
+
| `alignSelf` | `AlignSelf` | Overrides the parent's `alignItems` for this child alone (CSS `align-self`). Alias: `selfAlign`. |
|
|
140
|
+
| `selfAlign` | `AlignSelf` | Alias of `alignSelf`. |
|
|
141
|
+
| `overflow` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | How overflowing content is handled (`hidden`, `auto`, `scroll`). |
|
|
142
|
+
| `overflowX` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowX` value for the widget. |
|
|
143
|
+
| `overflowY` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowY` value for the widget. |
|
|
144
|
+
| `textOverflow` | `'clip' \| 'ellipsis' \| string` | The `textOverflow` value for the widget. |
|
|
145
|
+
| `whiteSpace` | `'normal' \| 'nowrap' \| 'pre' \| 'pre-wrap' \| 'pre-line' \| string` | The `whiteSpace` value for the widget. |
|
|
81
146
|
| `id` | `string` | DOM `id` for the rendered element. |
|
|
82
147
|
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
83
148
|
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
|
@@ -154,4 +219,4 @@ const password = Input({
|
|
|
154
219
|
- **Next:** [Checkbox](Checkbox.md)
|
|
155
220
|
- **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
|
|
156
221
|
|
|
157
|
-
You are reading **Chapter 2 · Interaction basics** (2 of
|
|
222
|
+
You are reading **Chapter 2 · Interaction basics** (2 of 9).
|
package/docs/widget/Inspector.md
CHANGED
|
@@ -56,14 +56,14 @@ const debug = Inspector({
|
|
|
56
56
|
Button({ text: "Save" }),
|
|
57
57
|
],
|
|
58
58
|
}),
|
|
59
|
-
indent:
|
|
59
|
+
indent: 2,
|
|
60
60
|
});
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
## Tips
|
|
64
64
|
|
|
65
65
|
- Pass the widget instance you want to examine to widget; the tree follows its current children.
|
|
66
|
-
- Increase indent
|
|
66
|
+
- Increase indent shifts the whole printout right; it is a depth count, not a pixel gap.
|
|
67
67
|
- Remove Inspector from production screens since it is a diagnostic tool.
|
|
68
68
|
|
|
69
69
|
## Accessibility
|
|
@@ -28,7 +28,7 @@ const install = InstallButton({
|
|
|
28
28
|
| `size` | `'small' \| 'medium' \| 'large'` | Overall size preset or pixel value, depending on the widget. |
|
|
29
29
|
| `borderRadius` | `number` | Rounds the corners of the widget. |
|
|
30
30
|
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
31
|
-
| `bottom` | `number` |
|
|
31
|
+
| `bottom` | `number` | Offset from the bottom edge. A number is pixels; a string uses any CSS unit. |
|
|
32
32
|
| `onInstalled` | `() => void` | Fired when the PWA finishes installing. |
|
|
33
33
|
| `onClick` | `() => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
34
34
|
|
|
@@ -38,11 +38,64 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
38
38
|
|
|
39
39
|
| Prop | Type | Description |
|
|
40
40
|
| --- | --- | --- |
|
|
41
|
+
| `full` | `boolean` | Stretches the widget to fill its parent on both axes in stack mode. |
|
|
42
|
+
| `fullHeight` | `boolean` | Stretches the widget to the full height of its parent in stack mode. |
|
|
43
|
+
| `fullWidth` | `boolean` | Stretches the widget to the full width of its parent. |
|
|
44
|
+
| `center` | `boolean` | Centres the widget on both axes in stack mode. |
|
|
45
|
+
| `centerY` | `boolean` | Centres the widget vertically in stack mode. |
|
|
46
|
+
| `centerX` | `boolean` | Centres the widget horizontally in stack mode. |
|
|
47
|
+
| `zIndex` | `number` | Stacking order: a widget with a higher value paints above lower ones. |
|
|
48
|
+
| `z` | `number` | Alias of `zIndex`. |
|
|
49
|
+
| `end` | `Size` | Logical alias of `right`, used by the stack placement shorthands. |
|
|
50
|
+
| `start` | `Size` | Logical alias of `left`, used by the stack placement shorthands. |
|
|
51
|
+
| `inset` | `Size` | Shorthand for the four edge offsets (`top`/`right`/`bottom`/`left`). |
|
|
52
|
+
| `left` | `Size` | Offset from the left edge. A number is pixels; a string uses any CSS unit. |
|
|
53
|
+
| `bottom` | `Size` | Offset from the bottom edge. A number is pixels; a string uses any CSS unit. |
|
|
54
|
+
| `right` | `Size` | Offset from the right edge. A number is pixels; a string uses any CSS unit. |
|
|
55
|
+
| `top` | `Size` | Offset from the top edge. A number is pixels; a string uses any CSS unit. |
|
|
56
|
+
| `pos` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | Alias of `position`. |
|
|
57
|
+
| `position` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | CSS `position` value, or `stack` for centered stacking. |
|
|
41
58
|
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
42
59
|
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
43
60
|
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
61
|
+
| `flex` | `number` | Flex grow/shrink/basis shorthand for a flex child. |
|
|
62
|
+
| `minWidth` | `Size` | Minimum width the widget may shrink to. |
|
|
63
|
+
| `maxWidth` | `Size` | Maximum width the widget may grow to. |
|
|
64
|
+
| `minHeight` | `Size` | Minimum height the widget may shrink to. |
|
|
65
|
+
| `maxHeight` | `Size` | Maximum height the widget may grow to. |
|
|
66
|
+
| `border` | `string` | CSS `border` shorthand for all four edges: width, style and color in one string. |
|
|
67
|
+
| `borderTop` | `string` | The top edge of the border alone, for a widget whose rim differs per side. |
|
|
68
|
+
| `borderBottom` | `string` | The bottom edge of the border alone, for a widget whose rim differs per side. |
|
|
69
|
+
| `borderLeft` | `string` | The left edge of the border alone, for a widget whose rim differs per side. |
|
|
70
|
+
| `borderRight` | `string` | The right edge of the border alone, for a widget whose rim differs per side. |
|
|
71
|
+
| `cursor` | `string` | CSS `cursor` value: what the pointer becomes over the widget (`pointer`, `grab`, `not-allowed`). |
|
|
72
|
+
| `display` | `string` | CSS `display` value for the container. |
|
|
73
|
+
| `boxSizing` | `'border-box' \| 'content-box'` | Which box `width` and `height` measure: `border-box` keeps the size you asked for and pushes padding inward. |
|
|
74
|
+
| `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | Main axis of a flex container: `row` places children side by side, `column` stacks them. |
|
|
75
|
+
| `flexGrow` | `number` | Share of the leftover space this child takes, relative to its siblings. |
|
|
76
|
+
| `flexShrink` | `number` | How readily the child gives space back when the row overflows; `0` keeps its size. |
|
|
77
|
+
| `gap` | `number \| string` | Space between children along the layout axis. |
|
|
78
|
+
| `fontSize` | `number` | Size of the font. |
|
|
79
|
+
| `borderColor` | `Color` | Color used for the border. |
|
|
80
|
+
| `borderWidth` | `number` | Width of the border. |
|
|
44
81
|
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
82
|
+
| `paddingTop` | `Size` | Space inside the widget, on the top edge only. |
|
|
83
|
+
| `paddingRight` | `Size` | Space inside the widget, on the right edge only. |
|
|
84
|
+
| `paddingBottom` | `Size` | Space inside the widget, on the bottom edge only. |
|
|
85
|
+
| `paddingLeft` | `Size` | Space inside the widget, on the left edge only. |
|
|
86
|
+
| `pt` | `Size` | Alias of `paddingTop`. |
|
|
87
|
+
| `pr` | `Size` | Alias of `paddingRight`. |
|
|
88
|
+
| `pb` | `Size` | Alias of `paddingBottom`. |
|
|
89
|
+
| `pl` | `Size` | Alias of `paddingLeft`. |
|
|
45
90
|
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
91
|
+
| `marginTop` | `Size` | Space outside the widget, on the top edge only. |
|
|
92
|
+
| `marginRight` | `Size` | Space outside the widget, on the right edge only. |
|
|
93
|
+
| `marginBottom` | `Size` | Space outside the widget, on the bottom edge only. |
|
|
94
|
+
| `marginLeft` | `Size` | Space outside the widget, on the left edge only. |
|
|
95
|
+
| `mt` | `Size` | Alias of `marginTop`. |
|
|
96
|
+
| `mr` | `Size` | Alias of `marginRight`. |
|
|
97
|
+
| `mb` | `Size` | Alias of `marginBottom`. |
|
|
98
|
+
| `ml` | `Size` | Alias of `marginLeft`. |
|
|
46
99
|
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
47
100
|
| `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
|
|
48
101
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -52,11 +105,23 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
52
105
|
| `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
|
|
53
106
|
| `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
107
|
| `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
|
|
108
|
+
| `bgImage` | `string` | Image painted behind the widget's content (CSS `background-image`), placed with `bgSize` and `bgPosition`. |
|
|
109
|
+
| `bgSize` | `string` | How the background image fills its box (`cover`, `contain`, or a length). |
|
|
110
|
+
| `bgPosition` | `string` | Where the background image is anchored (`center`, `top`, `50% 20%`). |
|
|
111
|
+
| `bgRepeat` | `string` | Whether the background image tiles; `no-repeat` for a single cover. |
|
|
55
112
|
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
56
113
|
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
57
114
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
58
|
-
| `onPress` | `(
|
|
59
|
-
| `onClick` | `(
|
|
115
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
116
|
+
| `onClick` | `(event?: Event) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
117
|
+
| `onclick` | `(event?: Event) => void` | Lowercase alias of `onClick`, kept because the shipped templates and the HTML habit write it. |
|
|
118
|
+
| `alignSelf` | `AlignSelf` | Overrides the parent's `alignItems` for this child alone (CSS `align-self`). Alias: `selfAlign`. |
|
|
119
|
+
| `selfAlign` | `AlignSelf` | Alias of `alignSelf`. |
|
|
120
|
+
| `overflow` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | How overflowing content is handled (`hidden`, `auto`, `scroll`). |
|
|
121
|
+
| `overflowX` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowX` value for the widget. |
|
|
122
|
+
| `overflowY` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowY` value for the widget. |
|
|
123
|
+
| `textOverflow` | `'clip' \| 'ellipsis' \| string` | The `textOverflow` value for the widget. |
|
|
124
|
+
| `whiteSpace` | `'normal' \| 'nowrap' \| 'pre' \| 'pre-wrap' \| 'pre-line' \| string` | The `whiteSpace` value for the widget. |
|
|
60
125
|
| `id` | `string` | DOM `id` for the rendered element. |
|
|
61
126
|
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
62
127
|
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
|
@@ -98,23 +163,18 @@ const install = InstallButton({
|
|
|
98
163
|
|
|
99
164
|
## Tips
|
|
100
165
|
|
|
101
|
-
- The button listens for the browser's beforeinstallprompt event and stays hidden
|
|
102
|
-
-
|
|
103
|
-
- It takes the same text, variant, and size vocabulary as Button, since it renders
|
|
104
|
-
- one internally.
|
|
166
|
+
- The button listens for the browser's beforeinstallprompt event and stays hidden until an install is actually offered.
|
|
167
|
+
- It takes the same text, variant, and size vocabulary as Button, since it renders one internally.
|
|
105
168
|
- Raise bottom to float the fixed button above a bottom navigation or dock.
|
|
106
169
|
|
|
107
170
|
## Accessibility
|
|
108
171
|
|
|
109
|
-
- Give it descriptive text like "Install app" rather than relying on an icon-only
|
|
110
|
-
- label, since the widget is a small floating control.
|
|
172
|
+
- Give it descriptive text like "Install app" rather than relying on an icon-only label, since the widget is a small floating control.
|
|
111
173
|
|
|
112
174
|
## Behavior
|
|
113
175
|
|
|
114
|
-
- It hides itself permanently when the app is installed and removes its window
|
|
115
|
-
-
|
|
116
|
-
- onInstalled fires when the user accepts the browser prompt; onClick fires for every
|
|
117
|
-
- click regardless of install availability.
|
|
176
|
+
- It hides itself permanently when the app is installed and removes its window listeners plus the underlying button on unmount.
|
|
177
|
+
- onInstalled fires when the user accepts the browser prompt; onClick fires for every click regardless of install availability.
|
|
118
178
|
|
|
119
179
|
## Related widgets
|
|
120
180
|
|
package/docs/widget/ListTile.md
CHANGED
|
@@ -30,7 +30,8 @@ const tile = ListTile({
|
|
|
30
30
|
| `subtitleProps` | `Partial<TextProps>` | The `subtitleProps` value for the widget. |
|
|
31
31
|
| `descriptionProps` | `Partial<TextProps>` | The `descriptionProps` value for the widget. |
|
|
32
32
|
| `rightItem` | `Widget` | The `rightItem` value for the widget. |
|
|
33
|
-
| `
|
|
33
|
+
| `gap` | `number` | Space between children along the layout axis. |
|
|
34
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
34
35
|
| `selected` | `boolean` | Current selected state. |
|
|
35
36
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
36
37
|
| `divider` | `boolean` | The `divider` value for the widget. |
|
|
@@ -48,11 +49,64 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
48
49
|
|
|
49
50
|
| Prop | Type | Description |
|
|
50
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. |
|
|
51
69
|
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
52
70
|
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
53
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. |
|
|
54
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`. |
|
|
55
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`. |
|
|
56
110
|
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
57
111
|
| `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
|
|
58
112
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -62,11 +116,23 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
62
116
|
| `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
|
|
63
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. |
|
|
64
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. |
|
|
65
123
|
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
66
124
|
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
67
125
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
68
|
-
| `onPress` | `(
|
|
69
|
-
| `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. |
|
|
70
136
|
| `id` | `string` | DOM `id` for the rendered element. |
|
|
71
137
|
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
72
138
|
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
package/docs/widget/ListView.md
CHANGED
|
@@ -47,11 +47,64 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
47
47
|
|
|
48
48
|
| Prop | Type | Description |
|
|
49
49
|
| --- | --- | --- |
|
|
50
|
+
| `full` | `boolean` | Stretches the widget to fill its parent on both axes in stack mode. |
|
|
51
|
+
| `fullHeight` | `boolean` | Stretches the widget to the full height of its parent in stack mode. |
|
|
52
|
+
| `fullWidth` | `boolean` | Stretches the widget to the full width of its parent. |
|
|
53
|
+
| `center` | `boolean` | Centres the widget on both axes in stack mode. |
|
|
54
|
+
| `centerY` | `boolean` | Centres the widget vertically in stack mode. |
|
|
55
|
+
| `centerX` | `boolean` | Centres the widget horizontally in stack mode. |
|
|
56
|
+
| `zIndex` | `number` | Stacking order: a widget with a higher value paints above lower ones. |
|
|
57
|
+
| `z` | `number` | Alias of `zIndex`. |
|
|
58
|
+
| `end` | `Size` | Logical alias of `right`, used by the stack placement shorthands. |
|
|
59
|
+
| `start` | `Size` | Logical alias of `left`, used by the stack placement shorthands. |
|
|
60
|
+
| `inset` | `Size` | Shorthand for the four edge offsets (`top`/`right`/`bottom`/`left`). |
|
|
61
|
+
| `left` | `Size` | Offset from the left edge. A number is pixels; a string uses any CSS unit. |
|
|
62
|
+
| `bottom` | `Size` | Offset from the bottom edge. A number is pixels; a string uses any CSS unit. |
|
|
63
|
+
| `right` | `Size` | Offset from the right edge. A number is pixels; a string uses any CSS unit. |
|
|
64
|
+
| `top` | `Size` | Offset from the top edge. A number is pixels; a string uses any CSS unit. |
|
|
65
|
+
| `pos` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | Alias of `position`. |
|
|
66
|
+
| `position` | `'static' \| 'relative' \| 'absolute' \| 'fixed' \| 'sticky' \| 'stack'` | CSS `position` value, or `stack` for centered stacking. |
|
|
50
67
|
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
51
68
|
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
52
69
|
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
70
|
+
| `flex` | `number` | Flex grow/shrink/basis shorthand for a flex child. |
|
|
71
|
+
| `minWidth` | `Size` | Minimum width the widget may shrink to. |
|
|
72
|
+
| `maxWidth` | `Size` | Maximum width the widget may grow to. |
|
|
73
|
+
| `minHeight` | `Size` | Minimum height the widget may shrink to. |
|
|
74
|
+
| `maxHeight` | `Size` | Maximum height the widget may grow to. |
|
|
75
|
+
| `border` | `string` | CSS `border` shorthand for all four edges: width, style and color in one string. |
|
|
76
|
+
| `borderTop` | `string` | The top edge of the border alone, for a widget whose rim differs per side. |
|
|
77
|
+
| `borderBottom` | `string` | The bottom edge of the border alone, for a widget whose rim differs per side. |
|
|
78
|
+
| `borderLeft` | `string` | The left edge of the border alone, for a widget whose rim differs per side. |
|
|
79
|
+
| `borderRight` | `string` | The right edge of the border alone, for a widget whose rim differs per side. |
|
|
80
|
+
| `cursor` | `string` | CSS `cursor` value: what the pointer becomes over the widget (`pointer`, `grab`, `not-allowed`). |
|
|
81
|
+
| `display` | `string` | CSS `display` value for the container. |
|
|
82
|
+
| `boxSizing` | `'border-box' \| 'content-box'` | Which box `width` and `height` measure: `border-box` keeps the size you asked for and pushes padding inward. |
|
|
83
|
+
| `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | Main axis of a flex container: `row` places children side by side, `column` stacks them. |
|
|
84
|
+
| `flexGrow` | `number` | Share of the leftover space this child takes, relative to its siblings. |
|
|
85
|
+
| `flexShrink` | `number` | How readily the child gives space back when the row overflows; `0` keeps its size. |
|
|
86
|
+
| `gap` | `number \| string` | Space between children along the layout axis. |
|
|
87
|
+
| `fontSize` | `number` | Size of the font. |
|
|
88
|
+
| `borderColor` | `Color` | Color used for the border. |
|
|
89
|
+
| `borderWidth` | `number` | Width of the border. |
|
|
53
90
|
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
91
|
+
| `paddingTop` | `Size` | Space inside the widget, on the top edge only. |
|
|
92
|
+
| `paddingRight` | `Size` | Space inside the widget, on the right edge only. |
|
|
93
|
+
| `paddingBottom` | `Size` | Space inside the widget, on the bottom edge only. |
|
|
94
|
+
| `paddingLeft` | `Size` | Space inside the widget, on the left edge only. |
|
|
95
|
+
| `pt` | `Size` | Alias of `paddingTop`. |
|
|
96
|
+
| `pr` | `Size` | Alias of `paddingRight`. |
|
|
97
|
+
| `pb` | `Size` | Alias of `paddingBottom`. |
|
|
98
|
+
| `pl` | `Size` | Alias of `paddingLeft`. |
|
|
54
99
|
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
100
|
+
| `marginTop` | `Size` | Space outside the widget, on the top edge only. |
|
|
101
|
+
| `marginRight` | `Size` | Space outside the widget, on the right edge only. |
|
|
102
|
+
| `marginBottom` | `Size` | Space outside the widget, on the bottom edge only. |
|
|
103
|
+
| `marginLeft` | `Size` | Space outside the widget, on the left edge only. |
|
|
104
|
+
| `mt` | `Size` | Alias of `marginTop`. |
|
|
105
|
+
| `mr` | `Size` | Alias of `marginRight`. |
|
|
106
|
+
| `mb` | `Size` | Alias of `marginBottom`. |
|
|
107
|
+
| `ml` | `Size` | Alias of `marginLeft`. |
|
|
55
108
|
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
56
109
|
| `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
|
|
57
110
|
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
@@ -61,11 +114,23 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
|
|
|
61
114
|
| `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
|
|
62
115
|
| `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
116
|
| `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
|
|
117
|
+
| `bgImage` | `string` | Image painted behind the widget's content (CSS `background-image`), placed with `bgSize` and `bgPosition`. |
|
|
118
|
+
| `bgSize` | `string` | How the background image fills its box (`cover`, `contain`, or a length). |
|
|
119
|
+
| `bgPosition` | `string` | Where the background image is anchored (`center`, `top`, `50% 20%`). |
|
|
120
|
+
| `bgRepeat` | `string` | Whether the background image tiles; `no-repeat` for a single cover. |
|
|
64
121
|
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
65
122
|
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
66
123
|
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
67
|
-
| `onPress` | `(
|
|
68
|
-
| `onClick` | `(
|
|
124
|
+
| `onPress` | `(event?: Event) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
125
|
+
| `onClick` | `(event?: Event) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
126
|
+
| `onclick` | `(event?: Event) => void` | Lowercase alias of `onClick`, kept because the shipped templates and the HTML habit write it. |
|
|
127
|
+
| `alignSelf` | `AlignSelf` | Overrides the parent's `alignItems` for this child alone (CSS `align-self`). Alias: `selfAlign`. |
|
|
128
|
+
| `selfAlign` | `AlignSelf` | Alias of `alignSelf`. |
|
|
129
|
+
| `overflow` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | How overflowing content is handled (`hidden`, `auto`, `scroll`). |
|
|
130
|
+
| `overflowX` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowX` value for the widget. |
|
|
131
|
+
| `overflowY` | `'auto' \| 'hidden' \| 'visible' \| 'scroll' \| 'clip'` | The `overflowY` value for the widget. |
|
|
132
|
+
| `textOverflow` | `'clip' \| 'ellipsis' \| string` | The `textOverflow` value for the widget. |
|
|
133
|
+
| `whiteSpace` | `'normal' \| 'nowrap' \| 'pre' \| 'pre-wrap' \| 'pre-line' \| string` | The `whiteSpace` value for the widget. |
|
|
69
134
|
| `id` | `string` | DOM `id` for the rendered element. |
|
|
70
135
|
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
71
136
|
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|