flet-box 1.0.4 → 1.0.6
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/README.md +10 -0
- package/bin/cli.js +23 -7
- package/bin/commands/checkApi.js +761 -0
- package/bin/commands/create.js +77 -5
- package/bin/utils/dtsProps.js +191 -0
- package/bin/utils/moduleExports.js +165 -0
- package/bin/utils/neutralise.js +64 -0
- package/bin/utils/templates.js +366 -27
- package/docs/CONTRIBUTING.md +156 -0
- package/docs/README.md +68 -0
- package/docs/arquitectura.md +164 -0
- package/docs/cli/README.md +542 -0
- package/docs/guides/README.md +33 -0
- package/docs/guides/app-templates.md +197 -0
- package/docs/guides/compatibility.md +95 -0
- package/docs/guides/embedding.md +284 -0
- package/docs/guides/first-app.md +208 -0
- package/docs/guides/frontend-services.md +171 -0
- package/docs/guides/minification-and-protection.md +260 -0
- package/docs/guides/mobile-and-platforms.md +439 -0
- package/docs/guides/online-updates.md +196 -0
- package/docs/guides/router.md +282 -0
- package/docs/guides/state.md +283 -0
- package/docs/guides/syntax-philosophy.md +150 -0
- package/docs/guides/utilities.md +241 -0
- package/docs/guides/widget-structure.md +163 -0
- package/docs/server/README.md +68 -0
- package/docs/server/START_HERE.md +121 -0
- package/docs/server/api.md +225 -0
- package/docs/server/data-services.md +300 -0
- package/docs/server/deployment.md +113 -0
- package/docs/server/security.md +196 -0
- package/docs/services/README.md +79 -0
- package/docs/services/RamStore.md +84 -0
- package/docs/services/Session.md +84 -0
- package/docs/services/Storage.md +88 -0
- package/docs/services/http.md +86 -0
- package/docs/tools/README.md +138 -0
- package/docs/tools/animation.md +87 -0
- package/docs/tools/async-ids-log.md +80 -0
- package/docs/tools/device.md +132 -0
- package/docs/tools/introspection.md +67 -0
- package/docs/tools/lists.md +96 -0
- package/docs/tools/markdown.md +79 -0
- package/docs/tools/reactivity.md +288 -0
- package/docs/tools/state.md +103 -0
- package/docs/tools/styling.md +92 -0
- package/docs/tools/text-and-time.md +89 -0
- package/docs/tools/theme.md +102 -0
- package/docs/tools/validation.md +75 -0
- package/docs/tools/visual-effects.md +84 -0
- package/docs/widget/Accordion.md +144 -0
- package/docs/widget/AdMob.md +144 -0
- package/docs/widget/AdSense.md +133 -0
- package/docs/widget/AdaptiveScaffold.md +105 -0
- package/docs/widget/AlertDialog.md +103 -0
- package/docs/widget/AnimatedBox.md +130 -0
- package/docs/widget/AnimatedText.md +123 -0
- package/docs/widget/AppBar.md +118 -0
- package/docs/widget/Audio.md +135 -0
- package/docs/widget/Avatar.md +119 -0
- package/docs/widget/Badge.md +128 -0
- package/docs/widget/BottomNavigation.md +116 -0
- package/docs/widget/BottomSheet.md +125 -0
- package/docs/widget/Button.md +137 -0
- package/docs/widget/COMMON_PROPS.md +150 -0
- package/docs/widget/Card.md +125 -0
- package/docs/widget/Carousel.md +151 -0
- package/docs/widget/Chart.md +151 -0
- package/docs/widget/Checkbox.md +118 -0
- package/docs/widget/Chip.md +126 -0
- package/docs/widget/CircularBar.md +168 -0
- package/docs/widget/CircularChart.md +164 -0
- package/docs/widget/CodeViewer.md +130 -0
- package/docs/widget/CollapsibleSideBar.md +112 -0
- package/docs/widget/Column.md +129 -0
- package/docs/widget/Container.md +136 -0
- package/docs/widget/DataTable.md +150 -0
- package/docs/widget/Divider.md +109 -0
- package/docs/widget/DraggBox.md +129 -0
- package/docs/widget/Drawer.md +135 -0
- package/docs/widget/DrawerItem.md +98 -0
- package/docs/widget/Dropdown.md +139 -0
- package/docs/widget/DroppBox.md +152 -0
- package/docs/widget/FloatingActionButton.md +120 -0
- package/docs/widget/GridView.md +140 -0
- package/docs/widget/Icon.md +117 -0
- package/docs/widget/Image.md +125 -0
- package/docs/widget/Input.md +151 -0
- package/docs/widget/Inspector.md +92 -0
- package/docs/widget/InstallButton.md +128 -0
- package/docs/widget/ListTile.md +132 -0
- package/docs/widget/ListView.md +138 -0
- package/docs/widget/Markdown.md +175 -0
- package/docs/widget/MatrixRain.md +122 -0
- package/docs/widget/Modal.md +129 -0
- package/docs/widget/Pagination.md +135 -0
- package/docs/widget/ParallaxBox.md +128 -0
- package/docs/widget/ProgressBar.md +130 -0
- package/docs/widget/QRCode.md +117 -0
- package/docs/widget/README.md +188 -0
- package/docs/widget/Radio.md +123 -0
- package/docs/widget/Rating.md +131 -0
- package/docs/widget/Row.md +131 -0
- package/docs/widget/START_HERE.md +146 -0
- package/docs/widget/Scaffold.md +152 -0
- package/docs/widget/Skeleton.md +130 -0
- package/docs/widget/Slider.md +146 -0
- package/docs/widget/SnackBar.md +102 -0
- package/docs/widget/Stack.md +128 -0
- package/docs/widget/Stepper.md +145 -0
- package/docs/widget/Switch.md +118 -0
- package/docs/widget/Tabs.md +124 -0
- package/docs/widget/Text.md +133 -0
- package/docs/widget/Tooltip.md +145 -0
- package/docs/widget/TreeView.md +176 -0
- package/docs/widget/Video.md +127 -0
- package/docs/widget/_template.md +61 -0
- package/package.json +3 -2
- package/src/animations/animate.js +180 -70
- package/src/animations/index.js +1 -0
- package/src/create-index.sh +1 -1
- package/src/index.d.ts +45 -22
- package/src/index.js +1 -0
- package/src/navigations/AdaptiveScaffold.js +11 -2
- package/src/navigations/BottomNavigation.js +10 -3
- package/src/navigations/Tabs.js +6 -2
- package/src/tools/useState.js +54 -63
- package/src/widget-factory/assignProps.js +23 -1
- package/src/widget-factory/processProps.js +10 -3
- package/src/widget-factory/reactiveValue.js +43 -18
- package/src/widget-factory/translateProps.js +777 -901
- package/src/widgets/AlertDialog.js +7 -5
- package/src/widgets/Checkbox.js +9 -7
- package/src/widgets/CircularBar.js +12 -1
- package/src/widgets/FloatingActionButton.js +4 -7
- package/src/widgets/Image.js +5 -7
- package/src/widgets/Input.js +92 -0
- package/src/widgets/ListView.js +73 -29
- package/src/widgets/Pagination.js +6 -3
- package/src/widgets/ProgressBar.js +16 -13
- package/src/widgets/Radio.js +6 -7
- package/src/widgets/Slider.js +23 -4
- package/src/widgets/Stack.js +36 -3
- package/src/widgets/Stepper.js +4 -3
- package/src/widgets/Switch.js +3 -4
- package/src/widgets/TreeView.js +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# QRCode
|
|
2
|
+
|
|
3
|
+
QRCode renders a scannable QR image for a string value. It lets you tune size, colors and the error-correction level.
|
|
4
|
+
|
|
5
|
+
## When to use it
|
|
6
|
+
|
|
7
|
+
Use it to share URLs, pairing codes or contact data that a phone camera can scan.
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
import { QRCode } from "flet-box";
|
|
13
|
+
|
|
14
|
+
const qr = QRCode({
|
|
15
|
+
value: "https://fletbox.dev",
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> The prop table is generated from `src/index.d.ts`; the examples use only documented props.
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Description |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `value` | `string` | Current value controlled by the widget. |
|
|
26
|
+
| `size` | `number` | Overall size preset or pixel value, depending on the widget. |
|
|
27
|
+
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
28
|
+
| `fgColor` | `Color` | Color used for the fg. |
|
|
29
|
+
| `errorCorrection` | `'L' \| 'M' \| 'Q' \| 'H'` | The `errorCorrection` value for the widget. |
|
|
30
|
+
| `margin` | `number` | Space outside the widget, between it and its neighbors. |
|
|
31
|
+
|
|
32
|
+
### Common props
|
|
33
|
+
|
|
34
|
+
Every widget also accepts these shared props — see [common props](COMMON_PROPS.md) for the full rules and aliases.
|
|
35
|
+
|
|
36
|
+
| Prop | Type | Description |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
39
|
+
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
40
|
+
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
41
|
+
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
42
|
+
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
43
|
+
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
44
|
+
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
45
|
+
| `borderRadius` | `number \| string` | Rounds the corners of the widget. |
|
|
46
|
+
| `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
|
|
47
|
+
| `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
|
|
48
|
+
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
49
|
+
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
50
|
+
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
51
|
+
| `onPress` | `(widget: Widget) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
52
|
+
| `onClick` | `(widget: Widget) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
53
|
+
| `id` | `string` | DOM `id` for the rendered element. |
|
|
54
|
+
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
55
|
+
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
|
56
|
+
| `disableTransform` | `boolean` | Disables the default press/scale transform animation. |
|
|
57
|
+
|
|
58
|
+
## Examples
|
|
59
|
+
|
|
60
|
+
### Everyday
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
import { QRCode } from "flet-box";
|
|
64
|
+
|
|
65
|
+
const qr = QRCode({
|
|
66
|
+
value: "https://fletbox.dev/download",
|
|
67
|
+
size: 220,
|
|
68
|
+
errorCorrection: "M",
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Full
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
import { QRCode } from "flet-box";
|
|
76
|
+
|
|
77
|
+
const qr = QRCode({
|
|
78
|
+
value: "https://fletbox.dev/invite?team=core",
|
|
79
|
+
size: 320,
|
|
80
|
+
bgColor: "#ffffff",
|
|
81
|
+
fgColor: "#0f172a",
|
|
82
|
+
margin: 8,
|
|
83
|
+
errorCorrection: "H",
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Tips
|
|
88
|
+
|
|
89
|
+
- Keep size large enough to scan comfortably; very small codes fail on low-resolution cameras.
|
|
90
|
+
- Raise errorCorrection to H when the code may be printed small, dirty or partially covered.
|
|
91
|
+
- Keep fgColor dark and bgColor light for reliable contrast.
|
|
92
|
+
|
|
93
|
+
## Accessibility
|
|
94
|
+
|
|
95
|
+
- Also show the encoded value as text so users who cannot scan it can still read or type it.
|
|
96
|
+
- Maintain strong foreground and background contrast for camera and screen legibility.
|
|
97
|
+
|
|
98
|
+
## Behavior
|
|
99
|
+
|
|
100
|
+
- The QR image re-encodes whenever value or errorCorrection changes.
|
|
101
|
+
- margin adds a quiet-zone border around the code, which scanners expect.
|
|
102
|
+
|
|
103
|
+
## Related widgets
|
|
104
|
+
|
|
105
|
+
- [Image](Image.md)
|
|
106
|
+
- [CodeViewer](CodeViewer.md)
|
|
107
|
+
- [Card](Card.md)
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Continue reading
|
|
112
|
+
|
|
113
|
+
- **Previous:** [CodeViewer](CodeViewer.md)
|
|
114
|
+
- **Next:** [Inspector](Inspector.md)
|
|
115
|
+
- **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
|
|
116
|
+
|
|
117
|
+
You are reading **Chapter 6 · Data, rich content & effects** (6 of 13).
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Widgets: the FletBox book
|
|
2
|
+
|
|
3
|
+
This directory is a book. Read it in order to go from your first widget to complete, data-rich compositions. Every page links to the previous and next page, so you can follow it like a tutorial — or jump straight to a widget from the alphabetical index below.
|
|
4
|
+
|
|
5
|
+
If you have never used FletBox, begin with [Start here](START_HERE.md), then follow the reading path.
|
|
6
|
+
|
|
7
|
+
## How to read this book
|
|
8
|
+
|
|
9
|
+
- Chapters go from **basic to advanced**. Read them top to bottom the first time.
|
|
10
|
+
- Every widget page ends with a **Continue reading** block: previous page, next page, and a link back here.
|
|
11
|
+
- Every widget also accepts the [common props](COMMON_PROPS.md) — layout, spacing, color, typography, borders, events and aliases.
|
|
12
|
+
- Related widgets at the bottom of each page are clickable, so you can branch off whenever you are curious.
|
|
13
|
+
|
|
14
|
+
Related guides: [Build your first FletBox app](../guides/app-templates.md) · [Routing with FletBox](../guides/router.md) · [FletBox CLI](../cli/README.md).
|
|
15
|
+
|
|
16
|
+
## The reading path
|
|
17
|
+
|
|
18
|
+
### Chapter 1 · First steps: the core mental model
|
|
19
|
+
|
|
20
|
+
_layout and the core mental model_
|
|
21
|
+
|
|
22
|
+
1. [Text](Text.md) — Renders a string as inline text or as a heading, with control over size, weight, color, alignment, and inline styles.
|
|
23
|
+
2. [Container](Container.md) — General-purpose surface box
|
|
24
|
+
3. [Row](Row.md) — Horizontal flex layout that places its children side by side
|
|
25
|
+
4. [Column](Column.md) — Vertical flex layout that stacks its children one below another
|
|
26
|
+
5. [Stack](Stack.md) — Overlay container that lets children occupy the same box
|
|
27
|
+
6. [Icon](Icon.md) — Material icon glyph rendered as a span
|
|
28
|
+
7. [Image](Image.md) — Renders an image element from a URL or path
|
|
29
|
+
|
|
30
|
+
### Chapter 2 · Interaction basics
|
|
31
|
+
|
|
32
|
+
_the widgets users click and type into_
|
|
33
|
+
|
|
34
|
+
8. [Button](Button.md) — Interactive button with filled, outlined, and text variants, size presets, optional icons, and press feedback.
|
|
35
|
+
9. [Input](Input.md) — A text field that handles labels, placeholder text, input types, icons, validation, and change events in one widget.
|
|
36
|
+
10. [Checkbox](Checkbox.md) — A square checkbox with a check mark that represents an independent true/false choice.
|
|
37
|
+
11. [Radio](Radio.md) — A single-selection control that renders a circular radio button
|
|
38
|
+
12. [Switch](Switch.md) — An iOS-style toggle switch with a sliding knob that represents an on/off state.
|
|
39
|
+
13. [Slider](Slider.md) — A draggable range input that selects a numeric value along a track between min and max.
|
|
40
|
+
14. [Dropdown](Dropdown.md) — A select control that shows the current choice and opens a menu of options when clicked.
|
|
41
|
+
15. [Rating](Rating.md) — A row of star icons that captures or displays a score up to max
|
|
42
|
+
|
|
43
|
+
### Chapter 3 · Layout, cards and lists
|
|
44
|
+
|
|
45
|
+
_cards, lists, grids and content rows_
|
|
46
|
+
|
|
47
|
+
16. [Card](Card.md) — A rounded, optionally elevated surface that groups related content into a single tappable unit.
|
|
48
|
+
17. [Divider](Divider.md) — A thin horizontal or vertical line that separates sections of content
|
|
49
|
+
18. [ListTile](ListTile.md) — A single row with leading, title, subtitle, and trailing slots
|
|
50
|
+
19. [ListView](ListView.md) — Virtualized scrollable list that keeps only the visible rows plus a buffer in the DOM, so large datasets stay responsive.
|
|
51
|
+
20. [GridView](GridView.md) — Grid layout built on ListView's virtualization
|
|
52
|
+
21. [Avatar](Avatar.md) — A compact identity chip that shows a profile image, the person's initials, or a fallback icon
|
|
53
|
+
22. [Badge](Badge.md) — Wraps a child widget and overlays a small count or status marker at one of its corners
|
|
54
|
+
23. [Chip](Chip.md) — A compact, pill-shaped label for tags, filters, and selections
|
|
55
|
+
|
|
56
|
+
### Chapter 4 · Feedback and overlays
|
|
57
|
+
|
|
58
|
+
_dialogs, sheets, notifications and progress_
|
|
59
|
+
|
|
60
|
+
24. [AlertDialog](AlertDialog.md) — A pre-styled confirmation dialog built on Modal, with a variant icon, message and confirm/cancel buttons.
|
|
61
|
+
25. [Modal](Modal.md) — A centered dialog over a dimmed overlay that holds a title, content and a row of actions.
|
|
62
|
+
26. [BottomSheet](BottomSheet.md) — A panel that slides up from the bottom of the screen over a dimmed overlay.
|
|
63
|
+
27. [SnackBar](SnackBar.md) — A transient toast that appears at the edge of the screen, reports a short message, and dismisses itself.
|
|
64
|
+
28. [Tooltip](Tooltip.md) — Wraps a child widget and shows a labeled overlay bubble on hover or focus
|
|
65
|
+
29. [ProgressBar](ProgressBar.md) — A horizontal bar that visualizes completion from zero to max
|
|
66
|
+
30. [CircularBar](CircularBar.md) — A circular or radial progress indicator drawn on canvas
|
|
67
|
+
31. [Skeleton](Skeleton.md) — Renders animated placeholder blocks that stand in for content while it loads
|
|
68
|
+
32. [FloatingActionButton](FloatingActionButton.md) — A circular, elevated button that floats over content and can expand into a labeled pill.
|
|
69
|
+
33. [Pagination](Pagination.md) — Renders page controls derived from totalItems and pageSize, with optional first/last and prev/next buttons
|
|
70
|
+
|
|
71
|
+
### Chapter 5 · Navigation and flows
|
|
72
|
+
|
|
73
|
+
_multi-step flows, trees and rotating content_
|
|
74
|
+
|
|
75
|
+
34. [Stepper](Stepper.md) — A multi-step progress indicator that shows each step as a circle, number or icon and reveals the active step's content.
|
|
76
|
+
35. [Accordion](Accordion.md) — A collapsible panel that hides a title bar with expandable content beneath it
|
|
77
|
+
36. [TreeView](TreeView.md) — Renders a collapsible hierarchy from nodes, each with an id, label, optional icon, badge and children
|
|
78
|
+
37. [Carousel](Carousel.md) — Cycles through items one at a time with optional arrows, dots and autoplay
|
|
79
|
+
38. [InstallButton](InstallButton.md) — A floating button that appears only when the browser is ready to install the app as a PWA
|
|
80
|
+
|
|
81
|
+
### Chapter 6 · Data, rich content & effects
|
|
82
|
+
|
|
83
|
+
_tables, charts, rich text, ads and motion_
|
|
84
|
+
|
|
85
|
+
39. [DataTable](DataTable.md) — Renders tabular rows using a columns definition, with optional striping, hover and borders
|
|
86
|
+
40. [Chart](Chart.md) — Draws bar, line, area or candlestick data onto a canvas, with optional labels, grid and value annotations
|
|
87
|
+
41. [CircularChart](CircularChart.md) — A pie or donut chart drawn on canvas with per-slice value, label, and color
|
|
88
|
+
42. [Markdown](Markdown.md) — Renders markdown source as styled HTML with scoped CSS, syntax-highlighted code blocks, copy buttons, tables, and blockquotes inside a scrollable surface.
|
|
89
|
+
43. [CodeViewer](CodeViewer.md) — Shows a read-only code block with an optional header, line numbers and scrolling for long files
|
|
90
|
+
44. [QRCode](QRCode.md) — Renders a scannable QR image for a string value
|
|
91
|
+
45. [Inspector](Inspector.md) — Renders a read-only tree that drills into a widget's props, children and element structure
|
|
92
|
+
46. [AdSense](AdSense.md) — Google AdSense display unit for the web
|
|
93
|
+
47. [AdMob](AdMob.md) — Google AdMob banner and full-screen ads for native Capacitor builds
|
|
94
|
+
48. [AnimatedBox](AnimatedBox.md) — Wraps a single child and plays a sequence of CSS animations described by effect/from/to steps
|
|
95
|
+
49. [AnimatedText](AnimatedText.md) — Splits a Text widget into individual characters and animates each one, optionally staggering the start of every letter for a cascade effect.
|
|
96
|
+
50. [MatrixRain](MatrixRain.md) — A canvas-based Matrix-style effect where random characters cascade down the screen
|
|
97
|
+
51. [ParallaxBox](ParallaxBox.md) — A container that shifts its child in response to scroll, mouse position, or hover entry
|
|
98
|
+
|
|
99
|
+
### Chapter 7 · Media and drag & drop
|
|
100
|
+
|
|
101
|
+
_audio, video and drag-and-drop_
|
|
102
|
+
|
|
103
|
+
52. [Audio](Audio.md) — A thin wrapper around the native <audio> element with reliable duration detection, progress callbacks, and an imperative playback API
|
|
104
|
+
53. [Video](Video.md) — Renders a native <video> element with proper media attributes and a convenient playback API
|
|
105
|
+
54. [DraggBox](DraggBox.md) — Wraps a child so it can be dragged with the native drag-and-drop API
|
|
106
|
+
55. [DroppBox](DroppBox.md) — A drop target for DraggBox items
|
|
107
|
+
|
|
108
|
+
### Chapter 8 · App navigation
|
|
109
|
+
|
|
110
|
+
_Build the shell of a real application and wire it to the router._
|
|
111
|
+
|
|
112
|
+
56. [Scaffold](Scaffold.md) — the app shell: app bar, body, drawer, side bars
|
|
113
|
+
57. [AdaptiveScaffold](AdaptiveScaffold.md) — the same shell, adapted to phone and desktop
|
|
114
|
+
58. [AppBar](AppBar.md) — a top bar for titles, actions, and back navigation
|
|
115
|
+
59. [Drawer](Drawer.md) — a panel that slides in from the side
|
|
116
|
+
60. [DrawerItem](DrawerItem.md) — a router-aware row for a drawer or side bar
|
|
117
|
+
61. [BottomNavigation](BottomNavigation.md) — a bottom tab bar synced with the router
|
|
118
|
+
62. [Tabs](Tabs.md) — switch panes inside a screen
|
|
119
|
+
63. [CollapsibleSideBar](CollapsibleSideBar.md) — a side panel that collapses to icons
|
|
120
|
+
|
|
121
|
+
Then continue with [State, Router & Services](../guides/state.md) — Chapter 9.
|
|
122
|
+
|
|
123
|
+
## Alphabetical index
|
|
124
|
+
|
|
125
|
+
- [Accordion](Accordion.md)
|
|
126
|
+
- [AdMob](AdMob.md)
|
|
127
|
+
- [AdSense](AdSense.md)
|
|
128
|
+
- [AdaptiveScaffold](AdaptiveScaffold.md)
|
|
129
|
+
- [AlertDialog](AlertDialog.md)
|
|
130
|
+
- [AnimatedBox](AnimatedBox.md)
|
|
131
|
+
- [AnimatedText](AnimatedText.md)
|
|
132
|
+
- [AppBar](AppBar.md)
|
|
133
|
+
- [Audio](Audio.md)
|
|
134
|
+
- [Avatar](Avatar.md)
|
|
135
|
+
- [Badge](Badge.md)
|
|
136
|
+
- [BottomNavigation](BottomNavigation.md)
|
|
137
|
+
- [BottomSheet](BottomSheet.md)
|
|
138
|
+
- [Button](Button.md)
|
|
139
|
+
- [Card](Card.md)
|
|
140
|
+
- [Carousel](Carousel.md)
|
|
141
|
+
- [Chart](Chart.md)
|
|
142
|
+
- [Checkbox](Checkbox.md)
|
|
143
|
+
- [Chip](Chip.md)
|
|
144
|
+
- [CircularBar](CircularBar.md)
|
|
145
|
+
- [CircularChart](CircularChart.md)
|
|
146
|
+
- [CodeViewer](CodeViewer.md)
|
|
147
|
+
- [CollapsibleSideBar](CollapsibleSideBar.md)
|
|
148
|
+
- [Column](Column.md)
|
|
149
|
+
- [Container](Container.md)
|
|
150
|
+
- [DataTable](DataTable.md)
|
|
151
|
+
- [Divider](Divider.md)
|
|
152
|
+
- [DraggBox](DraggBox.md)
|
|
153
|
+
- [Drawer](Drawer.md)
|
|
154
|
+
- [DrawerItem](DrawerItem.md)
|
|
155
|
+
- [Dropdown](Dropdown.md)
|
|
156
|
+
- [DroppBox](DroppBox.md)
|
|
157
|
+
- [FloatingActionButton](FloatingActionButton.md)
|
|
158
|
+
- [GridView](GridView.md)
|
|
159
|
+
- [Icon](Icon.md)
|
|
160
|
+
- [Image](Image.md)
|
|
161
|
+
- [Input](Input.md)
|
|
162
|
+
- [Inspector](Inspector.md)
|
|
163
|
+
- [InstallButton](InstallButton.md)
|
|
164
|
+
- [ListTile](ListTile.md)
|
|
165
|
+
- [ListView](ListView.md)
|
|
166
|
+
- [Markdown](Markdown.md)
|
|
167
|
+
- [MatrixRain](MatrixRain.md)
|
|
168
|
+
- [Modal](Modal.md)
|
|
169
|
+
- [Pagination](Pagination.md)
|
|
170
|
+
- [ParallaxBox](ParallaxBox.md)
|
|
171
|
+
- [ProgressBar](ProgressBar.md)
|
|
172
|
+
- [QRCode](QRCode.md)
|
|
173
|
+
- [Radio](Radio.md)
|
|
174
|
+
- [Rating](Rating.md)
|
|
175
|
+
- [Row](Row.md)
|
|
176
|
+
- [Scaffold](Scaffold.md)
|
|
177
|
+
- [Skeleton](Skeleton.md)
|
|
178
|
+
- [Slider](Slider.md)
|
|
179
|
+
- [SnackBar](SnackBar.md)
|
|
180
|
+
- [Stack](Stack.md)
|
|
181
|
+
- [Stepper](Stepper.md)
|
|
182
|
+
- [Switch](Switch.md)
|
|
183
|
+
- [Tabs](Tabs.md)
|
|
184
|
+
- [Text](Text.md)
|
|
185
|
+
- [Tooltip](Tooltip.md)
|
|
186
|
+
- [TreeView](TreeView.md)
|
|
187
|
+
- [Video](Video.md)
|
|
188
|
+
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Radio
|
|
2
|
+
|
|
3
|
+
A single-selection control that renders a circular radio button. Radios sharing the same name form a group where only one can stay selected.
|
|
4
|
+
|
|
5
|
+
## When to use it
|
|
6
|
+
|
|
7
|
+
Use Radio when the user must pick exactly one option from a short, always-visible list.
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
import { Radio } from "flet-box";
|
|
13
|
+
|
|
14
|
+
const plan = Radio({
|
|
15
|
+
label: "Monthly",
|
|
16
|
+
name: "billing",
|
|
17
|
+
onSelect: (value) => console.log(value),
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
> The prop table is generated from `src/index.d.ts`; the examples use only documented props.
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| Prop | Type | Description |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| `selected` | `boolean` | Current selected state. |
|
|
28
|
+
| `onSelect` | `(selected: boolean) => void` | Fired when the widget or an option is selected. |
|
|
29
|
+
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
30
|
+
| `size` | `number` | Overall size preset or pixel value, depending on the widget. |
|
|
31
|
+
| `activeColor` | `Color` | Color used in the active state. |
|
|
32
|
+
| `label` | `string` | Label or caption shown near the control. |
|
|
33
|
+
| `name` | `string` | The `name` value for the widget. |
|
|
34
|
+
|
|
35
|
+
### Common props
|
|
36
|
+
|
|
37
|
+
Every widget also accepts these shared props — see [common props](COMMON_PROPS.md) for the full rules and aliases.
|
|
38
|
+
|
|
39
|
+
| Prop | Type | Description |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
42
|
+
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
43
|
+
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
44
|
+
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
45
|
+
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
46
|
+
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
47
|
+
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
48
|
+
| `borderRadius` | `number \| string` | Rounds the corners of the widget. |
|
|
49
|
+
| `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
|
|
50
|
+
| `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
|
|
51
|
+
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
52
|
+
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
53
|
+
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
54
|
+
| `onPress` | `(widget: Widget) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
55
|
+
| `onClick` | `(widget: Widget) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
56
|
+
| `id` | `string` | DOM `id` for the rendered element. |
|
|
57
|
+
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
58
|
+
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
|
59
|
+
| `disableTransform` | `boolean` | Disables the default press/scale transform animation. |
|
|
60
|
+
|
|
61
|
+
## Examples
|
|
62
|
+
|
|
63
|
+
### Everyday
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
import { Radio } from "flet-box";
|
|
67
|
+
|
|
68
|
+
const monthly = Radio({
|
|
69
|
+
label: "Monthly plan",
|
|
70
|
+
name: "billing",
|
|
71
|
+
selected: true,
|
|
72
|
+
activeColor: "#2563eb",
|
|
73
|
+
onSelect: (value) => console.log("billing:", value),
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Full
|
|
78
|
+
|
|
79
|
+
```javascript
|
|
80
|
+
import { Radio } from "flet-box";
|
|
81
|
+
|
|
82
|
+
const option = Radio({
|
|
83
|
+
label: "Express shipping",
|
|
84
|
+
name: "shipping",
|
|
85
|
+
selected: false,
|
|
86
|
+
disabled: false,
|
|
87
|
+
activeColor: "#16a34a",
|
|
88
|
+
size: 24,
|
|
89
|
+
onSelect: (value) => {
|
|
90
|
+
console.log("shipping changed:", value);
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Tips
|
|
96
|
+
|
|
97
|
+
- Give Radios that answer the same question the same name; selecting one clears the others in that group.
|
|
98
|
+
- Set selected for the initial choice and let onSelect write the change back into your own state.
|
|
99
|
+
|
|
100
|
+
## Accessibility
|
|
101
|
+
|
|
102
|
+
- The circle carries no visible label on its own; render a Text beside it and never rely on color alone.
|
|
103
|
+
|
|
104
|
+
## Behavior
|
|
105
|
+
|
|
106
|
+
- Clicking an already-selected Radio is a no-op, so onSelect only fires when the selection actually changes.
|
|
107
|
+
- The returned element exposes select(), unselect() and isSelected() for programmatic control.
|
|
108
|
+
|
|
109
|
+
## Related widgets
|
|
110
|
+
|
|
111
|
+
- [Switch](Switch.md)
|
|
112
|
+
- [Checkbox](Checkbox.md)
|
|
113
|
+
- [Dropdown](Dropdown.md)
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Continue reading
|
|
118
|
+
|
|
119
|
+
- **Previous:** [Checkbox](Checkbox.md)
|
|
120
|
+
- **Next:** [Switch](Switch.md)
|
|
121
|
+
- **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
|
|
122
|
+
|
|
123
|
+
You are reading **Chapter 2 · Interaction basics** (4 of 8).
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Rating
|
|
2
|
+
|
|
3
|
+
A row of star icons that captures or displays a score up to max. It supports half-star selection and an inline numeric readout.
|
|
4
|
+
|
|
5
|
+
## When to use it
|
|
6
|
+
|
|
7
|
+
Use it for product reviews, feedback forms, or any quick qualitative score.
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
import { Rating } from "flet-box";
|
|
13
|
+
|
|
14
|
+
const rating = Rating({
|
|
15
|
+
value: 4,
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> The prop table is generated from `src/index.d.ts`; the examples use only documented props.
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Description |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `value` | `number` | Current value controlled by the widget. |
|
|
26
|
+
| `max` | `number` | Maximum value used to compute the ratio. |
|
|
27
|
+
| `size` | `number` | Overall size preset or pixel value, depending on the widget. |
|
|
28
|
+
| `allowHalf` | `boolean` | Allows half-star ratings. |
|
|
29
|
+
| `activeColor` | `Color` | Color used in the active state. |
|
|
30
|
+
| `inactiveColor` | `Color` | Color used in the inactive state. |
|
|
31
|
+
| `showValue` | `boolean` | Shows the numeric value next to the indicator. |
|
|
32
|
+
| `valueColor` | `Color` | Color used for the value. |
|
|
33
|
+
| `valueSize` | `number` | Size of the value. |
|
|
34
|
+
| `readOnly` | `boolean` | Makes the control read-only. |
|
|
35
|
+
| `gap` | `number` | Space between children along the layout axis. |
|
|
36
|
+
| `iconActive` | `string` | The `iconActive` value for the widget. |
|
|
37
|
+
| `iconInactive` | `string` | The `iconInactive` value for the widget. |
|
|
38
|
+
| `iconHalf` | `string` | The `iconHalf` value for the widget. |
|
|
39
|
+
| `onChange` | `(value: number) => void` | Fired when the value changes. |
|
|
40
|
+
|
|
41
|
+
### Common props
|
|
42
|
+
|
|
43
|
+
Every widget also accepts these shared props — see [common props](COMMON_PROPS.md) for the full rules and aliases.
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Description |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
48
|
+
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
49
|
+
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
50
|
+
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
51
|
+
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
52
|
+
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
53
|
+
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
54
|
+
| `borderRadius` | `number \| string` | Rounds the corners of the widget. |
|
|
55
|
+
| `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
|
|
56
|
+
| `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
|
|
57
|
+
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
58
|
+
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
59
|
+
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
60
|
+
| `onPress` | `(widget: Widget) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
61
|
+
| `onClick` | `(widget: Widget) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
62
|
+
| `id` | `string` | DOM `id` for the rendered element. |
|
|
63
|
+
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
64
|
+
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
|
65
|
+
| `disableTransform` | `boolean` | Disables the default press/scale transform animation. |
|
|
66
|
+
|
|
67
|
+
## Examples
|
|
68
|
+
|
|
69
|
+
### Everyday
|
|
70
|
+
|
|
71
|
+
```javascript
|
|
72
|
+
import { Rating } from "flet-box";
|
|
73
|
+
|
|
74
|
+
const rating = Rating({
|
|
75
|
+
value: 4,
|
|
76
|
+
max: 5,
|
|
77
|
+
size: 24,
|
|
78
|
+
activeColor: "#f59e0b",
|
|
79
|
+
onChange: (value) => console.log(value),
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Full
|
|
84
|
+
|
|
85
|
+
```javascript
|
|
86
|
+
import { Rating } from "flet-box";
|
|
87
|
+
|
|
88
|
+
const rating = Rating({
|
|
89
|
+
value: 3.5,
|
|
90
|
+
max: 5,
|
|
91
|
+
size: 28,
|
|
92
|
+
allowHalf: true,
|
|
93
|
+
gap: 4,
|
|
94
|
+
activeColor: "#f59e0b",
|
|
95
|
+
inactiveColor: "#d1d5db",
|
|
96
|
+
showValue: true,
|
|
97
|
+
valueColor: "#374151",
|
|
98
|
+
valueSize: 16,
|
|
99
|
+
onChange: (value) => console.log("rated", value),
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Tips
|
|
104
|
+
|
|
105
|
+
- Set readOnly: true to display an aggregate score that users cannot change.
|
|
106
|
+
- Use allowHalf: true for finer-grained ratings like 3.5 stars.
|
|
107
|
+
|
|
108
|
+
## Accessibility
|
|
109
|
+
|
|
110
|
+
- Provide a nearby Text label or showValue so the chosen score is readable, not just stars.
|
|
111
|
+
|
|
112
|
+
## Behavior
|
|
113
|
+
|
|
114
|
+
- onChange receives the numeric value each time the user picks a rating.
|
|
115
|
+
- readOnly disables onChange while keeping the current value visible.
|
|
116
|
+
|
|
117
|
+
## Related widgets
|
|
118
|
+
|
|
119
|
+
- [ProgressBar](ProgressBar.md)
|
|
120
|
+
- [Slider](Slider.md)
|
|
121
|
+
- [Chip](Chip.md)
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Continue reading
|
|
126
|
+
|
|
127
|
+
- **Previous:** [Dropdown](Dropdown.md)
|
|
128
|
+
- **Next:** [Card](Card.md)
|
|
129
|
+
- **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
|
|
130
|
+
|
|
131
|
+
You are reading **Chapter 2 · Interaction basics** (8 of 8).
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Row
|
|
2
|
+
|
|
3
|
+
Horizontal flex layout that places its children side by side. It is full width and leaves height at auto by default.
|
|
4
|
+
|
|
5
|
+
## When to use it
|
|
6
|
+
|
|
7
|
+
Use Row for toolbars, button groups, and any set of items that should sit in a horizontal line.
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
import { Row, Text } from "flet-box";
|
|
13
|
+
|
|
14
|
+
const row = Row({
|
|
15
|
+
gap: 8,
|
|
16
|
+
children: [
|
|
17
|
+
Text({ text: "Left" }),
|
|
18
|
+
Text({ text: "Right" }),
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
> The prop table is generated from `src/index.d.ts`; the examples use only documented props.
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Description |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `gap` | `number \| string` | Space between children along the layout axis. |
|
|
30
|
+
| `justifyContent` | `ContainerProps['justifyContent']` | Aligns children along the main axis (CSS `justify-content`). |
|
|
31
|
+
| `alignItems` | `ContainerProps['alignItems']` | Aligns children across the cross axis (CSS `align-items`). |
|
|
32
|
+
| `wrap` | `boolean \| 'wrap' \| 'nowrap' \| 'wrap-reverse'` | Lets children wrap onto multiple lines. |
|
|
33
|
+
| `children` | `Widget[]` | An array of child widgets. Alias: `child` for a single child. |
|
|
34
|
+
| `onPress` | `(widget: Widget) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
35
|
+
|
|
36
|
+
### Common props
|
|
37
|
+
|
|
38
|
+
Every widget also accepts these shared props — see [common props](COMMON_PROPS.md) for the full rules and aliases.
|
|
39
|
+
|
|
40
|
+
| Prop | Type | Description |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
|
|
43
|
+
| `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
|
|
44
|
+
| `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
|
|
45
|
+
| `padding` | `Padding` | Space inside the widget, between its content and its border. |
|
|
46
|
+
| `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
|
|
47
|
+
| `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
|
|
48
|
+
| `color` | `Color` | Foreground color, usually the text or icon color. |
|
|
49
|
+
| `borderRadius` | `number \| string` | Rounds the corners of the widget. |
|
|
50
|
+
| `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
|
|
51
|
+
| `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
|
|
52
|
+
| `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
|
|
53
|
+
| `visible` | `boolean` | Whether the widget is rendered and visible. |
|
|
54
|
+
| `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
|
|
55
|
+
| `onPress` | `(widget: Widget) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
|
|
56
|
+
| `onClick` | `(widget: Widget) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
|
|
57
|
+
| `id` | `string` | DOM `id` for the rendered element. |
|
|
58
|
+
| `className` | `string` | CSS class names applied to the rendered element. |
|
|
59
|
+
| `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
|
|
60
|
+
| `disableTransform` | `boolean` | Disables the default press/scale transform animation. |
|
|
61
|
+
|
|
62
|
+
## Examples
|
|
63
|
+
|
|
64
|
+
### Everyday
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
import { Button, Row, Text } from "flet-box";
|
|
68
|
+
|
|
69
|
+
const row = Row({
|
|
70
|
+
gap: 12,
|
|
71
|
+
justifyContent: "space-between",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
children: [
|
|
74
|
+
Text({ text: "Update your profile" }),
|
|
75
|
+
Button({ text: "Save", onPress: () => console.log("saved") }),
|
|
76
|
+
],
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Full
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
import { Button, Icon, Row, Text } from "flet-box";
|
|
84
|
+
|
|
85
|
+
const row = Row({
|
|
86
|
+
gap: 16,
|
|
87
|
+
justifyContent: "center",
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
wrap: true,
|
|
90
|
+
padding: 16,
|
|
91
|
+
bgColor: "#f8fafc",
|
|
92
|
+
borderRadius: 12,
|
|
93
|
+
children: [
|
|
94
|
+
Icon({ name: "person" }),
|
|
95
|
+
Text({ text: "Jane Doe" }),
|
|
96
|
+
Button({ text: "Profile", variant: "outlined" }),
|
|
97
|
+
],
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Tips
|
|
102
|
+
|
|
103
|
+
- `justifyContent` distributes free horizontal space and `alignItems` aligns children vertically.
|
|
104
|
+
- Add `wrap: true` when children should flow onto additional lines instead of shrinking.
|
|
105
|
+
- `gap` sets an even space between every child.
|
|
106
|
+
|
|
107
|
+
## Accessibility
|
|
108
|
+
|
|
109
|
+
- Keep the DOM order the same as the visual order so keyboard and screen-reader focus follow the layout.
|
|
110
|
+
|
|
111
|
+
## Behavior
|
|
112
|
+
|
|
113
|
+
- The element is `display: flex` with `flex-direction: row`; passing `onPress` makes the whole row interactive.
|
|
114
|
+
- Children stay in the order given and can themselves be `expand` containers that share the row's width.
|
|
115
|
+
|
|
116
|
+
## Related widgets
|
|
117
|
+
|
|
118
|
+
- [Column](Column.md)
|
|
119
|
+
- [Container](Container.md)
|
|
120
|
+
- [Stack](Stack.md)
|
|
121
|
+
- [Button](Button.md)
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Continue reading
|
|
126
|
+
|
|
127
|
+
- **Previous:** [Container](Container.md)
|
|
128
|
+
- **Next:** [Column](Column.md)
|
|
129
|
+
- **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
|
|
130
|
+
|
|
131
|
+
You are reading **Chapter 1 · First steps: the core mental model** (3 of 7).
|