@ngrok/mantle 0.93.7 → 0.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +13 -1
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1181 -36
- package/dist/alert-CH99Rw-R.js +1 -0
- package/dist/{alert-BcSBNR3S.d.ts → alert-HffaioZM.d.ts} +31 -21
- package/dist/alert-center.d.ts +15 -3
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +15 -2
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +6 -1
- package/dist/alert.js +1 -1
- package/dist/anchor.d.ts +12 -0
- package/dist/app-layout.d.ts +16 -1
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +144 -88
- package/dist/area-chart.js +1 -1
- package/dist/avatar.d.ts +12 -0
- package/dist/badge.d.ts +13 -1
- package/dist/bar-chart.d.ts +144 -89
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +11 -0
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only.d.ts +8 -0
- package/dist/{button-Yxyu1XMd.d.ts → button-BGwOPjGV.d.ts} +7 -1
- package/dist/{button-B8k98Pby.js → button-BWGUuWnu.js} +1 -1
- package/dist/{button-CPsKGDK0.d.ts → button-Cgf2IcEC.d.ts} +8 -1
- package/dist/button-Cu9e3SM7.js +1 -0
- package/dist/{button-BX-4lYUn.d.ts → button-K0pKc3GN.d.ts} +3 -3
- package/dist/button.d.ts +9 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +7 -0
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +6 -1
- package/dist/centered-layout.d.ts +11 -0
- package/dist/chart-BO9EwQ60.js +1 -0
- package/dist/chart-CE5Uaqz9.js +1 -0
- package/dist/chart-DCTGGlWL.js +1 -0
- package/dist/chart-DudCw24t.js +2 -0
- package/dist/{chart-BpfbtOUN.d.ts → chart-jitNqimS.d.ts} +99 -103
- package/dist/{checkbox-DmSQXs26.js → checkbox-CS504fKk.js} +1 -1
- package/dist/checkbox.d.ts +14 -1
- package/dist/checkbox.js +1 -1
- package/dist/{choice-BLR0_MeB.d.ts → choice-BwfmbepO.d.ts} +7 -1
- package/dist/choice-uyYccm0A.js +1 -0
- package/dist/choice.d.ts +6 -1
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +13 -2
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +5 -0
- package/dist/code.d.ts +13 -0
- package/dist/color-CHZbU1Ww.js +1 -0
- package/dist/color.js +1 -1
- package/dist/combobox.d.ts +28 -14
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +14 -2
- package/dist/command.js +1 -1
- package/dist/cx.js +1 -1
- package/dist/data-table.d.ts +50 -19
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +12 -1
- package/dist/dialog-B9JAGy_x.d.ts +28 -0
- package/dist/{dialog-7TUgiSzX.js → dialog-CsugEt2A.js} +1 -1
- package/dist/{dialog-2fRO4ca4.d.ts → dialog-DD5H3EH1.d.ts} +10 -2
- package/dist/dialog.d.ts +7 -2
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-DHdgaw4P.js +1 -0
- package/dist/{dropdown-menu-CpjRwMWe.d.ts → dropdown-menu-DmDxYPde.d.ts} +34 -26
- package/dist/dropdown-menu.d.ts +6 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +5 -0
- package/dist/empty.js +1 -1
- package/dist/{field-V_gnkcmN.d.ts → field-BshcNVe_.d.ts} +1 -1
- package/dist/field.d.ts +17 -6
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +8 -0
- package/dist/hooks.d.ts +5 -0
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +23 -12
- package/dist/{icon-ByLVhdYq.d.ts → icon-NYvyyRMG.d.ts} +6 -0
- package/dist/icon.d.ts +7 -2
- package/dist/icon.js +1 -1
- package/dist/{icons-DP3lQw5O.js → icons-4JA-SGfv.js} +1 -1
- package/dist/icons.d.ts +13 -1
- package/dist/icons.js +1 -1
- package/dist/{index-BhfgyurF.d.ts → index-KJ06KK6t.d.ts} +3 -3
- package/dist/input-BjCDSOPA.js +1 -0
- package/dist/input-DHovzBjS.js +1 -0
- package/dist/{input-Dx5owTCc.d.ts → input-q8o5uMhW.d.ts} +11 -1
- package/dist/input.d.ts +34 -2
- package/dist/input.js +1 -1
- package/dist/kbd.d.ts +12 -0
- package/dist/{label-nHqqYS7e.js → label-DmDwzPD8.js} +1 -1
- package/dist/{label-Dn5CPJUj.d.ts → label-r2sJcSQ4.d.ts} +6 -0
- package/dist/label.d.ts +6 -1
- package/dist/label.js +1 -1
- package/dist/line-chart.d.ts +139 -82
- package/dist/line-chart.js +1 -1
- package/dist/{list-RFRIQxU2.js → list-CO_yLdln.js} +1 -1
- package/dist/list.d.ts +19 -1
- package/dist/list.js +1 -1
- package/dist/live-region.d.ts +14 -1
- package/dist/llms.txt +78 -76
- package/dist/main.d.ts +12 -0
- package/dist/mantle.css +110 -65
- package/dist/media-object.d.ts +12 -0
- package/dist/migrations/0014-chart-named-colors.yml +1389 -0
- package/dist/migrations/0015-segmented-control.yml +788 -0
- package/dist/multi-select.d.ts +15 -2
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +17 -5
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +92 -3
- package/dist/pagination.js +1 -1
- package/dist/popover-BhTFutCz.d.ts +1 -0
- package/dist/{popover-BfB2I9G0.d.ts → popover-lwkwWcRW.d.ts} +16 -7
- package/dist/popover.d.ts +7 -2
- package/dist/progress.d.ts +27 -10
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +9 -1
- package/dist/query.d.ts +2 -2
- package/dist/query.js +1 -1
- package/dist/radio-group-jj2abc0t.js +1 -0
- package/dist/radio-group-sLz5AA9I.d.ts +27 -0
- package/dist/radio-group.d.ts +20 -99
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +14 -1
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click.d.ts +8 -0
- package/dist/scatter-plot.d.ts +126 -64
- package/dist/scatter-plot.js +1 -1
- package/dist/segmented-control.d.ts +136 -0
- package/dist/segmented-control.js +1 -0
- package/dist/{select-BkhBxtOT.d.ts → select-BqmpVJJT.d.ts} +29 -21
- package/dist/select-C6Su0dU0.js +1 -0
- package/dist/select.d.ts +6 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +13 -2
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-D9AWEkcJ.d.ts → separator-QfH0ot5K.d.ts} +3 -1
- package/dist/separator.d.ts +6 -1
- package/dist/{sheet-CSJc_sB4.js → sheet-Bd2LIhzF.js} +1 -1
- package/dist/sheet.d.ts +15 -2
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +19 -3
- package/dist/sidebar.js +1 -1
- package/dist/skeleton.d.ts +11 -0
- package/dist/skip-to-main-link.d.ts +11 -0
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +10 -0
- package/dist/{slot-C0OCJjdJ.d.ts → slot-D12N_fZJ.d.ts} +3 -1
- package/dist/slot.d.ts +6 -1
- package/dist/split-button.d.ts +14 -3
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +13 -0
- package/dist/switch.d.ts +13 -1
- package/dist/switch.js +1 -1
- package/dist/{table-vT6Okwfa.d.ts → table-rWiVWEgB.d.ts} +79 -0
- package/dist/table.d.ts +6 -1
- package/dist/tabs.d.ts +23 -11
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +11 -1
- package/dist/theme-DdZgLvKH.js +1 -0
- package/dist/theme-switcher.d.ts +16 -2
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +12 -0
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +14 -1
- package/dist/toast.js +1 -1
- package/dist/{tooltip-NcLIeBy5.d.ts → tooltip-CpK3XTor.d.ts} +15 -8
- package/dist/tooltip.d.ts +6 -1
- package/dist/truncated-text.d.ts +27 -13
- package/dist/truncated-text.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/use-inert-siblings-CNmNuS2h.js +1 -0
- package/dist/use-swipe-to-dismiss-i__cTF2v.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +13 -0
- package/dist/well.d.ts +6 -1
- package/package.json +6 -6
- package/src/components/chart/d3-license.md +25 -0
- package/dist/alert-P9lwn25X.js +0 -1
- package/dist/button-Dge0D5bl.js +0 -1
- package/dist/chart-BpWfQAwf.js +0 -2
- package/dist/choice-2Lrv8_nl.js +0 -1
- package/dist/dialog-Dp0QGWwo.d.ts +0 -28
- package/dist/dropdown-menu-BHBzCDSZ.js +0 -1
- package/dist/input-CpQ6jlpI.js +0 -1
- package/dist/popover-C96V8SXi.d.ts +0 -1
- package/dist/select-CAAYk4Yj.js +0 -1
- package/dist/theme-C-glc5Q-.js +0 -1
- package/dist/use-swipe-to-dismiss-DceYk1Id.js +0 -1
package/dist/agent.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrok/mantle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.0",
|
|
4
4
|
"origin": "https://mantle.ngrok.com",
|
|
5
5
|
"endpoints": {
|
|
6
6
|
"docs": "https://mantle.ngrok.com/",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"@ngrok/mantle/sandbar",
|
|
73
73
|
"@ngrok/mantle/sandboxed-on-click",
|
|
74
74
|
"@ngrok/mantle/scatter-plot",
|
|
75
|
+
"@ngrok/mantle/segmented-control",
|
|
75
76
|
"@ngrok/mantle/select",
|
|
76
77
|
"@ngrok/mantle/selectable-list",
|
|
77
78
|
"@ngrok/mantle/separator",
|
|
@@ -112,6 +113,23 @@
|
|
|
112
113
|
"examples": [
|
|
113
114
|
"Composition:\n```\nAccordion.Root\n└── Accordion.Item\n ├── Accordion.Trigger\n │ └── Accordion.TriggerIcon\n └── Accordion.Content\n └── Accordion.Body\n```",
|
|
114
115
|
"<Accordion.Root type=\"single\" defaultValue=\"item-1\">\n <Accordion.Item value=\"item-1\">\n <Accordion.Trigger>\n Is it accessible?\n <Accordion.TriggerIcon />\n </Accordion.Trigger>\n <Accordion.Content>\n <Accordion.Body>Yes. It adheres to the WAI-ARIA disclosure pattern.</Accordion.Body>\n </Accordion.Content>\n </Accordion.Item>\n</Accordion.Root>"
|
|
116
|
+
],
|
|
117
|
+
"siblings": [
|
|
118
|
+
{
|
|
119
|
+
"name": "Tabs",
|
|
120
|
+
"boundary": "one section shows at a time, and a row of tabs switches between them."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "Strata",
|
|
124
|
+
"boundary": "every section stays open, with its title and explanation beside its content."
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"useWhen": "Stack titled sections that each expand and collapse in place, such as questions and answers or a group of advanced settings.",
|
|
128
|
+
"aliases": [
|
|
129
|
+
"collapsible",
|
|
130
|
+
"collapse",
|
|
131
|
+
"disclosure",
|
|
132
|
+
"expansion panel"
|
|
115
133
|
]
|
|
116
134
|
},
|
|
117
135
|
{
|
|
@@ -126,8 +144,32 @@
|
|
|
126
144
|
"summary": "Displays a callout for user attention.",
|
|
127
145
|
"jsdoc": "Displays a callout for user attention.",
|
|
128
146
|
"examples": [
|
|
129
|
-
"Composition:\n```\nAlert.Root\n├── Alert.Icon\n├── Alert.Content\n ├── Alert.Title\n ├── Alert.Description\n ├── Alert.
|
|
130
|
-
"```tsx\n<Alert.Root intent=\"info\">\n <Alert.Icon />\n <Alert.Content>\n <Alert.Title>Alert Title</Alert.Title>\n <Alert.Description>\n Alert description text.\n </Alert.Description>\n <Alert.
|
|
147
|
+
"Composition:\n```\nAlert.Root\n├── Alert.Icon\n├── Alert.Content\n ├── Alert.Title\n ├── Alert.Description\n ├── Alert.ExpandButton\n └── Alert.DismissIconButton\n```",
|
|
148
|
+
"```tsx\n<Alert.Root intent=\"info\">\n <Alert.Icon />\n <Alert.Content>\n <Alert.Title>Alert Title</Alert.Title>\n <Alert.Description>\n Alert description text.\n </Alert.Description>\n <Alert.ExpandButton count={2} expanded={false} />\n <Alert.DismissIconButton />\n </Alert.Content>\n</Alert.Root>\n```"
|
|
149
|
+
],
|
|
150
|
+
"siblings": [
|
|
151
|
+
{
|
|
152
|
+
"name": "Toast",
|
|
153
|
+
"boundary": "the message is brief and goes away on its own."
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "AlertDialog",
|
|
157
|
+
"boundary": "the user must respond before they continue."
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "AlertCenter",
|
|
161
|
+
"boundary": "several account-level alerts share one bar at the top of the app."
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "Empty",
|
|
165
|
+
"boundary": "a region has no data, no results, or no access to show."
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"useWhen": "Show a persistent message in the page, such as a warning, an error, or a success note, beside the content it describes.",
|
|
169
|
+
"aliases": [
|
|
170
|
+
"callout",
|
|
171
|
+
"notice",
|
|
172
|
+
"admonition"
|
|
131
173
|
]
|
|
132
174
|
},
|
|
133
175
|
{
|
|
@@ -144,6 +186,22 @@
|
|
|
144
186
|
"examples": [
|
|
145
187
|
"Composition (items render no DOM in place; their children portal into a\nstable host the bar or a row adopts):\n```\nAlertCenter.Root\n├── AlertCenter.Bar ← the top-ranked item's children, in Alert chrome\n├── AlertCenter.Content ← every other item's children, as ranked rows\n└── AlertCenter.Item (0..n, renderless)\n └── Alert.Icon / Alert.Content / Alert.Title / Alert.Description /\n AlertCenter.DismissIconButton\n```",
|
|
146
188
|
"```tsx\n<AppLayout.Root className=\"fixed inset-0\">\n <AppLayout.Notice>\n {showPreviewNotice && <PreviewNotice />}\n <AlertCenter.Root>\n <AlertCenter.Bar />\n <AlertCenter.Content />\n <AlertCenter.Item id=\"payment-failed\" intent=\"danger\">\n <Alert.Icon />\n <Alert.Content>\n <Alert.Title>\n Payment failed — we couldn't charge your card.{\" \"}\n <a href=\"/billing\">Update payment method</a>\n </Alert.Title>\n <Alert.Description>\n Update your payment method to avoid a service interruption.\n </Alert.Description>\n </Alert.Content>\n </AlertCenter.Item>\n {!dismissed.has(\"transfer-limit\") && (\n <AlertCenter.Item id=\"transfer-limit\" intent=\"warning\">\n <Alert.Icon />\n <Alert.Content>\n <Alert.Title>\n You've used 92% of your monthly transfer.{\" \"}\n <a href=\"/billing/choose-a-plan\">Upgrade</a>\n </Alert.Title>\n <AlertCenter.DismissIconButton onClick={() => dismiss(\"transfer-limit\")} />\n </Alert.Content>\n </AlertCenter.Item>\n )}\n </AlertCenter.Root>\n </AppLayout.Notice>\n <AppLayout.Workspace>…</AppLayout.Workspace>\n</AppLayout.Root>\n```"
|
|
189
|
+
],
|
|
190
|
+
"siblings": [
|
|
191
|
+
{
|
|
192
|
+
"name": "Alert",
|
|
193
|
+
"boundary": "one message sits inline, and you place and control it yourself."
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "Toast",
|
|
197
|
+
"boundary": "the message is brief and goes away on its own."
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"useWhen": "Show persistent account-level alerts, such as usage limits with upgrade actions, in one ranked bar at the top of the app.",
|
|
201
|
+
"aliases": [
|
|
202
|
+
"banner",
|
|
203
|
+
"announcement bar",
|
|
204
|
+
"global banner"
|
|
147
205
|
]
|
|
148
206
|
},
|
|
149
207
|
{
|
|
@@ -160,6 +218,26 @@
|
|
|
160
218
|
"examples": [
|
|
161
219
|
"Composition:\n```\nAlertDialog.Root\n├── AlertDialog.Trigger\n└── AlertDialog.Content\n ├── AlertDialog.Icon\n └── AlertDialog.Body\n ├── AlertDialog.Header\n │ ├── AlertDialog.Title\n │ └── AlertDialog.Description\n └── AlertDialog.Footer\n ├── AlertDialog.Cancel\n └── AlertDialog.Action\n```",
|
|
162
220
|
"```tsx\n<AlertDialog.Root intent=\"danger\">\n <AlertDialog.Trigger asChild>\n <Button type=\"button\" appearance=\"outlined\" intent=\"neutral\">\n Show Danger Alert Dialog\n </Button>\n </AlertDialog.Trigger>\n <AlertDialog.Content>\n <AlertDialog.Icon />\n <AlertDialog.Body>\n <AlertDialog.Header>\n <AlertDialog.Title>\n Are you absolutely sure?\n </AlertDialog.Title>\n <AlertDialog.Description>\n Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n </AlertDialog.Description>\n </AlertDialog.Header>\n <AlertDialog.Footer>\n <AlertDialog.Cancel type=\"button\">Cancel</AlertDialog.Cancel>\n <AlertDialog.Action type=\"button\">\n Continue\n </AlertDialog.Action>\n </AlertDialog.Footer>\n </AlertDialog.Body>\n </AlertDialog.Content>\n</AlertDialog.Root>\n```"
|
|
221
|
+
],
|
|
222
|
+
"siblings": [
|
|
223
|
+
{
|
|
224
|
+
"name": "Dialog",
|
|
225
|
+
"boundary": "a modal window gathers input or confirms a choice that is not destructive."
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "Sheet",
|
|
229
|
+
"boundary": "the content slides in from the edge of the screen, such as a filter panel or a detail view."
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"name": "Sandbar",
|
|
233
|
+
"boundary": "the page holds unsaved changes, and a bar waits for the user to save or discard them."
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
"useWhen": "The user must confirm a destructive or irreversible action, such as a delete or a sign-out, before it runs.",
|
|
237
|
+
"aliases": [
|
|
238
|
+
"confirm",
|
|
239
|
+
"confirmation",
|
|
240
|
+
"confirm dialog"
|
|
163
241
|
]
|
|
164
242
|
},
|
|
165
243
|
{
|
|
@@ -175,6 +253,21 @@
|
|
|
175
253
|
"jsdoc": "A styled hyperlink — a native `<a>` with mantle's link styling, focus treatment, optional leading/trailing icon, and a safer default for the `rel` attribute.",
|
|
176
254
|
"examples": [
|
|
177
255
|
"```tsx\nimport { Anchor } from \"@ngrok/mantle/anchor\";\nimport { BookIcon } from \"@phosphor-icons/react/Book\";\nimport { Link } from \"react-router\";\n\n// Basic external link.\n<Anchor href=\"https://ngrok.com/\">ngrok.com</Anchor>\n\n// External link in a new tab with a leading icon. `rel` defaults to\n// \"noopener noreferrer\" when `target=\"_blank\"`.\n<Anchor href=\"https://ngrok.com/docs\" target=\"_blank\" icon={<BookIcon />}>\n ngrok docs\n</Anchor>\n\n// Compose Anchor styling onto a react-router Link for internal navigation.\n<Anchor asChild>\n <Link to=\"/dashboard\">Open dashboard</Link>\n</Anchor>\n```"
|
|
256
|
+
],
|
|
257
|
+
"siblings": [
|
|
258
|
+
{
|
|
259
|
+
"name": "Button",
|
|
260
|
+
"boundary": "the control runs an action and does not navigate."
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "Breadcrumb",
|
|
264
|
+
"boundary": "the links show the path from a root page to the current page."
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"useWhen": "Link to an address outside the app, such as an external site, a file, or a `mailto:` address.",
|
|
268
|
+
"aliases": [
|
|
269
|
+
"link",
|
|
270
|
+
"hyperlink"
|
|
178
271
|
]
|
|
179
272
|
},
|
|
180
273
|
{
|
|
@@ -190,6 +283,18 @@
|
|
|
190
283
|
"examples": [
|
|
191
284
|
"Composition:\n```\nAppLayout.Root\n├── AppLayout.Notice\n└── AppLayout.SidePanelRoot\n └── AppLayout.Workspace\n ├── AppLayout.Content\n │ ├── AppLayout.Header\n │ │ ├── AppLayout.HeaderStart\n │ │ ├── AppLayout.HeaderContent\n │ │ └── AppLayout.HeaderActions\n │ │ └── AppLayout.SidePanelTrigger\n │ └── AppLayout.Body\n └── AppLayout.SidePanel\n ├── AppLayout.SidePanelHeader\n ├── AppLayout.SidePanelBody\n └── AppLayout.SidePanelFooter\n```",
|
|
192
285
|
"```tsx\n<Sidebar.Root>\n <AppLayout.Root className=\"fixed inset-0\">\n <SkipToMainLink />\n <AppLayout.Notice>{isUnderMaintenance && <MaintenanceBanner />}</AppLayout.Notice>\n <AppLayout.SidePanelRoot>\n <AppLayout.Workspace>\n <Sidebar.Nav aria-label=\"Main\">…</Sidebar.Nav>\n <AppLayout.Content>\n <AppLayout.Header>\n <AppLayout.HeaderStart>\n <Sidebar.Trigger />\n </AppLayout.HeaderStart>\n <AppLayout.HeaderContent>\n <Breadcrumbs />\n </AppLayout.HeaderContent>\n <AppLayout.HeaderActions>\n <AppLayout.SidePanelTrigger icon={<SparkleIcon />} label=\"Toggle the assistant\" />\n </AppLayout.HeaderActions>\n </AppLayout.Header>\n <AppLayout.Body>\n <Outlet />\n </AppLayout.Body>\n </AppLayout.Content>\n <AppLayout.SidePanel aria-label=\"Assistant\">\n <AppLayout.SidePanelHeader>\n <p className=\"text-strong min-w-0 flex-1 truncate text-sm font-medium\">Assistant</p>\n <AppLayout.SidePanelTrigger icon={<XIcon />} label=\"Close the assistant\" />\n </AppLayout.SidePanelHeader>\n <AppLayout.SidePanelBody>\n <AssistantConversation />\n </AppLayout.SidePanelBody>\n <AppLayout.SidePanelFooter>\n <AssistantComposer />\n </AppLayout.SidePanelFooter>\n </AppLayout.SidePanel>\n </AppLayout.Workspace>\n </AppLayout.SidePanelRoot>\n </AppLayout.Root>\n</Sidebar.Root>\n```"
|
|
286
|
+
],
|
|
287
|
+
"siblings": [
|
|
288
|
+
{
|
|
289
|
+
"name": "CenteredLayout",
|
|
290
|
+
"boundary": "the page is one focused flow with no sidebar, such as sign-in, onboarding, or a 404 page."
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
"useWhen": "Frame a signed-in app with navigation that persists across routes: a sidebar, a header toolbar, and one scrolling content card.",
|
|
294
|
+
"aliases": [
|
|
295
|
+
"app shell",
|
|
296
|
+
"application shell",
|
|
297
|
+
"dashboard shell"
|
|
193
298
|
]
|
|
194
299
|
},
|
|
195
300
|
{
|
|
@@ -201,11 +306,26 @@
|
|
|
201
306
|
"importPath": "@ngrok/mantle/area-chart",
|
|
202
307
|
"docsUrl": "https://mantle.ngrok.com/components/charts/area-chart",
|
|
203
308
|
"markdownUrl": "https://mantle.ngrok.com/components/charts/area-chart.md",
|
|
204
|
-
"summary": "
|
|
205
|
-
"jsdoc": "
|
|
309
|
+
"summary": "An area chart for showing how values (and, when stacked, a total and its parts) change over a continuous x axis.",
|
|
310
|
+
"jsdoc": "An area chart for showing how values — and, when stacked, a total and its parts — change over a continuous x axis.",
|
|
206
311
|
"examples": [
|
|
207
|
-
"Composition:\n```\nAreaChart.Root\n├── AreaChart.Grid\n├── AreaChart.XAxis\n├── AreaChart.YAxis\n├── AreaChart.Area (one per series)\n├── AreaChart.ReferenceLine\n├── AreaChart.Tooltip\n├── AreaChart.Legend\n└── AreaChart.CopyButton\n```",
|
|
208
|
-
"```tsx\nconst data = [\n { date: new Date(\"2026-07-15\"), http: 4200, tcp: 1400 },\n { date: new Date(\"2026-07-16\"), http: 5100, tcp: 1650 },\n { date: new Date(\"2026-07-17\"), http: 4700, tcp: 1500 },\n];\n\n<AreaChart.Root data={data} xKey=\"date\" stacked aria-label=\"Traffic by protocol\">\n <AreaChart.Grid />\n <AreaChart.XAxis />\n <AreaChart.YAxis />\n <AreaChart.Area dataKey=\"http\" label=\"HTTP\" />\n <AreaChart.Area dataKey=\"tcp\" label=\"TCP\" />\n <AreaChart.Tooltip />\n <AreaChart.Legend />\n</AreaChart.Root>\n```"
|
|
312
|
+
"Composition:\n```\nAreaChart.Root\n├── AreaChart.Grid\n├── AreaChart.XAxis\n├── AreaChart.YAxis\n├── AreaChart.Area (one per series)\n├── AreaChart.ReferenceLine\n├── AreaChart.Tooltip\n├── AreaChart.Legend\n└── AreaChart.CopyButton\n```\n\nA List groups Roots:\n```\nAreaChart.List\n└── AreaChart.Root (one per chart)\n```",
|
|
313
|
+
"```tsx\nconst data = [\n { date: new Date(\"2026-07-15\"), http: 4200, tcp: 1400 },\n { date: new Date(\"2026-07-16\"), http: 5100, tcp: 1650 },\n { date: new Date(\"2026-07-17\"), http: 4700, tcp: 1500 },\n];\n\n<AreaChart.Root data={data} xKey=\"date\" stacked aria-label=\"Traffic by protocol\">\n <AreaChart.Grid />\n <AreaChart.XAxis />\n <AreaChart.YAxis />\n <AreaChart.Area dataKey=\"http\" label=\"HTTP\" color=\"blue\" />\n <AreaChart.Area dataKey=\"tcp\" label=\"TCP\" color=\"emerald\" />\n <AreaChart.Tooltip />\n <AreaChart.Legend />\n</AreaChart.Root>\n```"
|
|
314
|
+
],
|
|
315
|
+
"siblings": [
|
|
316
|
+
{
|
|
317
|
+
"name": "LineChart",
|
|
318
|
+
"boundary": "the series are trends to compare, and filled areas would hide where they cross."
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "BarChart",
|
|
322
|
+
"boundary": "the reader compares values across categories by bar length from zero."
|
|
323
|
+
}
|
|
324
|
+
],
|
|
325
|
+
"useWhen": "Show how a volume, or a total and its parts, changes across an ordered x axis, such as time.",
|
|
326
|
+
"aliases": [
|
|
327
|
+
"sparkline",
|
|
328
|
+
"area graph"
|
|
209
329
|
]
|
|
210
330
|
},
|
|
211
331
|
{
|
|
@@ -222,6 +342,21 @@
|
|
|
222
342
|
"examples": [
|
|
223
343
|
"Composition:\n```\nAvatar.Root\n├── Avatar.Image\n└── Avatar.Fallback\n```",
|
|
224
344
|
"```tsx\n<Avatar.Root appearance=\"square\" colorSeed=\"acc_123\">\n <Avatar.Image src=\"https://example.com/acme.png\" alt=\"\" />\n <Avatar.Fallback name=\"Acme Corp\" />\n</Avatar.Root>\n```"
|
|
345
|
+
],
|
|
346
|
+
"siblings": [
|
|
347
|
+
{
|
|
348
|
+
"name": "MediaObject",
|
|
349
|
+
"boundary": "the picture sits beside a title and a description."
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"name": "Icon",
|
|
353
|
+
"boundary": "the image is a generic symbol, not a person or an account."
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
"useWhen": "Show a small picture of a person or an account, with initials or an icon when there is no picture.",
|
|
357
|
+
"aliases": [
|
|
358
|
+
"profile picture",
|
|
359
|
+
"profile photo"
|
|
225
360
|
]
|
|
226
361
|
},
|
|
227
362
|
{
|
|
@@ -237,6 +372,27 @@
|
|
|
237
372
|
"jsdoc": "A non-interactive label used to highlight short, scannable information — a status, a category tag, or a count — in the smallest possible footprint.",
|
|
238
373
|
"examples": [
|
|
239
374
|
"```tsx\nimport { Badge } from \"@ngrok/mantle/badge\";\nimport { CheckCircleIcon } from \"@phosphor-icons/react/CheckCircle\";\n\n<Badge appearance=\"muted\" color=\"success\" icon={<CheckCircleIcon />}>\n Succeeded\n</Badge>\n\n// Polymorphic — render the badge as a link, preserving its styling.\n<Badge appearance=\"muted\" color=\"info\" asChild>\n <a href=\"/status\">Operational</a>\n</Badge>\n```"
|
|
375
|
+
],
|
|
376
|
+
"siblings": [
|
|
377
|
+
{
|
|
378
|
+
"name": "Button",
|
|
379
|
+
"boundary": "the label must respond to a click."
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "Kbd",
|
|
383
|
+
"boundary": "the label is a keyboard key or a shortcut."
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"name": "MultiSelect",
|
|
387
|
+
"boundary": "the tags are values that the user picks and removes."
|
|
388
|
+
}
|
|
389
|
+
],
|
|
390
|
+
"useWhen": "Label an item with a short status, a category tag, or a count.",
|
|
391
|
+
"aliases": [
|
|
392
|
+
"tag",
|
|
393
|
+
"chip",
|
|
394
|
+
"pill",
|
|
395
|
+
"lozenge"
|
|
240
396
|
]
|
|
241
397
|
},
|
|
242
398
|
{
|
|
@@ -248,11 +404,28 @@
|
|
|
248
404
|
"importPath": "@ngrok/mantle/bar-chart",
|
|
249
405
|
"docsUrl": "https://mantle.ngrok.com/components/charts/bar-chart",
|
|
250
406
|
"markdownUrl": "https://mantle.ngrok.com/components/charts/bar-chart.md",
|
|
251
|
-
"summary": "A
|
|
252
|
-
"jsdoc": "A
|
|
407
|
+
"summary": "A bar chart for comparing values across categories, with grouped and stacked variants.",
|
|
408
|
+
"jsdoc": "A bar chart for comparing values across categories, with grouped and stacked variants.",
|
|
253
409
|
"examples": [
|
|
254
|
-
"Composition:\n```\nBarChart.Root\n├── BarChart.Grid\n├── BarChart.XAxis\n├── BarChart.YAxis\n├── BarChart.Bar (one per series)\n├── BarChart.ReferenceLine\n├── BarChart.Tooltip\n├── BarChart.Legend\n└── BarChart.CopyButton\n```",
|
|
255
|
-
"```tsx\nconst data = [\n { month: \"January\", desktop: 186, mobile: 80 },\n { month: \"February\", desktop: 305, mobile: 200 },\n { month: \"March\", desktop: 237, mobile: 120 },\n];\n\n<BarChart.Root data={data} xKey=\"month\" aria-label=\"Visitors by month\">\n <BarChart.Grid />\n <BarChart.XAxis />\n <BarChart.YAxis />\n <BarChart.Bar dataKey=\"desktop\" label=\"Desktop\" />\n <BarChart.Bar dataKey=\"mobile\" label=\"Mobile\" />\n <BarChart.Tooltip />\n <BarChart.Legend />\n</BarChart.Root>\n```"
|
|
410
|
+
"Composition:\n```\nBarChart.Root\n├── BarChart.Grid\n├── BarChart.XAxis\n├── BarChart.YAxis\n├── BarChart.Bar (one per series)\n├── BarChart.ReferenceLine\n├── BarChart.Tooltip\n├── BarChart.Legend\n└── BarChart.CopyButton\n```\n\nA List groups Roots:\n```\nBarChart.List\n└── BarChart.Root (one per chart)\n```",
|
|
411
|
+
"```tsx\nconst data = [\n { month: \"January\", desktop: 186, mobile: 80 },\n { month: \"February\", desktop: 305, mobile: 200 },\n { month: \"March\", desktop: 237, mobile: 120 },\n];\n\n<BarChart.Root data={data} xKey=\"month\" aria-label=\"Visitors by month\">\n <BarChart.Grid />\n <BarChart.XAxis />\n <BarChart.YAxis />\n <BarChart.Bar dataKey=\"desktop\" label=\"Desktop\" color=\"blue\" />\n <BarChart.Bar dataKey=\"mobile\" label=\"Mobile\" color=\"emerald\" />\n <BarChart.Tooltip />\n <BarChart.Legend />\n</BarChart.Root>\n```"
|
|
412
|
+
],
|
|
413
|
+
"siblings": [
|
|
414
|
+
{
|
|
415
|
+
"name": "LineChart",
|
|
416
|
+
"boundary": "the chart shows a trend across an ordered x axis, such as time."
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"name": "AreaChart",
|
|
420
|
+
"boundary": "a total and its parts change across an ordered x axis, such as time."
|
|
421
|
+
}
|
|
422
|
+
],
|
|
423
|
+
"useWhen": "Compare values across categories, with grouped or stacked bars.",
|
|
424
|
+
"aliases": [
|
|
425
|
+
"sparkline",
|
|
426
|
+
"bar graph",
|
|
427
|
+
"column chart",
|
|
428
|
+
"histogram"
|
|
256
429
|
]
|
|
257
430
|
},
|
|
258
431
|
{
|
|
@@ -269,6 +442,21 @@
|
|
|
269
442
|
"examples": [
|
|
270
443
|
"Composition:\n```\nBreadcrumb.Root\n└── Breadcrumb.List\n ├── Breadcrumb.Item\n │ └── Breadcrumb.Link\n ├── Breadcrumb.Separator\n ├── Breadcrumb.Item\n │ └── Breadcrumb.Label\n ├── Breadcrumb.Separator\n ├── Breadcrumb.Item\n │ └── Breadcrumb.Page\n └── Breadcrumb.Skeleton\n```",
|
|
271
444
|
"```tsx\n<Breadcrumb.Root>\n\t<Breadcrumb.List>\n\t\t<Breadcrumb.Item>\n\t\t\t<Breadcrumb.Link href=\"/\">Home</Breadcrumb.Link>\n\t\t</Breadcrumb.Item>\n\t\t<Breadcrumb.Separator />\n\t\t<Breadcrumb.Item>\n\t\t\t<Breadcrumb.Link href=\"/endpoints\">Endpoints</Breadcrumb.Link>\n\t\t</Breadcrumb.Item>\n\t\t<Breadcrumb.Separator />\n\t\t<Breadcrumb.Item>\n\t\t\t<Breadcrumb.Page>ep_2h8…</Breadcrumb.Page>\n\t\t</Breadcrumb.Item>\n\t</Breadcrumb.List>\n</Breadcrumb.Root>\n```"
|
|
445
|
+
],
|
|
446
|
+
"siblings": [
|
|
447
|
+
{
|
|
448
|
+
"name": "Tabs",
|
|
449
|
+
"boundary": "the user switches between peer views of one page."
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "Sidebar",
|
|
453
|
+
"boundary": "the app needs persistent navigation to its top-level pages."
|
|
454
|
+
}
|
|
455
|
+
],
|
|
456
|
+
"useWhen": "Show where the current page sits in a hierarchy, as a trail of links from a root page.",
|
|
457
|
+
"aliases": [
|
|
458
|
+
"breadcrumbs",
|
|
459
|
+
"crumbs"
|
|
272
460
|
]
|
|
273
461
|
},
|
|
274
462
|
{
|
|
@@ -284,6 +472,11 @@
|
|
|
284
472
|
"jsdoc": "A wrapper component that renders its children in the browser only, after hydration completes.",
|
|
285
473
|
"examples": [
|
|
286
474
|
"```tsx\n<BrowserOnly fallback={<div style={{ height: 200 }} />} >\n {() => <ExpensiveChart />}\n</BrowserOnly>\n```"
|
|
475
|
+
],
|
|
476
|
+
"useWhen": "Render children in the browser only, after hydration, when they read browser state such as `window` or `localStorage`.",
|
|
477
|
+
"aliases": [
|
|
478
|
+
"client only",
|
|
479
|
+
"no ssr"
|
|
287
480
|
]
|
|
288
481
|
},
|
|
289
482
|
{
|
|
@@ -304,6 +497,25 @@
|
|
|
304
497
|
"Gate the button on readiness and on a pending action. An explicit `disabled`\nwins over `isLoading`, so `disabled` must cover both:\n```tsx\n<Button\n type=\"submit\"\n appearance=\"filled\"\n intent=\"neutral\"\n isLoading={isPending}\n disabled={!isReady || isPending}\n>\n Save\n</Button>\n```",
|
|
305
498
|
"A button-styled link wraps a plain `<a>`, not `Anchor`:\n```tsx\n<Button asChild appearance=\"outlined\" intent=\"neutral\" icon={<ArrowSquareOutIcon />} iconPlacement=\"end\">\n <a href=\"https://ngrok.com/docs\" target=\"_blank\" rel=\"noreferrer\">\n Read the docs\n </a>\n</Button>\n```",
|
|
306
499
|
"Icon-only buttons are not `Button`s — use `IconButton` instead (an icon-only\n`Button` has no accessible name and keeps its text-box padding):\n```tsx\n// ❌ <Button appearance=\"outlined\" intent=\"neutral\" icon={<CopyIcon />} onClick={copyPage} />\n<IconButton appearance=\"outlined\" intent=\"neutral\" icon={<CopyIcon />} label=\"Copy page\" onClick={copyPage} />\n```"
|
|
500
|
+
],
|
|
501
|
+
"siblings": [
|
|
502
|
+
{
|
|
503
|
+
"name": "IconButton",
|
|
504
|
+
"boundary": "the button shows one icon and no text."
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"name": "SplitButton",
|
|
508
|
+
"boundary": "a default action sits beside a menu of related actions."
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"name": "Anchor",
|
|
512
|
+
"boundary": "the control goes to another address and runs no action."
|
|
513
|
+
}
|
|
514
|
+
],
|
|
515
|
+
"useWhen": "Run an action on a click: submit a form, save a change, or open a dialog.",
|
|
516
|
+
"aliases": [
|
|
517
|
+
"cta",
|
|
518
|
+
"call to action"
|
|
307
519
|
]
|
|
308
520
|
},
|
|
309
521
|
{
|
|
@@ -319,6 +531,12 @@
|
|
|
319
531
|
"jsdoc": "A calendar component that allows users to select a date or a range of dates.",
|
|
320
532
|
"examples": [
|
|
321
533
|
"```tsx\n<Calendar\n mode=\"single\"\n selected={selectedDate}\n onSelect={setSelectedDate}\n/>\n\n<Calendar\n mode=\"range\"\n selected={dateRange}\n onSelect={setDateRange}\n/>\n```"
|
|
534
|
+
],
|
|
535
|
+
"useWhen": "Pick one date or a range of dates from a month grid.",
|
|
536
|
+
"aliases": [
|
|
537
|
+
"date picker",
|
|
538
|
+
"datepicker",
|
|
539
|
+
"date range picker"
|
|
322
540
|
]
|
|
323
541
|
},
|
|
324
542
|
{
|
|
@@ -350,7 +568,12 @@
|
|
|
350
568
|
"boundary": "an icon or a figure sits beside a block of text, with no border."
|
|
351
569
|
}
|
|
352
570
|
],
|
|
353
|
-
"useWhen": "Group related content in a raised box, with an optional header and footer."
|
|
571
|
+
"useWhen": "Group related content in a raised box, with an optional header and footer.",
|
|
572
|
+
"aliases": [
|
|
573
|
+
"panel",
|
|
574
|
+
"tile",
|
|
575
|
+
"paper"
|
|
576
|
+
]
|
|
354
577
|
},
|
|
355
578
|
{
|
|
356
579
|
"name": "Centered Layout",
|
|
@@ -365,6 +588,18 @@
|
|
|
365
588
|
"examples": [
|
|
366
589
|
"Composition:\n```\nCenteredLayout.Root\n├── CenteredLayout.Notice\n├── CenteredLayout.Header\n├── CenteredLayout.Body\n└── CenteredLayout.Footer\n```",
|
|
367
590
|
"```tsx\n<CenteredLayout.Root>\n <SkipToMainLink />\n <CenteredLayout.Body>\n <a href=\"https://ngrok.com\">\n <NgrokWordmarkIcon className=\"h-auto w-24\" />\n </a>\n <Main>\n <SignInCard />\n </Main>\n </CenteredLayout.Body>\n <CenteredLayout.Footer>\n <ThemeSwitcher />\n </CenteredLayout.Footer>\n</CenteredLayout.Root>\n```"
|
|
591
|
+
],
|
|
592
|
+
"siblings": [
|
|
593
|
+
{
|
|
594
|
+
"name": "AppLayout",
|
|
595
|
+
"boundary": "the page sits in a signed-in app, with a sidebar and a header that persist across routes."
|
|
596
|
+
}
|
|
597
|
+
],
|
|
598
|
+
"useWhen": "Center one focused full-page flow, such as sign-in, sign-up, onboarding, checkout, or a 404 page.",
|
|
599
|
+
"aliases": [
|
|
600
|
+
"auth page",
|
|
601
|
+
"login page",
|
|
602
|
+
"sign in page"
|
|
368
603
|
]
|
|
369
604
|
},
|
|
370
605
|
{
|
|
@@ -380,6 +615,25 @@
|
|
|
380
615
|
"jsdoc": "A form control that allows the user to toggle between checked and not checked.",
|
|
381
616
|
"examples": [
|
|
382
617
|
"```tsx\n<form>\n <Label htmlFor=\"terms\" className=\"flex items-center gap-2\">\n <Checkbox name=\"terms\" id=\"terms\" />\n Accept terms and conditions\n </Label>\n</form>\n```"
|
|
618
|
+
],
|
|
619
|
+
"siblings": [
|
|
620
|
+
{
|
|
621
|
+
"name": "Switch",
|
|
622
|
+
"boundary": "one setting turns on or off and needs no indeterminate state."
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"name": "RadioGroup",
|
|
626
|
+
"boundary": "the user picks exactly one option from a set."
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"name": "Choice",
|
|
630
|
+
"boundary": "the checkbox needs a title and a description beside it."
|
|
631
|
+
}
|
|
632
|
+
],
|
|
633
|
+
"useWhen": "Turn one or more independent options on or off in a form, with an indeterminate state for a partial selection.",
|
|
634
|
+
"aliases": [
|
|
635
|
+
"check box",
|
|
636
|
+
"tickbox"
|
|
383
637
|
]
|
|
384
638
|
},
|
|
385
639
|
{
|
|
@@ -396,6 +650,22 @@
|
|
|
396
650
|
"examples": [
|
|
397
651
|
"Composition:\n```\nChoice.Root\n├── Choice.Indicator\n└── Choice.Content\n ├── Choice.Label (or Choice.Title — pick one)\n └── Choice.Description\n```",
|
|
398
652
|
"```tsx\n<Choice.Root name=\"notify\">\n <Choice.Indicator>\n <Checkbox />\n </Choice.Indicator>\n <Choice.Content>\n <Choice.Label>Email</Choice.Label>\n <Choice.Description>Get notified by email.</Choice.Description>\n </Choice.Content>\n</Choice.Root>\n```"
|
|
653
|
+
],
|
|
654
|
+
"siblings": [
|
|
655
|
+
{
|
|
656
|
+
"name": "Label",
|
|
657
|
+
"boundary": "the control needs only a one-line caption."
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"name": "MediaObject",
|
|
661
|
+
"boundary": "the thing beside the text is an image or an icon, not a control."
|
|
662
|
+
}
|
|
663
|
+
],
|
|
664
|
+
"useWhen": "Put a checkbox, a radio, or a switch beside a title and an optional description.",
|
|
665
|
+
"aliases": [
|
|
666
|
+
"checkbox with description",
|
|
667
|
+
"radio with description",
|
|
668
|
+
"switch with description"
|
|
399
669
|
]
|
|
400
670
|
},
|
|
401
671
|
{
|
|
@@ -411,6 +681,25 @@
|
|
|
411
681
|
"jsdoc": "Marks a short fragment of inline computer code — a function name, a variable, a CLI flag, a key.",
|
|
412
682
|
"examples": [
|
|
413
683
|
"```tsx\nimport { Code } from \"@ngrok/mantle/code\";\n\n<p>\n Use the <Code>console.log()</Code> function to debug your code.\n</p>\n\n// As a link, preserving Code styling.\n<Code asChild>\n <a href=\"/api\">/api/components.json</a>\n</Code>\n```"
|
|
684
|
+
],
|
|
685
|
+
"siblings": [
|
|
686
|
+
{
|
|
687
|
+
"name": "CodeBlock",
|
|
688
|
+
"boundary": "the code spans several lines or needs syntax highlighting."
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"name": "Kbd",
|
|
692
|
+
"boundary": "the text is a keyboard key or a shortcut."
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"name": "TruncatedText",
|
|
696
|
+
"boundary": "the value is long and opaque, such as a URL or an ID, and can overflow its row."
|
|
697
|
+
}
|
|
698
|
+
],
|
|
699
|
+
"useWhen": "Mark a short fragment of code inside a sentence, such as a function name, a file path, or a key.",
|
|
700
|
+
"aliases": [
|
|
701
|
+
"inline code",
|
|
702
|
+
"monospace"
|
|
414
703
|
]
|
|
415
704
|
},
|
|
416
705
|
{
|
|
@@ -427,6 +716,22 @@
|
|
|
427
716
|
"examples": [
|
|
428
717
|
"Composition:\n```\n# Standard\nCodeBlock.Root\n├── CodeBlock.Header\n│ ├── CodeBlock.Icon\n│ └── CodeBlock.Title\n├── CodeBlock.Body\n│ ├── CodeBlock.CopyButton\n│ └── CodeBlock.Code\n└── CodeBlock.ExpanderButton\n\n# Tabbed\nCodeBlock.Root\n├── CodeBlock.Header\n│ └── CodeBlock.TabList\n│ └── CodeBlock.TabTrigger\n├── CodeBlock.Body\n│ ├── CodeBlock.CopyButton\n│ └── CodeBlock.TabContent\n│ └── CodeBlock.Code\n└── CodeBlock.ExpanderButton\n```",
|
|
429
718
|
"```tsx\n<CodeBlock.Root>\n <CodeBlock.Header>\n <CodeBlock.Icon preset=\"file\" />\n <CodeBlock.Title>example.ts</CodeBlock.Title>\n </CodeBlock.Header>\n <CodeBlock.Body>\n <CodeBlock.CopyButton />\n <CodeBlock.Code value={mantleCode(\"typescript\")`const x = \"hello\";`} />\n </CodeBlock.Body>\n <CodeBlock.ExpanderButton />\n</CodeBlock.Root>\n\n// Server-highlighted HTML fetched via an action route + React Query mutation\nconst highlightMutation = useMutation({\n mutationFn: async () => {\n const response = await fetch(\"/api/shiki-highlight\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ code: source, language: \"typescript\" }),\n });\n return response.json();\n },\n});\n\nconst serverValue = createMantleCodeBlockValue({\n language: \"typescript\",\n code: source,\n preHtml: highlightMutation.data?.html,\n});\n```"
|
|
719
|
+
],
|
|
720
|
+
"siblings": [
|
|
721
|
+
{
|
|
722
|
+
"name": "Code",
|
|
723
|
+
"boundary": "the code is a short fragment inside a sentence."
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"name": "TruncatedText",
|
|
727
|
+
"boundary": "one long opaque value must stay on one line."
|
|
728
|
+
}
|
|
729
|
+
],
|
|
730
|
+
"useWhen": "Show a block of code with syntax highlighting and a copy button.",
|
|
731
|
+
"aliases": [
|
|
732
|
+
"syntax highlighter",
|
|
733
|
+
"code snippet",
|
|
734
|
+
"code sample"
|
|
430
735
|
]
|
|
431
736
|
},
|
|
432
737
|
{
|
|
@@ -444,9 +749,30 @@
|
|
|
444
749
|
"Composition:\n```\nCombobox.Root\n├── Combobox.Input\n└── Combobox.Content\n ├── Combobox.Group\n │ ├── Combobox.GroupLabel\n │ └── Combobox.Item\n │ └── Combobox.ItemValue\n └── Combobox.Separator\n```",
|
|
445
750
|
"```tsx\n<Combobox.Root>\n <Combobox.Input />\n <Combobox.Content>\n <Combobox.Item value=\"Apple\" />\n <Combobox.Item value=\"Banana\" />\n </Combobox.Content>\n</Combobox.Root>\n```"
|
|
446
751
|
],
|
|
752
|
+
"siblings": [
|
|
753
|
+
{
|
|
754
|
+
"name": "Select",
|
|
755
|
+
"boundary": "the list is short and needs no filter."
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"name": "MultiSelect",
|
|
759
|
+
"boundary": "the user picks several values, shown as tags."
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "Command",
|
|
763
|
+
"boundary": "the list runs actions or goes to pages, in a palette."
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"name": "Query",
|
|
767
|
+
"boundary": "the field filters a list with free text and `key:value` qualifiers."
|
|
768
|
+
}
|
|
769
|
+
],
|
|
770
|
+
"useWhen": "Pick one value from a long list of options, with a text field that filters the options as the user types.",
|
|
447
771
|
"aliases": [
|
|
448
772
|
"autocomplete",
|
|
449
|
-
"typeahead"
|
|
773
|
+
"typeahead",
|
|
774
|
+
"searchable select",
|
|
775
|
+
"autosuggest"
|
|
450
776
|
]
|
|
451
777
|
},
|
|
452
778
|
{
|
|
@@ -463,6 +789,23 @@
|
|
|
463
789
|
"examples": [
|
|
464
790
|
"Composition:\n```\nCommand.DialogRoot\n├── Command.SearchTrigger\n├── Command.DialogTrigger\n└── Command.DialogContent\n ├── Command.Input\n └── Command.List\n ├── Command.Empty\n ├── Command.Group\n │ └── Command.Item\n │ └── Command.Shortcut\n └── Command.Separator\n```",
|
|
465
791
|
"```tsx\n<Command.DialogRoot>\n <Command.SearchTrigger>\n <button type=\"button\">Search…</button>\n </Command.SearchTrigger>\n <Command.DialogContent>\n <Command.Input placeholder=\"Type a command or search...\" />\n <Command.List>\n <Command.Empty>No results found.</Command.Empty>\n <Command.Group heading=\"Suggestions\">\n <Command.Item>\n <span>Calendar</span>\n </Command.Item>\n </Command.Group>\n <Command.Separator />\n <Command.Group heading=\"Settings\">\n <Command.Item>\n <span>Profile</span>\n <Command.Shortcut>⌘,</Command.Shortcut>\n </Command.Item>\n </Command.Group>\n </Command.List>\n </Command.DialogContent>\n</Command.DialogRoot>\n```"
|
|
792
|
+
],
|
|
793
|
+
"siblings": [
|
|
794
|
+
{
|
|
795
|
+
"name": "Combobox",
|
|
796
|
+
"boundary": "the text field filters options in place and sets a form value."
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
"name": "DropdownMenu",
|
|
800
|
+
"boundary": "a short list of actions opens from one button."
|
|
801
|
+
}
|
|
802
|
+
],
|
|
803
|
+
"useWhen": "Search for an action or a page and run it from a keyboard-first palette, such as a `⌘K` menu.",
|
|
804
|
+
"aliases": [
|
|
805
|
+
"command palette",
|
|
806
|
+
"command menu",
|
|
807
|
+
"cmdk",
|
|
808
|
+
"spotlight"
|
|
466
809
|
]
|
|
467
810
|
},
|
|
468
811
|
{
|
|
@@ -479,9 +822,26 @@
|
|
|
479
822
|
"examples": [
|
|
480
823
|
"Composition:\n```\nDataTable.Root\n├── DataTable.Head\n│ └── DataTable.Row\n│ ├── DataTable.ExpandHeader\n│ ├── DataTable.Header\n│ │ └── DataTable.HeaderSortButton\n│ └── DataTable.ActionHeader\n└── DataTable.Body\n ├── DataTable.Row\n │ ├── DataTable.ControlCell\n │ │ └── DataTable.RowExpandButton\n │ ├── DataTable.Cell\n │ └── DataTable.ActionCell\n ├── DataTable.ExpandedRow\n └── DataTable.EmptyRow\n```",
|
|
481
824
|
"Minimal — read-only table with a single sortable column:\n```tsx\nimport {\n DataTable,\n createColumnHelper,\n createSortedRowModel,\n rowSortingFeature,\n sortFn_alphanumeric,\n sortFn_datetime,\n sortFn_text,\n tableFeatures,\n useTable,\n} from \"@ngrok/mantle/data-table\";\n\ntype Row = { id: string; name: string };\n\n// Register only the features the table uses. Auto-sort resolves the\n// `alphanumeric`, `text`, and `datetime` comparators by name, so register those three.\nconst features = tableFeatures({\n rowSortingFeature,\n sortedRowModel: createSortedRowModel(),\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n datetime: sortFn_datetime,\n text: sortFn_text,\n },\n});\n\nconst columnHelper = createColumnHelper<typeof features, Row>();\nconst columns = columnHelper.columns([\n columnHelper.accessor(\"name\", {\n id: \"name\",\n header: (props) => (\n <DataTable.Header column={props.column}>\n <DataTable.HeaderSortButton column={props.column} sortingMode=\"alphanumeric\">\n Name\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,\n }),\n]);\n\nfunction MyTable({ data }: { data: Row[] }) {\n const table = useTable({ features, data, columns });\n const rows = table.getRowModel().rows;\n\n return (\n <DataTable.Root table={table}>\n <DataTable.Head />\n <DataTable.Body>\n {rows.length > 0\n ? rows.map((row) => <DataTable.Row key={row.id} row={row} />)\n : <DataTable.EmptyRow>No results.</DataTable.EmptyRow>}\n </DataTable.Body>\n </DataTable.Root>\n );\n}\n```",
|
|
482
|
-
"Sortable, filterable, paginated, with both empty states — a global text\nfilter, the no-data vs. no-results-for-filter empty states (an `Empty`\ndropped into `DataTable.EmptyRow`), and `CursorPagination` with a page-size\ndropdown:\n```tsx\nimport {\n DataTable,\n columnFilteringFeature,\n createColumnHelper,\n createFilteredRowModel,\n createPaginatedRowModel,\n createSortedRowModel,\n globalFilteringFeature,\n rowPaginationFeature,\n rowSortingFeature,\n sortFn_alphanumeric,\n sortFn_datetime,\n sortFn_text,\n tableFeatures,\n useTable,\n} from \"@ngrok/mantle/data-table\";\nimport { Button } from \"@ngrok/mantle/button\";\nimport { CursorPagination } from \"@ngrok/mantle/pagination\";\nimport { Empty } from \"@ngrok/mantle/empty\";\nimport { Input } from \"@ngrok/mantle/input\";\nimport { MagnifyingGlassIcon } from \"@phosphor-icons/react/MagnifyingGlass\";\nimport { TrayIcon } from \"@phosphor-icons/react/Tray\";\nimport { useState } from \"react\";\n\ntype Payment = { id: string; amount: number; status: \"pending\" | \"succeeded\" | \"failed\"; email: string };\n\n// The table's initial page size. It must be one of PageSizeSelect's pageSizes\n// (default 5 | 10 | 20 | 50 | 100).\nconst DEFAULT_PAGE_SIZE = 10;\n\n// `globalFilteringFeature` builds on `columnFilteringFeature`, so register both.\nconst features = tableFeatures({\n columnFilteringFeature,\n globalFilteringFeature,\n rowPaginationFeature,\n rowSortingFeature,\n filteredRowModel: createFilteredRowModel(),\n paginatedRowModel: createPaginatedRowModel(),\n sortedRowModel: createSortedRowModel(),\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n datetime: sortFn_datetime,\n text: sortFn_text,\n },\n});\n\nconst columnHelper = createColumnHelper<typeof features, Payment>();\nconst columns = columnHelper.columns([\n columnHelper.accessor(\"status\", {\n id: \"status\",\n header: (props) => (\n <DataTable.Header column={props.column}>\n <DataTable.HeaderSortButton column={props.column} sortingMode=\"alphanumeric\">\n Status\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,\n }),\n columnHelper.accessor(\"email\", {\n id: \"email\",\n header: (props) => (\n <DataTable.Header column={props.column}>\n <DataTable.HeaderSortButton column={props.column} sortingMode=\"alphanumeric\">\n Email\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,\n }),\n columnHelper.accessor(\"amount\", {\n id: \"amount\",\n header: (props) => (\n <DataTable.Header className=\"text-right\">\n <DataTable.HeaderSortButton\n column={props.column}\n sortingMode=\"alphanumeric\"\n className=\"justify-end\"\n iconPlacement=\"start\"\n >\n Amount\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => (\n <DataTable.Cell className=\"text-right tabular-nums\">\n {new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" }).format(props.getValue())}\n </DataTable.Cell>\n ),\n }),\n]);\n\nfunction PaymentsTable({ data }: { data: Payment[] }) {\n const [globalFilter, setGlobalFilter] = useState(\"\");\n\n const table = useTable({\n features,\n data,\n columns,\n state: { globalFilter },\n onGlobalFilterChange: setGlobalFilter,\n initialState: { pagination: { pageIndex: 0, pageSize: DEFAULT_PAGE_SIZE } },\n });\n const rows = table.getRowModel().rows;\n const isFiltered = globalFilter.trim() !== \"\";\n\n return (\n <div className=\"space-y-4\">\n <Input\n placeholder=\"Filter payments…\"\n value={globalFilter}\n onChange={(event) => setGlobalFilter(event.target.value)}\n />\n <DataTable.Root table={table}>\n <DataTable.Head />\n <DataTable.Body>\n {rows.length > 0 ? (\n rows.map((row) => <DataTable.Row key={row.id} row={row} />)\n ) : isFiltered ? (\n // No results for the active filter — give the user a way out.\n <DataTable.EmptyRow>\n <Empty.Root>\n <Empty.Icon svg={<MagnifyingGlassIcon />} />\n <Empty.Title>No payments match your filter</Empty.Title>\n <Empty.Description>\n <p>Try a different search, or clear the filter to see everything.</p>\n </Empty.Description>\n <Empty.Actions>\n <Button\n type=\"button\"\n appearance=\"outlined\"\n intent=\"neutral\"\n onClick={() => setGlobalFilter(\"\")}\n >\n Clear filters\n </Button>\n </Empty.Actions>\n </Empty.Root>\n </DataTable.EmptyRow>\n ) : (\n // No data yet — informational, optionally a primary \"create\" action.\n <DataTable.EmptyRow>\n <Empty.Root>\n <Empty.Icon svg={<TrayIcon />} />\n <Empty.Title>No payments yet</Empty.Title>\n <Empty.Description>\n <p>Payments you receive will appear here.</p>\n </Empty.Description>\n </Empty.Root>\n </DataTable.EmptyRow>\n )}\n </DataTable.Body>\n </DataTable.Root>\n <CursorPagination.Root\n className=\"flex justify-
|
|
825
|
+
"Sortable, filterable, paginated, with both empty states — a global text\nfilter, the no-data vs. no-results-for-filter empty states (an `Empty`\ndropped into `DataTable.EmptyRow`), and `CursorPagination` with a page-size\ndropdown:\n```tsx\nimport {\n DataTable,\n columnFilteringFeature,\n createColumnHelper,\n createFilteredRowModel,\n createPaginatedRowModel,\n createSortedRowModel,\n globalFilteringFeature,\n rowPaginationFeature,\n rowSortingFeature,\n sortFn_alphanumeric,\n sortFn_datetime,\n sortFn_text,\n tableFeatures,\n useTable,\n} from \"@ngrok/mantle/data-table\";\nimport { Button } from \"@ngrok/mantle/button\";\nimport { CursorPagination, PaginationRange } from \"@ngrok/mantle/pagination\";\nimport { Empty } from \"@ngrok/mantle/empty\";\nimport { Input } from \"@ngrok/mantle/input\";\nimport { MagnifyingGlassIcon } from \"@phosphor-icons/react/MagnifyingGlass\";\nimport { TrayIcon } from \"@phosphor-icons/react/Tray\";\nimport { useState } from \"react\";\n\ntype Payment = { id: string; amount: number; status: \"pending\" | \"succeeded\" | \"failed\"; email: string };\n\n// The table's initial page size. It must be one of PageSizeSelect's pageSizes\n// (default 5 | 10 | 20 | 50 | 100).\nconst DEFAULT_PAGE_SIZE = 10;\n\n// `globalFilteringFeature` builds on `columnFilteringFeature`, so register both.\nconst features = tableFeatures({\n columnFilteringFeature,\n globalFilteringFeature,\n rowPaginationFeature,\n rowSortingFeature,\n filteredRowModel: createFilteredRowModel(),\n paginatedRowModel: createPaginatedRowModel(),\n sortedRowModel: createSortedRowModel(),\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n datetime: sortFn_datetime,\n text: sortFn_text,\n },\n});\n\nconst columnHelper = createColumnHelper<typeof features, Payment>();\nconst columns = columnHelper.columns([\n columnHelper.accessor(\"status\", {\n id: \"status\",\n header: (props) => (\n <DataTable.Header column={props.column}>\n <DataTable.HeaderSortButton column={props.column} sortingMode=\"alphanumeric\">\n Status\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,\n }),\n columnHelper.accessor(\"email\", {\n id: \"email\",\n header: (props) => (\n <DataTable.Header column={props.column}>\n <DataTable.HeaderSortButton column={props.column} sortingMode=\"alphanumeric\">\n Email\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,\n }),\n columnHelper.accessor(\"amount\", {\n id: \"amount\",\n header: (props) => (\n <DataTable.Header className=\"text-right\">\n <DataTable.HeaderSortButton\n column={props.column}\n sortingMode=\"alphanumeric\"\n className=\"justify-end\"\n iconPlacement=\"start\"\n >\n Amount\n </DataTable.HeaderSortButton>\n </DataTable.Header>\n ),\n cell: (props) => (\n <DataTable.Cell className=\"text-right tabular-nums\">\n {new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" }).format(props.getValue())}\n </DataTable.Cell>\n ),\n }),\n]);\n\nfunction PaymentsTable({ data }: { data: Payment[] }) {\n const [globalFilter, setGlobalFilter] = useState(\"\");\n\n const table = useTable({\n features,\n data,\n columns,\n state: { globalFilter },\n onGlobalFilterChange: setGlobalFilter,\n initialState: { pagination: { pageIndex: 0, pageSize: DEFAULT_PAGE_SIZE } },\n });\n const rows = table.getRowModel().rows;\n const isFiltered = globalFilter.trim() !== \"\";\n\n return (\n <div className=\"space-y-4\">\n <Input\n placeholder=\"Filter payments…\"\n value={globalFilter}\n onChange={(event) => setGlobalFilter(event.target.value)}\n />\n <DataTable.Root table={table}>\n <DataTable.Head />\n <DataTable.Body>\n {rows.length > 0 ? (\n rows.map((row) => <DataTable.Row key={row.id} row={row} />)\n ) : isFiltered ? (\n // No results for the active filter — give the user a way out.\n <DataTable.EmptyRow>\n <Empty.Root>\n <Empty.Icon svg={<MagnifyingGlassIcon />} />\n <Empty.Title>No payments match your filter</Empty.Title>\n <Empty.Description>\n <p>Try a different search, or clear the filter to see everything.</p>\n </Empty.Description>\n <Empty.Actions>\n <Button\n type=\"button\"\n appearance=\"outlined\"\n intent=\"neutral\"\n onClick={() => setGlobalFilter(\"\")}\n >\n Clear filters\n </Button>\n </Empty.Actions>\n </Empty.Root>\n </DataTable.EmptyRow>\n ) : (\n // No data yet — informational, optionally a primary \"create\" action.\n <DataTable.EmptyRow>\n <Empty.Root>\n <Empty.Icon svg={<TrayIcon />} />\n <Empty.Title>No payments yet</Empty.Title>\n <Empty.Description>\n <p>Payments you receive will appear here.</p>\n </Empty.Description>\n </Empty.Root>\n </DataTable.EmptyRow>\n )}\n </DataTable.Body>\n </DataTable.Root>\n <CursorPagination.Root\n className=\"flex flex-wrap justify-between\"\n pageSize={table.state.pagination.pageSize}\n onChangePageSize={(size) => {\n table.setPageSize(size);\n table.setPageIndex(0); // reset to the first page when the size changes\n }}\n >\n <PaginationRange\n offset={table.state.pagination.pageIndex * table.state.pagination.pageSize}\n pageSize={table.state.pagination.pageSize}\n total={table.getRowCount()}\n noun={{ singular: \"payment\", plural: \"payments\" }}\n />\n <div className=\"flex items-center gap-2\">\n <CursorPagination.PageSizeSelect />\n <CursorPagination.Buttons\n hasPreviousPage={table.getCanPreviousPage()}\n hasNextPage={table.getCanNextPage()}\n onPreviousPage={() => table.previousPage()}\n onNextPage={() => table.nextPage()}\n />\n </div>\n </CursorPagination.Root>\n </div>\n );\n}\n```",
|
|
483
826
|
"Row action column — a sticky right-edge cell with a dropdown menu of actions.\nThe cell stops its own clicks, so the menu opens without a clickable row\nnavigating:\n```tsx\nimport { DataTable, createColumnHelper } from \"@ngrok/mantle/data-table\";\nimport { DropdownMenu } from \"@ngrok/mantle/dropdown-menu\";\nimport { IconButton } from \"@ngrok/mantle/button\";\nimport { DotsThreeVerticalIcon } from \"@phosphor-icons/react/DotsThreeVertical\";\n\nconst columnHelper = createColumnHelper<typeof features, Payment>();\n\nconst columns = columnHelper.columns([\n // …other columns…\n columnHelper.display({\n id: \"actions\",\n header: () => <DataTable.ActionHeader />,\n cell: (props) => (\n <DataTable.ActionCell>\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton type=\"button\" appearance=\"outlined\" intent=\"neutral\" label=\"Actions\" icon={<DotsThreeVerticalIcon />} />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n <DropdownMenu.Item onSelect={() => copy(props.row.original.id)}>\n Copy ID\n </DropdownMenu.Item>\n <DropdownMenu.Item onSelect={() => refund(props.row.original.id)}>\n Refund\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </DataTable.ActionCell>\n ),\n }),\n]);\n```",
|
|
484
827
|
"Clickable row navigating to a detail page. A `<tr>` is not focusable, so the\nprimary cell also renders a `<Link>` as the keyboard and screen-reader path.\n`SandboxedOnClick` keeps the link's click from also running the row handler:\n```tsx\nimport { DataTable, useTable } from \"@ngrok/mantle/data-table\";\nimport { SandboxedOnClick } from \"@ngrok/mantle/sandboxed-on-click\";\nimport { Link, href, useNavigate } from \"react-router\";\n\nfunction PaymentsTable({ data }: { data: Payment[] }) {\n const navigate = useNavigate();\n const table = useTable({ features, data, columns });\n const rows = table.getRowModel().rows;\n\n return (\n <DataTable.Root table={table}>\n <DataTable.Head />\n <DataTable.Body>\n {rows.map((row) => (\n <DataTable.Row\n key={row.id}\n row={row}\n onClick={() => navigate(href(\"/payments/:id\", { id: row.original.id }))}\n />\n ))}\n </DataTable.Body>\n </DataTable.Root>\n );\n}\n\n// The primary column's cell renders a <Link> for keyboard / a11y reachability.\ncolumnHelper.accessor(\"email\", {\n id: \"email\",\n header: (props) => <DataTable.Header>Email</DataTable.Header>,\n cell: (props) => (\n <DataTable.Cell>\n <SandboxedOnClick asChild allowClickEventDefault>\n <Link to={href(\"/payments/:id\", { id: props.row.original.id })}>\n {props.getValue()}\n </Link>\n </SandboxedOnClick>\n </DataTable.Cell>\n ),\n});\n```"
|
|
828
|
+
],
|
|
829
|
+
"siblings": [
|
|
830
|
+
{
|
|
831
|
+
"name": "Table",
|
|
832
|
+
"boundary": "the data is static, with no sorting, filtering, pagination, or selection."
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
"name": "DescriptionList",
|
|
836
|
+
"boundary": "one record shows as label and value pairs."
|
|
837
|
+
}
|
|
838
|
+
],
|
|
839
|
+
"useWhen": "Show rows of application data that the user sorts, filters, pages through, or selects.",
|
|
840
|
+
"aliases": [
|
|
841
|
+
"data grid",
|
|
842
|
+
"datagrid",
|
|
843
|
+
"grid",
|
|
844
|
+
"sortable table"
|
|
485
845
|
]
|
|
486
846
|
},
|
|
487
847
|
{
|
|
@@ -498,6 +858,22 @@
|
|
|
498
858
|
"examples": [
|
|
499
859
|
"Composition:\n```\nDescriptionList.Root\n└── DescriptionList.Item\n ├── DescriptionList.Label\n └── DescriptionList.Value\n```",
|
|
500
860
|
"```tsx\n<DescriptionList.Root>\n <DescriptionList.Item>\n <DescriptionList.Label>Name</DescriptionList.Label>\n <DescriptionList.Value>my-api-key</DescriptionList.Value>\n </DescriptionList.Item>\n <DescriptionList.Item>\n <DescriptionList.Label>ID</DescriptionList.Label>\n <DescriptionList.Value>\n aigk_2fKm9x8Hn3QpYT7zKlR0vW5\n </DescriptionList.Value>\n </DescriptionList.Item>\n</DescriptionList.Root>\n```"
|
|
861
|
+
],
|
|
862
|
+
"siblings": [
|
|
863
|
+
{
|
|
864
|
+
"name": "Table",
|
|
865
|
+
"boundary": "several records share the same columns."
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
"name": "Strata",
|
|
869
|
+
"boundary": "the pairs are headed sections of controls, not read-only data."
|
|
870
|
+
}
|
|
871
|
+
],
|
|
872
|
+
"useWhen": "Show the label and value pairs of one resource, such as the metadata on a detail page.",
|
|
873
|
+
"aliases": [
|
|
874
|
+
"key value list",
|
|
875
|
+
"definition list",
|
|
876
|
+
"property list"
|
|
501
877
|
]
|
|
502
878
|
},
|
|
503
879
|
{
|
|
@@ -515,8 +891,24 @@
|
|
|
515
891
|
"Composition:\n```\nDialog.Root\n├── Dialog.Trigger\n└── Dialog.Content\n ├── Dialog.Header\n │ ├── Dialog.Title\n │ ├── Dialog.Description\n │ └── Dialog.CloseIconButton\n ├── Dialog.Body\n └── Dialog.Footer\n └── Dialog.Close\n```",
|
|
516
892
|
"```tsx\n<Dialog.Root>\n <Dialog.Trigger asChild>\n <Button type=\"button\" appearance=\"filled\" intent=\"neutral\">Open Dialog</Button>\n </Dialog.Trigger>\n <Dialog.Content>\n <Dialog.Header>\n <Dialog.Title>Dialog Title</Dialog.Title>\n <Dialog.Description>This is an optional description.</Dialog.Description>\n <Dialog.CloseIconButton />\n </Dialog.Header>\n <Dialog.Body>\n <p>This is the dialog content.</p>\n </Dialog.Body>\n <Dialog.Footer>\n <Dialog.Close asChild>\n <Button type=\"button\" appearance=\"outlined\" intent=\"neutral\">Cancel</Button>\n </Dialog.Close>\n <Button type=\"button\" appearance=\"filled\" intent=\"neutral\">Save</Button>\n </Dialog.Footer>\n </Dialog.Content>\n</Dialog.Root>\n```"
|
|
517
893
|
],
|
|
894
|
+
"siblings": [
|
|
895
|
+
{
|
|
896
|
+
"name": "AlertDialog",
|
|
897
|
+
"boundary": "the user must confirm a destructive or irreversible action, such as a delete."
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
"name": "Sheet",
|
|
901
|
+
"boundary": "the content slides in from the edge of the screen, such as a filter panel or a detail view."
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"name": "Popover",
|
|
905
|
+
"boundary": "the content is small and opens next to its trigger, with no modal backdrop."
|
|
906
|
+
}
|
|
907
|
+
],
|
|
908
|
+
"useWhen": "Gather input or confirm a choice that is not destructive, in a modal window that blocks the page.",
|
|
518
909
|
"aliases": [
|
|
519
|
-
"modal"
|
|
910
|
+
"modal",
|
|
911
|
+
"modal dialog"
|
|
520
912
|
]
|
|
521
913
|
},
|
|
522
914
|
{
|
|
@@ -533,6 +925,32 @@
|
|
|
533
925
|
"examples": [
|
|
534
926
|
"Composition:\n```\nDropdownMenu.Root\n├── DropdownMenu.Trigger\n└── DropdownMenu.Content\n ├── DropdownMenu.Group\n │ ├── DropdownMenu.Label\n │ ├── DropdownMenu.Item\n │ │ └── DropdownMenu.Shortcut\n │ ├── DropdownMenu.CheckboxItem\n │ └── DropdownMenu.RadioGroup\n │ └── DropdownMenu.RadioItem\n ├── DropdownMenu.Separator\n └── DropdownMenu.Sub\n ├── DropdownMenu.SubTrigger\n └── DropdownMenu.SubContent\n```",
|
|
535
927
|
"```tsx\n<DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <Button type=\"button\" appearance=\"outlined\" intent=\"neutral\">\n Open Menu\n </Button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content>\n <DropdownMenu.Item>Item 1</DropdownMenu.Item>\n <DropdownMenu.Item>Item 2</DropdownMenu.Item>\n </DropdownMenu.Content>\n</DropdownMenu.Root>\n```"
|
|
928
|
+
],
|
|
929
|
+
"siblings": [
|
|
930
|
+
{
|
|
931
|
+
"name": "Select",
|
|
932
|
+
"boundary": "the user picks one value for a form field."
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
"name": "SplitButton",
|
|
936
|
+
"boundary": "a default action runs on one click, and the menu holds its alternatives."
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
"name": "Command",
|
|
940
|
+
"boundary": "the user searches many actions or pages from the keyboard."
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"name": "Popover",
|
|
944
|
+
"boundary": "the floating content is a small form or other content, not a menu."
|
|
945
|
+
}
|
|
946
|
+
],
|
|
947
|
+
"useWhen": "Show a menu of actions or options when the user clicks a button.",
|
|
948
|
+
"aliases": [
|
|
949
|
+
"menu",
|
|
950
|
+
"action menu",
|
|
951
|
+
"overflow menu",
|
|
952
|
+
"kebab menu",
|
|
953
|
+
"menu button"
|
|
536
954
|
]
|
|
537
955
|
},
|
|
538
956
|
{
|
|
@@ -567,7 +985,10 @@
|
|
|
567
985
|
"useWhen": "A region has no data, no results, or no access to show.",
|
|
568
986
|
"aliases": [
|
|
569
987
|
"empty state",
|
|
570
|
-
"zero state"
|
|
988
|
+
"zero state",
|
|
989
|
+
"blank slate",
|
|
990
|
+
"no data",
|
|
991
|
+
"no results"
|
|
571
992
|
]
|
|
572
993
|
},
|
|
573
994
|
{
|
|
@@ -584,6 +1005,22 @@
|
|
|
584
1005
|
"examples": [
|
|
585
1006
|
"Composition:\n```\nField.Group\n└── Field.Item\n ├── Field.LabelRow\n │ ├── Field.Label (or Field.LabelText for control-less rows)\n │ │ └── Field.Optional\n │ └── Field.Help\n │ ├── Field.HelpTrigger\n │ └── Field.HelpContent\n ├── Field.Control\n │ └── (control)\n ├── Field.Errors (or)\n ├── Field.ErrorList\n │ └── Field.ErrorItem\n └── Field.Description\n```",
|
|
586
1007
|
"```tsx\n<Field.Group>\n <Field.Item name=\"apiKey\">\n <Field.LabelRow>\n <Field.Label>\n API key <Field.Optional />\n </Field.Label>\n <Field.Help>\n <Field.HelpTrigger label=\"What is an API key?\" />\n <Field.HelpContent>Copy this from the dashboard.</Field.HelpContent>\n </Field.Help>\n </Field.LabelRow>\n <Field.Control>\n <Input />\n </Field.Control>\n <Field.Errors messages={[\"API key is required.\"]} />\n <Field.Description>You can find this in the ngrok dashboard.</Field.Description>\n </Field.Item>\n</Field.Group>\n```"
|
|
1008
|
+
],
|
|
1009
|
+
"siblings": [
|
|
1010
|
+
{
|
|
1011
|
+
"name": "Label",
|
|
1012
|
+
"boundary": "the control needs only a caption, with no description or errors."
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
"name": "Choice",
|
|
1016
|
+
"boundary": "a checkbox, a radio, or a switch sits beside a title and a description."
|
|
1017
|
+
}
|
|
1018
|
+
],
|
|
1019
|
+
"useWhen": "Group one form control with its label, its description, and its validation errors.",
|
|
1020
|
+
"aliases": [
|
|
1021
|
+
"form field",
|
|
1022
|
+
"form group",
|
|
1023
|
+
"form item"
|
|
587
1024
|
]
|
|
588
1025
|
},
|
|
589
1026
|
{
|
|
@@ -599,6 +1036,10 @@
|
|
|
599
1036
|
"jsdoc": "Renders a country flag from an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code, served as an SVG from ngrok's CDN.",
|
|
600
1037
|
"examples": [
|
|
601
1038
|
"```tsx\nimport { Flag } from \"@ngrok/mantle/flag\";\n\n<Flag code=\"US\" />\n<Flag code=\"JP\" size=\"m\" loading=\"eager\" />\n<Flag code=\"CA\" size=\"s\" />\n\n// Inline next to a country label.\n<span className=\"inline-flex items-center gap-2\">\n <Flag code=\"GB\" size=\"s\" aria-hidden />\n <span>United Kingdom</span>\n</span>\n```"
|
|
1039
|
+
],
|
|
1040
|
+
"useWhen": "Show the country of a region, an IP address, or a billing address as a flag, from its two-letter country code.",
|
|
1041
|
+
"aliases": [
|
|
1042
|
+
"country flag"
|
|
602
1043
|
]
|
|
603
1044
|
},
|
|
604
1045
|
{
|
|
@@ -615,6 +1056,22 @@
|
|
|
615
1056
|
"examples": [
|
|
616
1057
|
"Composition:\n```\nHoverCard.Root\n├── HoverCard.Trigger\n└── HoverCard.Content\n └── HoverCard.Arrow\n```",
|
|
617
1058
|
"```tsx\n<HoverCard.Root>\n <HoverCard.Trigger asChild>\n <Button type=\"button\" appearance=\"outlined\" intent=\"neutral\">\n Hover me\n </Button>\n </HoverCard.Trigger>\n <HoverCard.Content>\n <p>This is the hover card content.</p>\n </HoverCard.Content>\n</HoverCard.Root>\n```"
|
|
1059
|
+
],
|
|
1060
|
+
"siblings": [
|
|
1061
|
+
{
|
|
1062
|
+
"name": "Tooltip",
|
|
1063
|
+
"boundary": "the content is a short label or hint with no interactive content."
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
"name": "Popover",
|
|
1067
|
+
"boundary": "the user opens interactive content on purpose, with a click or a key."
|
|
1068
|
+
}
|
|
1069
|
+
],
|
|
1070
|
+
"useWhen": "Preview the content behind a link on hover, such as a user card or a repository preview.",
|
|
1071
|
+
"aliases": [
|
|
1072
|
+
"hovercard",
|
|
1073
|
+
"link preview",
|
|
1074
|
+
"preview card"
|
|
618
1075
|
]
|
|
619
1076
|
},
|
|
620
1077
|
{
|
|
@@ -630,6 +1087,20 @@
|
|
|
630
1087
|
"jsdoc": "Decorates an svg icon with automatic sizing styles and a `shrink-0` class.",
|
|
631
1088
|
"examples": [
|
|
632
1089
|
"```tsx\nimport { ShrimpIcon } from \"@phosphor-icons/react/Shrimp\";\n\n// Decorative: renders aria-hidden=\"true\".\n<Icon svg={<ShrimpIcon />} />\n\n// Meaningful: the name keeps it exposed.\n<Icon svg={<ShrimpIcon />} role=\"img\" aria-label=\"Shrimp\" />\n```"
|
|
1090
|
+
],
|
|
1091
|
+
"siblings": [
|
|
1092
|
+
{
|
|
1093
|
+
"name": "IconButton",
|
|
1094
|
+
"boundary": "the icon is the only content of a button."
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
"name": "Avatar",
|
|
1098
|
+
"boundary": "the image represents a person or an account."
|
|
1099
|
+
}
|
|
1100
|
+
],
|
|
1101
|
+
"useWhen": "Show an SVG icon, such as a Phosphor icon, beside text or inside a control.",
|
|
1102
|
+
"aliases": [
|
|
1103
|
+
"svg icon"
|
|
633
1104
|
]
|
|
634
1105
|
},
|
|
635
1106
|
{
|
|
@@ -646,6 +1117,17 @@
|
|
|
646
1117
|
"examples": [
|
|
647
1118
|
"```tsx\n<IconButton\n icon={<TrashIcon />}\n label=\"Delete item\"\n appearance=\"ghost\"\n intent=\"neutral\"\n size=\"sm\"\n onClick={handleDelete}\n/>\n```",
|
|
648
1119
|
"Submit a form — opt in with `type=\"submit\"` (the default `\"button\"` does not submit):\n```tsx\n<IconButton\n type=\"submit\"\n appearance=\"outlined\"\n intent=\"neutral\"\n icon={<MagnifyingGlassIcon />}\n label=\"Search\"\n/>\n```"
|
|
1120
|
+
],
|
|
1121
|
+
"siblings": [
|
|
1122
|
+
{
|
|
1123
|
+
"name": "Button",
|
|
1124
|
+
"boundary": "the button shows a text label."
|
|
1125
|
+
}
|
|
1126
|
+
],
|
|
1127
|
+
"useWhen": "Run an action from a compact button that shows one icon and no text, such as a close or a copy button.",
|
|
1128
|
+
"aliases": [
|
|
1129
|
+
"icon only button",
|
|
1130
|
+
"action icon"
|
|
649
1131
|
]
|
|
650
1132
|
},
|
|
651
1133
|
{
|
|
@@ -658,7 +1140,18 @@
|
|
|
658
1140
|
"docsUrl": "https://mantle.ngrok.com/components/data-display/icons",
|
|
659
1141
|
"markdownUrl": "https://mantle.ngrok.com/components/data-display/icons.md",
|
|
660
1142
|
"summary": "Custom icons used throughout ngrok UI.",
|
|
661
|
-
"jsdoc": "Re-exports for the Icons component — the ngrok-specific icons that `@phosphor-icons/react` does not ship."
|
|
1143
|
+
"jsdoc": "Re-exports for the Icons component — the ngrok-specific icons that `@phosphor-icons/react` does not ship.",
|
|
1144
|
+
"siblings": [
|
|
1145
|
+
{
|
|
1146
|
+
"name": "Icon",
|
|
1147
|
+
"boundary": "the glyph comes from `@phosphor-icons/react`."
|
|
1148
|
+
}
|
|
1149
|
+
],
|
|
1150
|
+
"useWhen": "Show an ngrok glyph that `@phosphor-icons/react` does not ship, such as the ngrok wordmark or the icon for a traffic policy file.",
|
|
1151
|
+
"aliases": [
|
|
1152
|
+
"icon set",
|
|
1153
|
+
"icon library"
|
|
1154
|
+
]
|
|
662
1155
|
},
|
|
663
1156
|
{
|
|
664
1157
|
"name": "Input",
|
|
@@ -673,6 +1166,35 @@
|
|
|
673
1166
|
"jsdoc": "An interactive form control that accepts data from the user.",
|
|
674
1167
|
"examples": [
|
|
675
1168
|
"```tsx\n<Input\n type=\"email\"\n placeholder=\"Enter your email\"\n validation=\"success\"\n/>\n```"
|
|
1169
|
+
],
|
|
1170
|
+
"siblings": [
|
|
1171
|
+
{
|
|
1172
|
+
"name": "TextArea",
|
|
1173
|
+
"boundary": "the text spans several lines."
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"name": "PasswordInput",
|
|
1177
|
+
"boundary": "the value is a password or another secret."
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
"name": "OtpInput",
|
|
1181
|
+
"boundary": "the value is a one-time passcode."
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
"name": "Combobox",
|
|
1185
|
+
"boundary": "the user picks the value from a list of suggestions."
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
"name": "Query",
|
|
1189
|
+
"boundary": "the field filters a list with free text and `key:value` qualifiers."
|
|
1190
|
+
}
|
|
1191
|
+
],
|
|
1192
|
+
"useWhen": "Accept one line of text from the user, such as a name, an email address, a URL, or a search term.",
|
|
1193
|
+
"aliases": [
|
|
1194
|
+
"text input",
|
|
1195
|
+
"text field",
|
|
1196
|
+
"textfield",
|
|
1197
|
+
"textbox"
|
|
676
1198
|
]
|
|
677
1199
|
},
|
|
678
1200
|
{
|
|
@@ -688,6 +1210,23 @@
|
|
|
688
1210
|
"jsdoc": "A square, centered keyboard \"key\" chip for rendering shortcut hints — \"K\", \"⌘\", \"⌃\", \"Enter\".",
|
|
689
1211
|
"examples": [
|
|
690
1212
|
"```tsx\nimport { Kbd } from \"@ngrok/mantle/kbd\";\n\n// Letter key.\n<Kbd>K</Kbd>\n\n// Symbol: a visually hidden label names the key, and the glyph is hidden.\n<Kbd>\n <span className=\"sr-only\">Enter</span>\n <span aria-hidden>↵</span>\n</Kbd>\n\n// Chord — render each key separately.\n<span className=\"inline-flex items-center gap-1\">\n <Kbd>\n <span className=\"sr-only\">Command</span>\n <span aria-hidden>⌘</span>\n </Kbd>\n <span>+</span>\n <Kbd>K</Kbd>\n</span>\n```"
|
|
1213
|
+
],
|
|
1214
|
+
"siblings": [
|
|
1215
|
+
{
|
|
1216
|
+
"name": "Code",
|
|
1217
|
+
"boundary": "the text is a fragment of code, not a key."
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
"name": "Badge",
|
|
1221
|
+
"boundary": "the label is a status, a category, or a count."
|
|
1222
|
+
}
|
|
1223
|
+
],
|
|
1224
|
+
"useWhen": "Show a keyboard key or a shortcut hint, such as `⌘` and `K`, in prose, a tooltip, or a menu item.",
|
|
1225
|
+
"aliases": [
|
|
1226
|
+
"keyboard shortcut",
|
|
1227
|
+
"hotkey",
|
|
1228
|
+
"keycap",
|
|
1229
|
+
"keyboard key"
|
|
691
1230
|
]
|
|
692
1231
|
},
|
|
693
1232
|
{
|
|
@@ -703,6 +1242,20 @@
|
|
|
703
1242
|
"jsdoc": "A caption for a form control — input, checkbox, radio, switch, select.",
|
|
704
1243
|
"examples": [
|
|
705
1244
|
"```tsx\nimport { Label } from \"@ngrok/mantle/label\";\nimport { Input } from \"@ngrok/mantle/input\";\n\n// Implicit — control nested inside the label.\n<Label className=\"grid gap-1\">\n <span>Email</span>\n <Input type=\"email\" name=\"email\" />\n</Label>\n\n// Explicit — htmlFor matches the control's id.\n<div className=\"grid gap-1\">\n <Label htmlFor=\"api-key\">API key</Label>\n <Input id=\"api-key\" name=\"apiKey\" />\n</div>\n\n// Inline label for a checkbox.\n<Label className=\"flex items-center gap-2\">\n <Checkbox name=\"terms\" />\n <span>I agree to the terms</span>\n</Label>\n```"
|
|
1245
|
+
],
|
|
1246
|
+
"siblings": [
|
|
1247
|
+
{
|
|
1248
|
+
"name": "Field",
|
|
1249
|
+
"boundary": "the control also needs a description or validation errors."
|
|
1250
|
+
},
|
|
1251
|
+
{
|
|
1252
|
+
"name": "Choice",
|
|
1253
|
+
"boundary": "the control needs a title and a description beside it."
|
|
1254
|
+
}
|
|
1255
|
+
],
|
|
1256
|
+
"useWhen": "Give a form control a visible caption that names it and focuses it on a click.",
|
|
1257
|
+
"aliases": [
|
|
1258
|
+
"form label"
|
|
706
1259
|
]
|
|
707
1260
|
},
|
|
708
1261
|
{
|
|
@@ -714,11 +1267,31 @@
|
|
|
714
1267
|
"importPath": "@ngrok/mantle/line-chart",
|
|
715
1268
|
"docsUrl": "https://mantle.ngrok.com/components/charts/line-chart",
|
|
716
1269
|
"markdownUrl": "https://mantle.ngrok.com/components/charts/line-chart.md",
|
|
717
|
-
"summary": "A
|
|
718
|
-
"jsdoc": "A
|
|
1270
|
+
"summary": "A line chart for trends over a continuous x axis, time above all. Min/max decimation keeps 100,000+ point series smooth.",
|
|
1271
|
+
"jsdoc": "A line chart for trends over a continuous x — time above all.",
|
|
719
1272
|
"examples": [
|
|
720
|
-
"Composition:\n```\nLineChart.Root\n├── LineChart.Grid\n├── LineChart.XAxis\n├── LineChart.YAxis\n├── LineChart.Line (one per series)\n├── LineChart.ReferenceLine\n├── LineChart.Tooltip\n├── LineChart.Legend\n└── LineChart.CopyButton\n```",
|
|
721
|
-
"```tsx\nconst data = [\n { time: new Date(\"2026-07-18T10:00:00Z\"), p50: 120, p99: 480 },\n { time: new Date(\"2026-07-18T10:01:00Z\"), p50: 132, p99: 510 },\n { time: new Date(\"2026-07-18T10:02:00Z\"), p50: 101, p99: 460 },\n];\n\n<LineChart.Root data={data} xKey=\"time\" aria-label=\"Request latency\">\n <LineChart.Grid />\n <LineChart.XAxis />\n <LineChart.YAxis />\n <LineChart.Line dataKey=\"p50\" label=\"p50\" />\n <LineChart.Line dataKey=\"p99\" label=\"p99\" curve=\"monotone\" />\n <LineChart.Tooltip />\n <LineChart.Legend />\n</LineChart.Root>\n```"
|
|
1273
|
+
"Composition:\n```\nLineChart.Root\n├── LineChart.Grid\n├── LineChart.XAxis\n├── LineChart.YAxis\n├── LineChart.Line (one per series)\n├── LineChart.ReferenceLine\n├── LineChart.Tooltip\n├── LineChart.Legend\n└── LineChart.CopyButton\n```\n\nA List groups Roots:\n```\nLineChart.List\n└── LineChart.Root (one per chart)\n```",
|
|
1274
|
+
"```tsx\nconst data = [\n { time: new Date(\"2026-07-18T10:00:00Z\"), p50: 120, p99: 480 },\n { time: new Date(\"2026-07-18T10:01:00Z\"), p50: 132, p99: 510 },\n { time: new Date(\"2026-07-18T10:02:00Z\"), p50: 101, p99: 460 },\n];\n\n<LineChart.Root data={data} xKey=\"time\" aria-label=\"Request latency\">\n <LineChart.Grid />\n <LineChart.XAxis />\n <LineChart.YAxis />\n <LineChart.Line dataKey=\"p50\" label=\"p50\" color=\"blue\" />\n <LineChart.Line dataKey=\"p99\" label=\"p99\" curve=\"monotone\" color=\"emerald\" />\n <LineChart.Tooltip />\n <LineChart.Legend />\n</LineChart.Root>\n```"
|
|
1275
|
+
],
|
|
1276
|
+
"siblings": [
|
|
1277
|
+
{
|
|
1278
|
+
"name": "AreaChart",
|
|
1279
|
+
"boundary": "the chart shows a volume, or a total and its parts, as filled areas."
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
"name": "BarChart",
|
|
1283
|
+
"boundary": "the reader compares values across categories by bar length from zero."
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
"name": "ScatterPlot",
|
|
1287
|
+
"boundary": "the points show how two measures correlate, and their order does not matter."
|
|
1288
|
+
}
|
|
1289
|
+
],
|
|
1290
|
+
"useWhen": "Show how one or more values trend across an ordered x axis, such as time, including long series with many points.",
|
|
1291
|
+
"aliases": [
|
|
1292
|
+
"sparkline",
|
|
1293
|
+
"line graph",
|
|
1294
|
+
"time series chart"
|
|
722
1295
|
]
|
|
723
1296
|
},
|
|
724
1297
|
{
|
|
@@ -735,6 +1308,21 @@
|
|
|
735
1308
|
"examples": [
|
|
736
1309
|
"Composition:\n```\nList.Root (or .VirtualRoot)\n└── List.Item\n ├── List.ItemTitle\n └── List.ItemDescription\n```",
|
|
737
1310
|
"```tsx\n<List.Root aria-label=\"Your accounts\" className=\"max-h-80\">\n {accounts.map((account) => (\n <List.Item key={account.id} onClick={() => switchTo(account.id)}>\n <List.ItemTitle>{account.name}</List.ItemTitle>\n <List.ItemDescription>\n {account.plan} · {account.memberCount} members\n </List.ItemDescription>\n </List.Item>\n ))}\n</List.Root>\n```"
|
|
1311
|
+
],
|
|
1312
|
+
"siblings": [
|
|
1313
|
+
{
|
|
1314
|
+
"name": "SelectableList",
|
|
1315
|
+
"boundary": "the user selects rows with checkboxes."
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
"name": "DropdownMenu",
|
|
1319
|
+
"boundary": "the actions open in a menu from a button."
|
|
1320
|
+
}
|
|
1321
|
+
],
|
|
1322
|
+
"useWhen": "Show a scrollable list of items that each run an action or navigate, such as an account switcher.",
|
|
1323
|
+
"aliases": [
|
|
1324
|
+
"virtual list",
|
|
1325
|
+
"virtualized list"
|
|
738
1326
|
]
|
|
739
1327
|
},
|
|
740
1328
|
{
|
|
@@ -750,6 +1338,25 @@
|
|
|
750
1338
|
"jsdoc": "Announces its text to screen readers when the text changes.",
|
|
751
1339
|
"examples": [
|
|
752
1340
|
"```tsx\nimport { LiveRegion } from \"@ngrok/mantle/live-region\";\n\n// Mount the region before the first message, then swap the message.\nfunction SearchResults({ results }: { results: string[] }) {\n return (\n <>\n <LiveRegion>{`${results.length} results found`}</LiveRegion>\n <ul>\n {results.map((result) => (\n <li key={result}>{result}</li>\n ))}\n </ul>\n </>\n );\n}\n```"
|
|
1341
|
+
],
|
|
1342
|
+
"siblings": [
|
|
1343
|
+
{
|
|
1344
|
+
"name": "Toast",
|
|
1345
|
+
"boundary": "sighted users also need to see the message."
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
"name": "Alert",
|
|
1349
|
+
"boundary": "the message stays visible in the page. It announces only when you pass it a `role`."
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
"name": "VisuallyHidden",
|
|
1353
|
+
"boundary": "the hidden text is static and needs no announcement."
|
|
1354
|
+
}
|
|
1355
|
+
],
|
|
1356
|
+
"useWhen": "Announce a change to screen readers with no visible message, such as a save result or a count of search results.",
|
|
1357
|
+
"aliases": [
|
|
1358
|
+
"aria live",
|
|
1359
|
+
"announcer"
|
|
753
1360
|
]
|
|
754
1361
|
},
|
|
755
1362
|
{
|
|
@@ -766,6 +1373,20 @@
|
|
|
766
1373
|
"examples": [
|
|
767
1374
|
"```tsx\n<SkipToMainLink />\n<Header />\n<Main>\n <h1>Page title</h1>\n</Main>\n```",
|
|
768
1375
|
"In an app shell, `AppLayout.Body` renders it:\n```tsx\n<Sidebar.Root>\n <AppLayout.Root className=\"fixed inset-0\">\n <SkipToMainLink />\n <AppLayout.Notice>{isUnderMaintenance && <MaintenanceBanner />}</AppLayout.Notice>\n <AppLayout.Workspace>\n <Sidebar.Nav aria-label=\"Main\">…</Sidebar.Nav>\n <AppLayout.Content>\n <AppLayout.Header>\n <Sidebar.Trigger />\n <Breadcrumbs />\n </AppLayout.Header>\n <AppLayout.Body>\n <Outlet />\n </AppLayout.Body>\n </AppLayout.Content>\n </AppLayout.Workspace>\n </AppLayout.Root>\n</Sidebar.Root>\n```"
|
|
1376
|
+
],
|
|
1377
|
+
"siblings": [
|
|
1378
|
+
{
|
|
1379
|
+
"name": "SkipToMainLink",
|
|
1380
|
+
"boundary": "keyboard users need the link that jumps to the landmark."
|
|
1381
|
+
},
|
|
1382
|
+
{
|
|
1383
|
+
"name": "AppLayout",
|
|
1384
|
+
"boundary": "the page sits in the app shell, where `AppLayout.Body` already renders the landmark."
|
|
1385
|
+
}
|
|
1386
|
+
],
|
|
1387
|
+
"useWhen": "Mark the primary content of a page as a focusable `<main>` landmark that a skip link can move focus to.",
|
|
1388
|
+
"aliases": [
|
|
1389
|
+
"main landmark"
|
|
769
1390
|
]
|
|
770
1391
|
},
|
|
771
1392
|
{
|
|
@@ -782,6 +1403,20 @@
|
|
|
782
1403
|
"examples": [
|
|
783
1404
|
"Composition:\n```\nMediaObject.Root\n├── MediaObject.Media\n└── MediaObject.Content\n```",
|
|
784
1405
|
"```tsx\nimport { Avatar } from \"@ngrok/mantle/avatar\";\nimport { MediaObject } from \"@ngrok/mantle/media-object\";\n\n<MediaObject.Root>\n <MediaObject.Media>\n <Avatar.Root>\n <Avatar.Image src={user.avatarUrl} alt=\"\" />\n <Avatar.Fallback name={user.name} />\n </Avatar.Root>\n </MediaObject.Media>\n <MediaObject.Content>\n <p className=\"font-medium\">{user.name}</p>\n <p className=\"text-muted text-sm\">{comment}</p>\n </MediaObject.Content>\n</MediaObject.Root>\n```"
|
|
1406
|
+
],
|
|
1407
|
+
"siblings": [
|
|
1408
|
+
{
|
|
1409
|
+
"name": "Card",
|
|
1410
|
+
"boundary": "the content needs a raised box with a border."
|
|
1411
|
+
},
|
|
1412
|
+
{
|
|
1413
|
+
"name": "Choice",
|
|
1414
|
+
"boundary": "the thing beside the text is a checkbox, a radio, or a switch."
|
|
1415
|
+
}
|
|
1416
|
+
],
|
|
1417
|
+
"useWhen": "Put an image, an avatar, or an icon beside a title and a description, such as in a comment or a list row.",
|
|
1418
|
+
"aliases": [
|
|
1419
|
+
"media block"
|
|
785
1420
|
]
|
|
786
1421
|
},
|
|
787
1422
|
{
|
|
@@ -798,6 +1433,27 @@
|
|
|
798
1433
|
"examples": [
|
|
799
1434
|
"Composition:\n```\nMultiSelect.Root\n├── MultiSelect.Trigger\n│ ├── MultiSelect.TagValues\n│ └── MultiSelect.Input\n└── MultiSelect.Content\n ├── MultiSelect.Group\n │ ├── MultiSelect.GroupLabel\n │ ├── MultiSelect.GroupDescription\n │ └── MultiSelect.Item\n ├── MultiSelect.Separator\n ├── MultiSelect.Empty\n └── MultiSelect.ContentFooter\n```",
|
|
800
1435
|
"```tsx\n<MultiSelect.Root>\n <MultiSelect.Trigger>\n <MultiSelect.TagValues />\n <MultiSelect.Input placeholder=\"Select items...\" />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.Item value=\"apple\">Apple</MultiSelect.Item>\n <MultiSelect.Item value=\"banana\">Banana</MultiSelect.Item>\n <MultiSelect.Item value=\"cherry\">Cherry</MultiSelect.Item>\n </MultiSelect.Content>\n</MultiSelect.Root>\n```"
|
|
1436
|
+
],
|
|
1437
|
+
"siblings": [
|
|
1438
|
+
{
|
|
1439
|
+
"name": "Combobox",
|
|
1440
|
+
"boundary": "the user picks one value with a filter."
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
"name": "Select",
|
|
1444
|
+
"boundary": "the user picks one value from a short list."
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
"name": "SelectableList",
|
|
1448
|
+
"boundary": "the options show inline as checkbox rows, with no popover."
|
|
1449
|
+
}
|
|
1450
|
+
],
|
|
1451
|
+
"useWhen": "Pick several values from a list with a typeahead filter, and show the picks as removable tags.",
|
|
1452
|
+
"aliases": [
|
|
1453
|
+
"tag input",
|
|
1454
|
+
"tags input",
|
|
1455
|
+
"multiple select",
|
|
1456
|
+
"chip input"
|
|
801
1457
|
]
|
|
802
1458
|
},
|
|
803
1459
|
{
|
|
@@ -814,6 +1470,23 @@
|
|
|
814
1470
|
"examples": [
|
|
815
1471
|
"Composition:\n```\nOtpInput.Root\n├── OtpInput.Group\n│ └── OtpInput.Slot\n├── OtpInput.Separator\n└── OtpInput.Group\n └── OtpInput.Slot\n```",
|
|
816
1472
|
"```tsx\n<OtpInput.Root maxLength={6}>\n <OtpInput.Group>\n <OtpInput.Slot index={0} />\n <OtpInput.Slot index={1} />\n <OtpInput.Slot index={2} />\n </OtpInput.Group>\n <OtpInput.Separator />\n <OtpInput.Group>\n <OtpInput.Slot index={3} />\n <OtpInput.Slot index={4} />\n <OtpInput.Slot index={5} />\n </OtpInput.Group>\n</OtpInput.Root>\n```"
|
|
1473
|
+
],
|
|
1474
|
+
"siblings": [
|
|
1475
|
+
{
|
|
1476
|
+
"name": "Input",
|
|
1477
|
+
"boundary": "the value is free-form text."
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
"name": "PasswordInput",
|
|
1481
|
+
"boundary": "the value is a password or another long-lived secret."
|
|
1482
|
+
}
|
|
1483
|
+
],
|
|
1484
|
+
"useWhen": "Enter a one-time passcode, such as a two-factor code, with one box for each character.",
|
|
1485
|
+
"aliases": [
|
|
1486
|
+
"one time password",
|
|
1487
|
+
"verification code",
|
|
1488
|
+
"pin input",
|
|
1489
|
+
"2fa"
|
|
817
1490
|
]
|
|
818
1491
|
},
|
|
819
1492
|
{
|
|
@@ -826,7 +1499,12 @@
|
|
|
826
1499
|
"docsUrl": "https://mantle.ngrok.com/components/navigation/pagination",
|
|
827
1500
|
"markdownUrl": "https://mantle.ngrok.com/components/navigation/pagination.md",
|
|
828
1501
|
"summary": "Components and hooks for navigating through paged data with cursor-based and offset-based pagination strategies.",
|
|
829
|
-
"jsdoc": "Re-exports for the Pagination component family — `CursorPagination`'s parts for cursor paging,
|
|
1502
|
+
"jsdoc": "Re-exports for the Pagination component family — `CursorPagination`'s parts for cursor paging, `useOffsetPagination` for offset paging, and `PaginationRange` for the count line of a list whose total is known.",
|
|
1503
|
+
"useWhen": "Move through paged data one page at a time, with a cursor or an offset.",
|
|
1504
|
+
"aliases": [
|
|
1505
|
+
"pager",
|
|
1506
|
+
"paginator"
|
|
1507
|
+
]
|
|
830
1508
|
},
|
|
831
1509
|
{
|
|
832
1510
|
"name": "Password Input",
|
|
@@ -841,6 +1519,20 @@
|
|
|
841
1519
|
"jsdoc": "An input optimized for password and other sensitive-value entry.",
|
|
842
1520
|
"examples": [
|
|
843
1521
|
"```tsx\nimport { PasswordInput } from \"@ngrok/mantle/input\";\nimport { Label } from \"@ngrok/mantle/label\";\nimport { useState } from \"react\";\n\n// Basic — uncontrolled visibility.\n<Label className=\"grid gap-1\">\n <span>Password</span>\n <PasswordInput name=\"password\" autoComplete=\"current-password\" />\n</Label>\n\n// Validation state.\n<PasswordInput validation=\"error\" />\n\n// Controlled visibility — one toggle reveals multiple fields.\nfunction PasswordPair() {\n const [show, setShow] = useState(false);\n return (\n <>\n <PasswordInput showValue={show} onValueVisibilityChange={setShow} />\n <PasswordInput showValue={show} onValueVisibilityChange={setShow} />\n </>\n );\n}\n```"
|
|
1522
|
+
],
|
|
1523
|
+
"siblings": [
|
|
1524
|
+
{
|
|
1525
|
+
"name": "Input",
|
|
1526
|
+
"boundary": "the value is never sensitive."
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
"name": "OtpInput",
|
|
1530
|
+
"boundary": "the value is a one-time passcode."
|
|
1531
|
+
}
|
|
1532
|
+
],
|
|
1533
|
+
"useWhen": "Accept a password or another secret value, with a button that shows or hides it.",
|
|
1534
|
+
"aliases": [
|
|
1535
|
+
"password field"
|
|
844
1536
|
]
|
|
845
1537
|
},
|
|
846
1538
|
{
|
|
@@ -858,8 +1550,28 @@
|
|
|
858
1550
|
"Composition:\n```\nPopover.Root\n├── Popover.Trigger\n├── Popover.Anchor\n└── Popover.Content\n ├── Popover.Arrow\n └── Popover.Close\n```",
|
|
859
1551
|
"```tsx\n<Popover.Root>\n <Popover.Trigger asChild>\n <Button type=\"button\" appearance=\"outlined\" intent=\"neutral\">\n Open Popover\n </Button>\n </Popover.Trigger>\n <Popover.Content>\n <p>This is the popover content.</p>\n </Popover.Content>\n</Popover.Root>\n```"
|
|
860
1552
|
],
|
|
1553
|
+
"siblings": [
|
|
1554
|
+
{
|
|
1555
|
+
"name": "Tooltip",
|
|
1556
|
+
"boundary": "the content is a short label or hint that shows on hover or focus."
|
|
1557
|
+
},
|
|
1558
|
+
{
|
|
1559
|
+
"name": "HoverCard",
|
|
1560
|
+
"boundary": "the content is a preview of a link that shows on hover."
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
"name": "DropdownMenu",
|
|
1564
|
+
"boundary": "the content is a list of actions."
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
"name": "Dialog",
|
|
1568
|
+
"boundary": "the task needs a modal window that blocks the page."
|
|
1569
|
+
}
|
|
1570
|
+
],
|
|
1571
|
+
"useWhen": "Show interactive content, such as a small form, a settings menu, or a color picker, that the user opens from a button.",
|
|
861
1572
|
"aliases": [
|
|
862
|
-
"popup"
|
|
1573
|
+
"popup",
|
|
1574
|
+
"flyout"
|
|
863
1575
|
]
|
|
864
1576
|
},
|
|
865
1577
|
{
|
|
@@ -876,6 +1588,22 @@
|
|
|
876
1588
|
"examples": [
|
|
877
1589
|
"Composition:\n```\nProgressBar.Root\n└── ProgressBar.Indicator\n```",
|
|
878
1590
|
"```tsx\n<ProgressBar.Root aria-label=\"Upload progress\" value={60}>\n <ProgressBar.Indicator />\n</ProgressBar.Root>\n\n<ProgressBar.Root aria-label=\"Upload progress\" value={75} max={100}>\n <ProgressBar.Indicator />\n</ProgressBar.Root>\n\n// Indeterminate progress\n<ProgressBar.Root aria-label=\"Upload progress\" value=\"indeterminate\">\n <ProgressBar.Indicator />\n</ProgressBar.Root>\n```"
|
|
1591
|
+
],
|
|
1592
|
+
"siblings": [
|
|
1593
|
+
{
|
|
1594
|
+
"name": "ProgressDonut",
|
|
1595
|
+
"boundary": "the indicator must be a small circle."
|
|
1596
|
+
},
|
|
1597
|
+
{
|
|
1598
|
+
"name": "Skeleton",
|
|
1599
|
+
"boundary": "the content still loads, and its progress is unknown."
|
|
1600
|
+
}
|
|
1601
|
+
],
|
|
1602
|
+
"useWhen": "Show how much of a task or a quota is complete, as a horizontal bar.",
|
|
1603
|
+
"aliases": [
|
|
1604
|
+
"linear progress",
|
|
1605
|
+
"loading bar",
|
|
1606
|
+
"meter"
|
|
879
1607
|
]
|
|
880
1608
|
},
|
|
881
1609
|
{
|
|
@@ -892,6 +1620,19 @@
|
|
|
892
1620
|
"examples": [
|
|
893
1621
|
"Composition:\n```\nProgressDonut.Root\n└── ProgressDonut.Indicator\n```",
|
|
894
1622
|
"```tsx\n<ProgressDonut.Root aria-label=\"Data transfer out\" value={60}>\n <ProgressDonut.Indicator />\n</ProgressDonut.Root>\n\n<ProgressDonut.Root aria-label=\"Data transfer out\" value={60}>\n <ProgressDonut.Indicator className=\"text-danger-600\" />\n</ProgressDonut.Root>\n```"
|
|
1623
|
+
],
|
|
1624
|
+
"siblings": [
|
|
1625
|
+
{
|
|
1626
|
+
"name": "ProgressBar",
|
|
1627
|
+
"boundary": "the indicator is a horizontal bar."
|
|
1628
|
+
}
|
|
1629
|
+
],
|
|
1630
|
+
"useWhen": "Show how much of a task or a quota is complete, as a small circle.",
|
|
1631
|
+
"aliases": [
|
|
1632
|
+
"circular progress",
|
|
1633
|
+
"progress ring",
|
|
1634
|
+
"progress circle",
|
|
1635
|
+
"radial progress"
|
|
895
1636
|
]
|
|
896
1637
|
},
|
|
897
1638
|
{
|
|
@@ -908,7 +1649,8 @@
|
|
|
908
1649
|
"examples": [
|
|
909
1650
|
"Composition:\n```\nQrCode.Root\n├── QrCode.Frame\n│ └── QrCode.Pattern\n└── QrCode.Overlay\n```",
|
|
910
1651
|
"```tsx\n<QrCode.Root value=\"https://ngrok.com\" ecc=\"H\">\n <QrCode.Frame>\n <QrCode.Pattern />\n </QrCode.Frame>\n <QrCode.Overlay>\n <NgrokLettermarkIcon className=\"size-7\" />\n </QrCode.Overlay>\n</QrCode.Root>\n```"
|
|
911
|
-
]
|
|
1652
|
+
],
|
|
1653
|
+
"useWhen": "Encode a URL or other text as a QR code that a phone camera can scan, with an optional centered logo."
|
|
912
1654
|
},
|
|
913
1655
|
{
|
|
914
1656
|
"name": "Query",
|
|
@@ -943,7 +1685,13 @@
|
|
|
943
1685
|
"boundary": "a palette that runs an action or navigates."
|
|
944
1686
|
}
|
|
945
1687
|
],
|
|
946
|
-
"useWhen": "Filter a list with a typed query of free text and `key:value` qualifiers."
|
|
1688
|
+
"useWhen": "Filter a list with a typed query of free text and `key:value` qualifiers.",
|
|
1689
|
+
"aliases": [
|
|
1690
|
+
"search bar",
|
|
1691
|
+
"search input",
|
|
1692
|
+
"filter bar",
|
|
1693
|
+
"filter syntax"
|
|
1694
|
+
]
|
|
947
1695
|
},
|
|
948
1696
|
{
|
|
949
1697
|
"name": "Radio Group",
|
|
@@ -957,8 +1705,31 @@
|
|
|
957
1705
|
"summary": "A set of checkable buttons (known as radio buttons) where no more than one of the buttons can be checked at a time.",
|
|
958
1706
|
"jsdoc": "A group of radio items.",
|
|
959
1707
|
"examples": [
|
|
960
|
-
"Composition:\n```\n# Default radios\nRadioGroup.Root\n└── RadioGroup.Item\n ├── RadioGroup.Indicator\n └── RadioGroup.ItemContent\n\n# List layout with descriptions\nRadioGroup.List\n└── RadioGroup.ListItem\n ├── RadioGroup.Indicator\n └── RadioGroup.ItemContent\n\n#
|
|
1708
|
+
"Composition:\n```\n# Default radios\nRadioGroup.Root\n└── RadioGroup.Item\n ├── RadioGroup.Indicator\n └── RadioGroup.ItemContent\n\n# List layout with descriptions\nRadioGroup.List\n└── RadioGroup.ListItem\n ├── RadioGroup.Indicator\n └── RadioGroup.ItemContent\n\n# Card-style radios\nRadioGroup.Root\n└── RadioGroup.Card\n └── RadioGroup.Indicator\n\n# Rich option layout (Choice)\nRadioGroup.Root\n└── RadioGroup.Item\n └── Choice.Root\n ├── Choice.Indicator\n │ └── RadioGroup.Indicator\n └── Choice.Content\n ├── Choice.Title\n └── Choice.Description\n```",
|
|
961
1709
|
"```tsx\n<RadioGroup.Root value={value} onChange={setValue}>\n <RadioGroup.Item value=\"option1\">\n <RadioGroup.Indicator />\n <span>Option 1</span>\n </RadioGroup.Item>\n <RadioGroup.Item value=\"option2\">\n <RadioGroup.Indicator />\n <span>Option 2</span>\n </RadioGroup.Item>\n</RadioGroup.Root>\n```"
|
|
1710
|
+
],
|
|
1711
|
+
"siblings": [
|
|
1712
|
+
{
|
|
1713
|
+
"name": "Select",
|
|
1714
|
+
"boundary": "the set is long, or the form has little space."
|
|
1715
|
+
},
|
|
1716
|
+
{
|
|
1717
|
+
"name": "Checkbox",
|
|
1718
|
+
"boundary": "the user picks any number of options."
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
"name": "Choice",
|
|
1722
|
+
"boundary": "each radio needs a title and a description beside it."
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
"name": "SegmentedControl",
|
|
1726
|
+
"boundary": "a few short options switch a view or a mode in one row."
|
|
1727
|
+
}
|
|
1728
|
+
],
|
|
1729
|
+
"useWhen": "Pick exactly one value from a few fixed options, with every option visible at once.",
|
|
1730
|
+
"aliases": [
|
|
1731
|
+
"radio button",
|
|
1732
|
+
"radio"
|
|
962
1733
|
]
|
|
963
1734
|
},
|
|
964
1735
|
{
|
|
@@ -975,6 +1746,26 @@
|
|
|
975
1746
|
"examples": [
|
|
976
1747
|
"Composition:\n```\nSandbar.Root\n├── Sandbar.Message\n└── Sandbar.Actions\n ├── Sandbar.DiscardButton\n └── Sandbar.SaveButton\n```",
|
|
977
1748
|
"```tsx\n<Sandbar.Root open={isDirty} handleRef={sandbarHandle}>\n <Sandbar.Message>You have unsaved changes</Sandbar.Message>\n <Sandbar.Actions>\n <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>\n <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>\n </Sandbar.Actions>\n</Sandbar.Root>\n```"
|
|
1749
|
+
],
|
|
1750
|
+
"siblings": [
|
|
1751
|
+
{
|
|
1752
|
+
"name": "Toast",
|
|
1753
|
+
"boundary": "the message reports something that already happened and goes away on its own."
|
|
1754
|
+
},
|
|
1755
|
+
{
|
|
1756
|
+
"name": "Alert",
|
|
1757
|
+
"boundary": "the message needs no decision and stays in the page."
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
"name": "AlertDialog",
|
|
1761
|
+
"boundary": "one destructive action needs a confirmation before it runs."
|
|
1762
|
+
}
|
|
1763
|
+
],
|
|
1764
|
+
"useWhen": "Hold the unsaved changes of a form in a bar at the bottom of the page until the user saves or discards them.",
|
|
1765
|
+
"aliases": [
|
|
1766
|
+
"save bar",
|
|
1767
|
+
"contextual save bar",
|
|
1768
|
+
"unsaved changes"
|
|
978
1769
|
]
|
|
979
1770
|
},
|
|
980
1771
|
{
|
|
@@ -990,6 +1781,10 @@
|
|
|
990
1781
|
"jsdoc": "A container that prevents the click event from bubbling out of it.",
|
|
991
1782
|
"examples": [
|
|
992
1783
|
"```tsx\n<TableRow onClick={() => navigate(\"/somewhere\")}>\n <TableRowCell>\n <SandboxedOnClick allowClickEventDefault>\n <Anchor href=\"https://ngrok.com/docs\">\n See ngrok docs\n </Anchor>\n </SandboxedOnClick>\n </TableRowCell>\n</TableRow>\n```"
|
|
1784
|
+
],
|
|
1785
|
+
"useWhen": "Stop a click inside a region, such as a menu in a clickable table row, from reaching a click handler on an ancestor.",
|
|
1786
|
+
"aliases": [
|
|
1787
|
+
"stop propagation"
|
|
993
1788
|
]
|
|
994
1789
|
},
|
|
995
1790
|
{
|
|
@@ -1004,8 +1799,60 @@
|
|
|
1004
1799
|
"summary": "A canvas-rendered scatter plot for correlating two continuous measures (three with the rotatable 3D projection).",
|
|
1005
1800
|
"jsdoc": "A canvas-rendered scatter plot for correlating two measures — three with the 3D projection (`zKey`), which renders a rotatable, depth-sorted point cloud (drag to orbit).",
|
|
1006
1801
|
"examples": [
|
|
1007
|
-
"Composition:\n```\nScatterPlot.Root\n├── ScatterPlot.Grid\n├── ScatterPlot.XAxis\n├── ScatterPlot.YAxis\n├── ScatterPlot.Point (one per series)\n├── ScatterPlot.ReferenceLine\n├── ScatterPlot.Tooltip\n├── ScatterPlot.Legend\n└── ScatterPlot.CopyButton\n```",
|
|
1008
|
-
"```tsx\nconst data = [\n { latency: 12, throughputA: 840, throughputB: 720 },\n { latency: 28, throughputA: 610, throughputB: 590 },\n { latency: 45, throughputA: 340, throughputB: 410 },\n];\n\n<ScatterPlot.Root data={data} xKey=\"latency\" aria-label=\"Latency vs throughput\">\n <ScatterPlot.Grid />\n <ScatterPlot.XAxis />\n <ScatterPlot.YAxis />\n <ScatterPlot.Point dataKey=\"throughputA\" label=\"Region A\" />\n <ScatterPlot.Point dataKey=\"throughputB\" label=\"Region B\" />\n <ScatterPlot.Tooltip />\n <ScatterPlot.Legend />\n</ScatterPlot.Root>\n```"
|
|
1802
|
+
"Composition:\n```\nScatterPlot.Root\n├── ScatterPlot.Grid\n├── ScatterPlot.XAxis\n├── ScatterPlot.YAxis\n├── ScatterPlot.Point (one per series)\n├── ScatterPlot.ReferenceLine\n├── ScatterPlot.Tooltip\n├── ScatterPlot.Legend\n└── ScatterPlot.CopyButton\n```\n\nA List groups Roots:\n```\nScatterPlot.List\n└── ScatterPlot.Root (one per chart)\n```",
|
|
1803
|
+
"```tsx\nconst data = [\n { latency: 12, throughputA: 840, throughputB: 720 },\n { latency: 28, throughputA: 610, throughputB: 590 },\n { latency: 45, throughputA: 340, throughputB: 410 },\n];\n\n<ScatterPlot.Root data={data} xKey=\"latency\" aria-label=\"Latency vs throughput\">\n <ScatterPlot.Grid />\n <ScatterPlot.XAxis />\n <ScatterPlot.YAxis />\n <ScatterPlot.Point dataKey=\"throughputA\" label=\"Region A\" color=\"blue\" />\n <ScatterPlot.Point dataKey=\"throughputB\" label=\"Region B\" color=\"emerald\" />\n <ScatterPlot.Tooltip />\n <ScatterPlot.Legend />\n</ScatterPlot.Root>\n```"
|
|
1804
|
+
],
|
|
1805
|
+
"siblings": [
|
|
1806
|
+
{
|
|
1807
|
+
"name": "LineChart",
|
|
1808
|
+
"boundary": "one measure trends across an ordered x axis, such as time."
|
|
1809
|
+
},
|
|
1810
|
+
{
|
|
1811
|
+
"name": "BarChart",
|
|
1812
|
+
"boundary": "values compare across categories."
|
|
1813
|
+
}
|
|
1814
|
+
],
|
|
1815
|
+
"useWhen": "Show how two measures correlate across many points, or three measures in a rotatable 3D view.",
|
|
1816
|
+
"aliases": [
|
|
1817
|
+
"scatter chart",
|
|
1818
|
+
"scatter graph"
|
|
1819
|
+
]
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
"name": "Segmented Control",
|
|
1823
|
+
"slug": "components/forms/segmented-control",
|
|
1824
|
+
"kind": "component",
|
|
1825
|
+
"category": "Forms",
|
|
1826
|
+
"status": "stable",
|
|
1827
|
+
"importPath": "@ngrok/mantle/segmented-control",
|
|
1828
|
+
"docsUrl": "https://mantle.ngrok.com/components/forms/segmented-control",
|
|
1829
|
+
"markdownUrl": "https://mantle.ngrok.com/components/forms/segmented-control.md",
|
|
1830
|
+
"summary": "A row of segments that switches between a few short options, like a view or an environment. A raised thumb slides to the checked segment.",
|
|
1831
|
+
"jsdoc": "A row of segments that switches between a few short options, like a view or an environment.",
|
|
1832
|
+
"examples": [
|
|
1833
|
+
"Composition:\n```\nSegmentedControl.Root\n└── SegmentedControl.Item\n```",
|
|
1834
|
+
"```tsx\n<SegmentedControl.Root aria-label=\"Environment\" defaultValue=\"production\">\n <SegmentedControl.Item value=\"development\">Dev</SegmentedControl.Item>\n <SegmentedControl.Item value=\"staging\">Staging</SegmentedControl.Item>\n <SegmentedControl.Item value=\"production\">Prod</SegmentedControl.Item>\n</SegmentedControl.Root>\n```"
|
|
1835
|
+
],
|
|
1836
|
+
"siblings": [
|
|
1837
|
+
{
|
|
1838
|
+
"name": "RadioGroup",
|
|
1839
|
+
"boundary": "a form field whose options need a description, or stack in a column."
|
|
1840
|
+
},
|
|
1841
|
+
{
|
|
1842
|
+
"name": "Tabs",
|
|
1843
|
+
"boundary": "each option shows its own panel of content."
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
"name": "Select",
|
|
1847
|
+
"boundary": "the set is long, or the row has little space."
|
|
1848
|
+
}
|
|
1849
|
+
],
|
|
1850
|
+
"useWhen": "Switch between a few short options, like a view or an environment, in one row.",
|
|
1851
|
+
"aliases": [
|
|
1852
|
+
"segmented button",
|
|
1853
|
+
"view switcher",
|
|
1854
|
+
"toggle group",
|
|
1855
|
+
"button group radio"
|
|
1009
1856
|
]
|
|
1010
1857
|
},
|
|
1011
1858
|
{
|
|
@@ -1023,8 +1870,28 @@
|
|
|
1023
1870
|
"Composition:\n```\nSelect.Root\n├── Select.Trigger\n│ └── Select.Value\n└── Select.Content\n ├── Select.Group\n │ ├── Select.Label\n │ └── Select.Item\n └── Select.Separator\n```",
|
|
1024
1871
|
"```tsx\n<Select.Root>\n <Select.Trigger>\n <Select.Value placeholder=\"Select a fruit\" />\n </Select.Trigger>\n <Select.Content>\n <Select.Group>\n <Select.Label>Fruits</Select.Label>\n <Select.Item value=\"apple\">Apple</Select.Item>\n <Select.Item value=\"banana\">Banana</Select.Item>\n <Select.Item value=\"cherry\">Cherry</Select.Item>\n </Select.Group>\n <Select.Separator />\n <Select.Group>\n <Select.Label>Veggies</Select.Label>\n <Select.Item value=\"carrot\">Carrot</Select.Item>\n <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n </Select.Group>\n </Select.Content>\n</Select.Root>\n```"
|
|
1025
1872
|
],
|
|
1873
|
+
"siblings": [
|
|
1874
|
+
{
|
|
1875
|
+
"name": "Combobox",
|
|
1876
|
+
"boundary": "the list is long or loads from a server, and the user types to filter it."
|
|
1877
|
+
},
|
|
1878
|
+
{
|
|
1879
|
+
"name": "MultiSelect",
|
|
1880
|
+
"boundary": "the user picks several values."
|
|
1881
|
+
},
|
|
1882
|
+
{
|
|
1883
|
+
"name": "RadioGroup",
|
|
1884
|
+
"boundary": "the options are few and must all show at once."
|
|
1885
|
+
},
|
|
1886
|
+
{
|
|
1887
|
+
"name": "DropdownMenu",
|
|
1888
|
+
"boundary": "the list runs actions and sets no value."
|
|
1889
|
+
}
|
|
1890
|
+
],
|
|
1891
|
+
"useWhen": "Pick one value from a short, fixed list of options that needs no filter.",
|
|
1026
1892
|
"aliases": [
|
|
1027
|
-
"dropdown"
|
|
1893
|
+
"dropdown",
|
|
1894
|
+
"select box"
|
|
1028
1895
|
]
|
|
1029
1896
|
},
|
|
1030
1897
|
{
|
|
@@ -1041,6 +1908,21 @@
|
|
|
1041
1908
|
"examples": [
|
|
1042
1909
|
"Composition:\n```\nSelectableList.Root\n├── SelectableList.Filter\n├── SelectableList.SelectAll\n├── SelectableList.Viewport (or .VirtualViewport)\n│ └── SelectableList.Item (optional render-prop; auto-rendered by default)\n│ ├── SelectableList.ItemTitle\n│ └── SelectableList.ItemDescription\n└── SelectableList.Empty\n```",
|
|
1043
1910
|
"```tsx\nconst options = accessKeys.map((key) => ({\n value: key.id,\n label: key.name,\n description: key.maskedToken,\n}));\n\n<SelectableList.Root options={options} value={selected} onValueChange={setSelected}>\n <SelectableList.Filter placeholder=\"Filter access keys…\" />\n <SelectableList.SelectAll>Select all</SelectableList.SelectAll>\n <SelectableList.Viewport aria-label=\"Access keys\" className=\"max-h-80\" />\n <SelectableList.Empty>No access keys found.</SelectableList.Empty>\n</SelectableList.Root>\n```"
|
|
1911
|
+
],
|
|
1912
|
+
"siblings": [
|
|
1913
|
+
{
|
|
1914
|
+
"name": "MultiSelect",
|
|
1915
|
+
"boundary": "the options open in a popover, and the picks show as tags."
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
"name": "List",
|
|
1919
|
+
"boundary": "each row runs an action or navigates, with no selection."
|
|
1920
|
+
}
|
|
1921
|
+
],
|
|
1922
|
+
"useWhen": "Select several items from an inline, filterable list of checkbox rows, with no popover.",
|
|
1923
|
+
"aliases": [
|
|
1924
|
+
"checkbox list",
|
|
1925
|
+
"checklist"
|
|
1044
1926
|
]
|
|
1045
1927
|
},
|
|
1046
1928
|
{
|
|
@@ -1071,7 +1953,12 @@
|
|
|
1071
1953
|
"boundary": "the content is key and value pairs, which carry their own rows."
|
|
1072
1954
|
}
|
|
1073
1955
|
],
|
|
1074
|
-
"useWhen": "Divide adjacent content without a box, in a row or in a column."
|
|
1956
|
+
"useWhen": "Divide adjacent content without a box, in a row or in a column. To put a text label in the middle or at one end of a horizontal divider, wrap the label and the separators in a `HorizontalSeparatorGroup`.",
|
|
1957
|
+
"aliases": [
|
|
1958
|
+
"divider",
|
|
1959
|
+
"horizontal rule",
|
|
1960
|
+
"hr"
|
|
1961
|
+
]
|
|
1075
1962
|
},
|
|
1076
1963
|
{
|
|
1077
1964
|
"name": "Sheet",
|
|
@@ -1089,9 +1976,26 @@
|
|
|
1089
1976
|
"```tsx\n// Triggering a stateful sheet\n<Sheet.Root>\n <Sheet.Trigger asChild>\n <Button type=\"button\" appearance=\"filled\" intent=\"neutral\">\n Open Sheet\n </Button>\n </Sheet.Trigger>\n <Sheet.Content>\n <Sheet.Header>\n <Sheet.TitleGroup>\n <Sheet.Title>Are you absolutely sure?</Sheet.Title>\n <Sheet.Actions>\n <IconButton\n appearance=\"ghost\"\n intent=\"neutral\"\n type=\"button\"\n icon={<TrashSimple />}\n label=\"Delete\"\n />\n <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n <Sheet.CloseIconButton />\n </Sheet.Actions>\n </Sheet.TitleGroup>\n <Sheet.Description>\n This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n </Sheet.Description>\n </Sheet.Header>\n <Sheet.Body>\n <p>\n Consequat do voluptate culpa fugiat consequat nostrud duis\n aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n proident amet.\n </p>\n </Sheet.Body>\n <Sheet.Footer>\n <Sheet.Close asChild>\n <Button type=\"button\" appearance=\"outlined\" intent=\"neutral\">Close</Button>\n </Sheet.Close>\n <Button type=\"button\" appearance=\"filled\" intent=\"neutral\">\n Save\n </Button>\n </Sheet.Footer>\n </Sheet.Content>\n</Sheet.Root>\n```",
|
|
1090
1977
|
"```tsx\n// Sheet without a trigger (e.g. router controlled)\n<Sheet.Root open onOpenChange={() => onClose()}>\n <Sheet.Content>\n <Sheet.Header>\n <Sheet.TitleGroup>\n <Sheet.Title>Are you absolutely sure?</Sheet.Title>\n <Sheet.Actions>\n <IconButton\n appearance=\"ghost\"\n intent=\"neutral\"\n type=\"button\"\n icon={<TrashSimple />}\n label=\"Delete\"\n />\n <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n <Sheet.CloseIconButton />\n </Sheet.Actions>\n </Sheet.TitleGroup>\n <Sheet.Description>\n This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n </Sheet.Description>\n </Sheet.Header>\n <Sheet.Body>\n <p>\n Consequat do voluptate culpa fugiat consequat nostrud duis\n aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n proident amet.\n </p>\n </Sheet.Body>\n <Sheet.Footer>\n <Sheet.Close asChild>\n <Button type=\"button\" appearance=\"outlined\" intent=\"neutral\">Close</Button>\n </Sheet.Close>\n <Button type=\"button\" appearance=\"filled\" intent=\"neutral\">\n Save\n </Button>\n </Sheet.Footer>\n </Sheet.Content>\n</Sheet.Root>\n```"
|
|
1091
1978
|
],
|
|
1979
|
+
"siblings": [
|
|
1980
|
+
{
|
|
1981
|
+
"name": "Dialog",
|
|
1982
|
+
"boundary": "the task fits a centered modal window."
|
|
1983
|
+
},
|
|
1984
|
+
{
|
|
1985
|
+
"name": "AlertDialog",
|
|
1986
|
+
"boundary": "the user must confirm a destructive or irreversible action."
|
|
1987
|
+
},
|
|
1988
|
+
{
|
|
1989
|
+
"name": "Sidebar",
|
|
1990
|
+
"boundary": "the panel holds the persistent navigation of the app."
|
|
1991
|
+
}
|
|
1992
|
+
],
|
|
1993
|
+
"useWhen": "Open a panel from the edge of the screen for a task beside the current view, such as a filter panel, a detail view, or a mobile menu.",
|
|
1092
1994
|
"aliases": [
|
|
1093
1995
|
"drawer",
|
|
1094
|
-
"side panel"
|
|
1996
|
+
"side panel",
|
|
1997
|
+
"offcanvas",
|
|
1998
|
+
"slide over"
|
|
1095
1999
|
]
|
|
1096
2000
|
},
|
|
1097
2001
|
{
|
|
@@ -1108,6 +2012,26 @@
|
|
|
1108
2012
|
"examples": [
|
|
1109
2013
|
"Composition:\n```\nSidebar.Root\n├── Sidebar.Nav\n│ ├── Sidebar.Header\n│ │ └── Sidebar.SwitcherTrigger\n│ ├── Sidebar.Body\n│ │ ├── Sidebar.SearchTrigger\n│ │ └── Sidebar.Group\n│ │ ├── Sidebar.GroupLabel\n│ │ └── Sidebar.List\n│ │ └── Sidebar.Item\n│ │ └── Sidebar.Tooltip\n│ │ └── Sidebar.ItemButton\n│ └── Sidebar.Footer\n│ ├── Sidebar.ItemButton\n│ ├── Sidebar.Separator\n│ └── Sidebar.SwitcherTrigger\n└── Sidebar.Trigger\n```",
|
|
1110
2014
|
"```tsx\n<Sidebar.Root>\n <Sidebar.Nav aria-label=\"Main\">\n <Sidebar.Header>\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <Sidebar.SwitcherTrigger>\n <GlobeIcon />\n <span className=\"text-strong min-w-0 flex-1 truncate text-base\">Universal Gateway</span>\n <CaretDownIcon className=\"text-muted size-4 shrink-0\" />\n </Sidebar.SwitcherTrigger>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content width=\"trigger\" className=\"min-w-(--sidebar-row-width)\">…</DropdownMenu.Content>\n </DropdownMenu.Root>\n </Sidebar.Header>\n <Sidebar.Body>\n <Sidebar.Group>\n <Sidebar.GroupLabel>Traffic</Sidebar.GroupLabel>\n <Sidebar.List>\n <Sidebar.Item>\n <Sidebar.ItemButton asChild current>\n <a href=\"/endpoints\">\n <GraphIcon />\n Endpoints\n </a>\n </Sidebar.ItemButton>\n </Sidebar.Item>\n </Sidebar.List>\n </Sidebar.Group>\n </Sidebar.Body>\n <Sidebar.Footer>\n <Sidebar.Separator />\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <Sidebar.SwitcherTrigger>\n <Avatar.Root appearance=\"square\" colorSeed=\"acc_123\">\n <Avatar.Fallback name=\"Acme Corp\" />\n </Avatar.Root>\n <span className=\"text-strong min-w-0 flex-1 truncate text-sm font-medium\">Acme Corp</span>\n </Sidebar.SwitcherTrigger>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content width=\"trigger\" className=\"min-w-(--sidebar-row-width)\">…</DropdownMenu.Content>\n </DropdownMenu.Root>\n </Sidebar.Footer>\n </Sidebar.Nav>\n <Sidebar.Trigger />\n</Sidebar.Root>\n```"
|
|
2015
|
+
],
|
|
2016
|
+
"siblings": [
|
|
2017
|
+
{
|
|
2018
|
+
"name": "Tabs",
|
|
2019
|
+
"boundary": "the user switches between views inside one page."
|
|
2020
|
+
},
|
|
2021
|
+
{
|
|
2022
|
+
"name": "Sheet",
|
|
2023
|
+
"boundary": "a panel opens over the page for a task, not for navigation."
|
|
2024
|
+
},
|
|
2025
|
+
{
|
|
2026
|
+
"name": "Breadcrumb",
|
|
2027
|
+
"boundary": "the page shows where it sits in a hierarchy."
|
|
2028
|
+
}
|
|
2029
|
+
],
|
|
2030
|
+
"useWhen": "Show the main navigation of an app, with its app and account switchers, in a column that collapses to an icon rail, and to a sheet on small screens.",
|
|
2031
|
+
"aliases": [
|
|
2032
|
+
"side nav",
|
|
2033
|
+
"side navigation",
|
|
2034
|
+
"navigation drawer"
|
|
1111
2035
|
]
|
|
1112
2036
|
},
|
|
1113
2037
|
{
|
|
@@ -1123,6 +2047,22 @@
|
|
|
1123
2047
|
"jsdoc": "A skeleton is a placeholder for content that is loading.",
|
|
1124
2048
|
"examples": [
|
|
1125
2049
|
"```tsx\nimport { Skeleton } from \"@ngrok/mantle/skeleton\";\n\n// Text-line placeholder.\n<Skeleton className=\"w-1/2\" />\n\n// Avatar placeholder.\n<Skeleton className=\"h-12 w-12 rounded-full\" />\n\n// Announce loading state to assistive tech.\n<div role=\"status\" aria-live=\"polite\">\n <span className=\"sr-only\">Loading profile…</span>\n <Skeleton className=\"h-12 w-12 rounded-full\" />\n</div>\n```"
|
|
2050
|
+
],
|
|
2051
|
+
"siblings": [
|
|
2052
|
+
{
|
|
2053
|
+
"name": "Empty",
|
|
2054
|
+
"boundary": "the region loaded and has no data, no results, or no access to show."
|
|
2055
|
+
},
|
|
2056
|
+
{
|
|
2057
|
+
"name": "ProgressBar",
|
|
2058
|
+
"boundary": "a task shows how much of it is complete."
|
|
2059
|
+
}
|
|
2060
|
+
],
|
|
2061
|
+
"useWhen": "Hold the place of content while it loads, in the shape that the content will take.",
|
|
2062
|
+
"aliases": [
|
|
2063
|
+
"shimmer",
|
|
2064
|
+
"loading placeholder",
|
|
2065
|
+
"content loader"
|
|
1126
2066
|
]
|
|
1127
2067
|
},
|
|
1128
2068
|
{
|
|
@@ -1138,6 +2078,21 @@
|
|
|
1138
2078
|
"jsdoc": "A visually-hidden-until-focused \"skip link\" that lets keyboard users jump past repeated navigation and land directly on the page's main content landmark.",
|
|
1139
2079
|
"examples": [
|
|
1140
2080
|
"```tsx\n<SkipToMainLink />\n<Header />\n<Main>\n <h1>Page title</h1>\n</Main>\n```"
|
|
2081
|
+
],
|
|
2082
|
+
"siblings": [
|
|
2083
|
+
{
|
|
2084
|
+
"name": "Main",
|
|
2085
|
+
"boundary": "the page needs the focusable `<main>` landmark that the link targets."
|
|
2086
|
+
},
|
|
2087
|
+
{
|
|
2088
|
+
"name": "VisuallyHidden",
|
|
2089
|
+
"boundary": "the hidden content is text for screen readers, not a link."
|
|
2090
|
+
}
|
|
2091
|
+
],
|
|
2092
|
+
"useWhen": "Let keyboard users jump past repeated navigation to the main content of the page.",
|
|
2093
|
+
"aliases": [
|
|
2094
|
+
"skip link",
|
|
2095
|
+
"skip nav"
|
|
1141
2096
|
]
|
|
1142
2097
|
},
|
|
1143
2098
|
{
|
|
@@ -1155,6 +2110,17 @@
|
|
|
1155
2110
|
"```tsx\n// single thumb\n<Slider\n aria-label=\"Volume\"\n defaultValue={75}\n max={100}\n step={1}\n/>\n```",
|
|
1156
2111
|
"```tsx\n// range\n <Slider\n aria-label=\"Price\"\n defaultValue={[25, 50]}\n max={100}\n step={5}\n />\n```",
|
|
1157
2112
|
"```tsx\n// multiple thumbs\n<Slider\n aria-label=\"Breakpoint\"\n defaultValue={[10, 20, 70]}\n max={100}\n step={10}\n />\n```"
|
|
2113
|
+
],
|
|
2114
|
+
"siblings": [
|
|
2115
|
+
{
|
|
2116
|
+
"name": "Input",
|
|
2117
|
+
"boundary": "the user types an exact number."
|
|
2118
|
+
}
|
|
2119
|
+
],
|
|
2120
|
+
"useWhen": "Pick a number, or a range between two numbers, with a thumb that moves along a track.",
|
|
2121
|
+
"aliases": [
|
|
2122
|
+
"range slider",
|
|
2123
|
+
"range input"
|
|
1158
2124
|
]
|
|
1159
2125
|
},
|
|
1160
2126
|
{
|
|
@@ -1170,6 +2136,11 @@
|
|
|
1170
2136
|
"jsdoc": "Merges its props onto its immediate child.",
|
|
1171
2137
|
"examples": [
|
|
1172
2138
|
"```tsx\n<Slot className=\"custom-class\">\n <a href=\"/\">Home</a>\n</Slot>\n```"
|
|
2139
|
+
],
|
|
2140
|
+
"useWhen": "Merge the props of a part onto its one child element, to build an `asChild` prop.",
|
|
2141
|
+
"aliases": [
|
|
2142
|
+
"as child",
|
|
2143
|
+
"polymorphic"
|
|
1173
2144
|
]
|
|
1174
2145
|
},
|
|
1175
2146
|
{
|
|
@@ -1186,6 +2157,22 @@
|
|
|
1186
2157
|
"examples": [
|
|
1187
2158
|
"Composition:\n```\nSplitButton.Root\n├── SplitButton.PrimaryAction\n├── SplitButton.MenuTrigger\n└── SplitButton.MenuContent\n └── SplitButton.MenuItem\n```",
|
|
1188
2159
|
"```tsx\n<SplitButton.Root>\n <SplitButton.PrimaryAction icon={<CopyIcon />} onClick={copyMarkdownPage}>\n Copy page\n </SplitButton.PrimaryAction>\n <SplitButton.MenuTrigger label=\"Open doc actions menu\" />\n <SplitButton.MenuContent>\n <SplitButton.MenuItem onClick={copyMarkdownPage}>\n <Icon svg={<CopyIcon />} />\n Copy page\n </SplitButton.MenuItem>\n <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>\n <a href={markdownUrl} target=\"_blank\" rel=\"noopener noreferrer\">\n <Icon svg={<FileTextIcon />} />\n View as Markdown\n </a>\n </SplitButton.MenuItem>\n </SplitButton.MenuContent>\n</SplitButton.Root>\n```"
|
|
2160
|
+
],
|
|
2161
|
+
"siblings": [
|
|
2162
|
+
{
|
|
2163
|
+
"name": "Button",
|
|
2164
|
+
"boundary": "the control runs one action, with no alternatives."
|
|
2165
|
+
},
|
|
2166
|
+
{
|
|
2167
|
+
"name": "DropdownMenu",
|
|
2168
|
+
"boundary": "the button only opens a menu and runs no default action."
|
|
2169
|
+
}
|
|
2170
|
+
],
|
|
2171
|
+
"useWhen": "Run a default action on one click, and offer related alternatives in an attached menu.",
|
|
2172
|
+
"aliases": [
|
|
2173
|
+
"dropdown button",
|
|
2174
|
+
"split dropdown",
|
|
2175
|
+
"combo button"
|
|
1189
2176
|
]
|
|
1190
2177
|
},
|
|
1191
2178
|
{
|
|
@@ -1202,6 +2189,25 @@
|
|
|
1202
2189
|
"examples": [
|
|
1203
2190
|
"Composition:\n```\nStrata.Root\n└── Strata.Section\n ├── Strata.Header\n │ ├── Strata.Title\n │ └── Strata.Description\n └── Strata.Body\n```",
|
|
1204
2191
|
"```tsx\n<Strata.Root>\n <Strata.Section>\n <Strata.Header>\n <Strata.Title>Providers</Strata.Title>\n <Strata.Description>What providers keys may call.</Strata.Description>\n </Strata.Header>\n <Strata.Body>\n <ProviderScopePicker />\n </Strata.Body>\n </Strata.Section>\n <Strata.Section>\n <Strata.Header>\n <Strata.Title>Routing rules</Strata.Title>\n <Strata.Description>Define how requests are authenticated.</Strata.Description>\n </Strata.Header>\n <Strata.Body>\n <RoutingRuleList />\n </Strata.Body>\n </Strata.Section>\n</Strata.Root>\n```"
|
|
2192
|
+
],
|
|
2193
|
+
"siblings": [
|
|
2194
|
+
{
|
|
2195
|
+
"name": "Card",
|
|
2196
|
+
"boundary": "a group needs a raised surface of its own."
|
|
2197
|
+
},
|
|
2198
|
+
{
|
|
2199
|
+
"name": "MediaObject",
|
|
2200
|
+
"boundary": "the thing beside the text is an image or an icon."
|
|
2201
|
+
},
|
|
2202
|
+
{
|
|
2203
|
+
"name": "DescriptionList",
|
|
2204
|
+
"boundary": "the pairs are read-only label and value data, not headed sections."
|
|
2205
|
+
}
|
|
2206
|
+
],
|
|
2207
|
+
"useWhen": "Lay out a settings page or a configuration editor as titled sections, each one explained beside its controls.",
|
|
2208
|
+
"aliases": [
|
|
2209
|
+
"settings page",
|
|
2210
|
+
"settings layout"
|
|
1205
2211
|
]
|
|
1206
2212
|
},
|
|
1207
2213
|
{
|
|
@@ -1218,8 +2224,24 @@
|
|
|
1218
2224
|
"examples": [
|
|
1219
2225
|
"```tsx\n<form>\n <Label htmlFor=\"airplane-mode\" className=\"flex items-center gap-2\">\n Airplane Mode\n <Switch name=\"airplane-mode\" id=\"airplane-mode\" />\n </Label>\n</form>\n```"
|
|
1220
2226
|
],
|
|
2227
|
+
"siblings": [
|
|
2228
|
+
{
|
|
2229
|
+
"name": "Checkbox",
|
|
2230
|
+
"boundary": "the option needs an indeterminate state."
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
"name": "Choice",
|
|
2234
|
+
"boundary": "the switch needs a title and a description beside it."
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
"name": "ThemeSwitcher",
|
|
2238
|
+
"boundary": "the setting is the light or dark theme."
|
|
2239
|
+
}
|
|
2240
|
+
],
|
|
2241
|
+
"useWhen": "Turn one setting on or off, such as a feature toggle in a settings list.",
|
|
1221
2242
|
"aliases": [
|
|
1222
|
-
"toggle"
|
|
2243
|
+
"toggle",
|
|
2244
|
+
"toggle switch"
|
|
1223
2245
|
]
|
|
1224
2246
|
},
|
|
1225
2247
|
{
|
|
@@ -1236,6 +2258,21 @@
|
|
|
1236
2258
|
"examples": [
|
|
1237
2259
|
"Composition:\n```\nTable.Root\n└── Table.Element\n ├── Table.Caption\n ├── Table.Head\n │ └── Table.Row\n │ └── Table.Header\n ├── Table.Body\n │ └── Table.Row\n │ └── Table.Cell\n └── Table.Foot\n```",
|
|
1238
2260
|
"```tsx\n<Table.Root>\n <Table.Element>\n <Table.Caption>A list of your recent invoices.</Table.Caption>\n <Table.Head>\n <Table.Row>\n <Table.Header className=\"w-25\">Invoice</Table.Header>\n <Table.Header>Status</Table.Header>\n <Table.Header>Method</Table.Header>\n <Table.Header className=\"text-right\">Amount</Table.Header>\n </Table.Row>\n </Table.Head>\n <Table.Body>\n {invoices.map((invoice) => (\n <Table.Row key={invoice.invoice}>\n <Table.Cell className=\"font-medium\">{invoice.invoice}</Table.Cell>\n <Table.Cell>{invoice.paymentStatus}</Table.Cell>\n <Table.Cell>{invoice.paymentMethod}</Table.Cell>\n <Table.Cell className=\"text-right\">{invoice.totalAmount}</Table.Cell>\n </Table.Row>\n ))}\n </Table.Body>\n <Table.Foot>\n <Table.Row>\n <Table.Cell colSpan={3}>Total</Table.Cell>\n <Table.Cell className=\"text-right\">$2,500.00</Table.Cell>\n </Table.Row>\n </Table.Foot>\n </Table.Element>\n</Table.Root>\n```"
|
|
2261
|
+
],
|
|
2262
|
+
"siblings": [
|
|
2263
|
+
{
|
|
2264
|
+
"name": "DataTable",
|
|
2265
|
+
"boundary": "the user sorts, filters, pages through, or selects the rows."
|
|
2266
|
+
},
|
|
2267
|
+
{
|
|
2268
|
+
"name": "DescriptionList",
|
|
2269
|
+
"boundary": "one record shows as label and value pairs."
|
|
2270
|
+
}
|
|
2271
|
+
],
|
|
2272
|
+
"useWhen": "Show static rows and columns of data, such as a read-only data dump, with no sorting, filtering, or pagination.",
|
|
2273
|
+
"aliases": [
|
|
2274
|
+
"html table",
|
|
2275
|
+
"basic table"
|
|
1239
2276
|
]
|
|
1240
2277
|
},
|
|
1241
2278
|
{
|
|
@@ -1252,6 +2289,22 @@
|
|
|
1252
2289
|
"examples": [
|
|
1253
2290
|
"Composition:\n```\nTabs.Root\n├── Tabs.List\n│ └── Tabs.Trigger\n│ └── Tabs.Badge\n├── Tabs.Separator\n└── Tabs.Content\n```",
|
|
1254
2291
|
"```tsx\n<Tabs.Root defaultValue=\"account\">\n <Tabs.List>\n <Tabs.Trigger value=\"account\">Account</Tabs.Trigger>\n <Tabs.Trigger value=\"password\">Password</Tabs.Trigger>\n </Tabs.List>\n <Tabs.Separator />\n <Tabs.Content value=\"account\">\n <p>Make changes to your account here.</p>\n </Tabs.Content>\n <Tabs.Content value=\"password\">\n <p>Change your password here.</p>\n </Tabs.Content>\n</Tabs.Root>\n```"
|
|
2292
|
+
],
|
|
2293
|
+
"siblings": [
|
|
2294
|
+
{
|
|
2295
|
+
"name": "Accordion",
|
|
2296
|
+
"boundary": "several sections stack, and each one expands in place."
|
|
2297
|
+
},
|
|
2298
|
+
{
|
|
2299
|
+
"name": "RadioGroup",
|
|
2300
|
+
"boundary": "the user picks a form value, not a view."
|
|
2301
|
+
}
|
|
2302
|
+
],
|
|
2303
|
+
"useWhen": "Switch between peer views of related content in one place, with one view visible at a time.",
|
|
2304
|
+
"aliases": [
|
|
2305
|
+
"tab bar",
|
|
2306
|
+
"tab list",
|
|
2307
|
+
"tab strip"
|
|
1255
2308
|
]
|
|
1256
2309
|
},
|
|
1257
2310
|
{
|
|
@@ -1267,6 +2320,17 @@
|
|
|
1267
2320
|
"jsdoc": "A multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form.",
|
|
1268
2321
|
"examples": [
|
|
1269
2322
|
"```tsx\n<form>\n <div>\n <Label htmlFor=\"feedback\">Feedback:</Label>\n <TextArea\n id=\"feedback\"\n name=\"feedback\"\n placeholder=\"Enter your feedback here\"\n />\n </div>\n</form>\n```"
|
|
2323
|
+
],
|
|
2324
|
+
"siblings": [
|
|
2325
|
+
{
|
|
2326
|
+
"name": "Input",
|
|
2327
|
+
"boundary": "the text fits on one line."
|
|
2328
|
+
}
|
|
2329
|
+
],
|
|
2330
|
+
"useWhen": "Accept several lines of free-form text, such as a comment or a description.",
|
|
2331
|
+
"aliases": [
|
|
2332
|
+
"multiline input",
|
|
2333
|
+
"multiline text field"
|
|
1270
2334
|
]
|
|
1271
2335
|
},
|
|
1272
2336
|
{
|
|
@@ -1279,7 +2343,18 @@
|
|
|
1279
2343
|
"docsUrl": "https://mantle.ngrok.com/components/primitives/theme",
|
|
1280
2344
|
"markdownUrl": "https://mantle.ngrok.com/components/primitives/theme.md",
|
|
1281
2345
|
"summary": "Theme primitives (ThemeProvider and FOUC prevention) for light and dark modes that follow the OS by default.",
|
|
1282
|
-
"jsdoc": "Re-exports for the Theme component — the provider and hooks that carry the applied theme, plus the document tags that stop a wrong-theme flash."
|
|
2346
|
+
"jsdoc": "Re-exports for the Theme component — the provider and hooks that carry the applied theme, plus the document tags that stop a wrong-theme flash.",
|
|
2347
|
+
"siblings": [
|
|
2348
|
+
{
|
|
2349
|
+
"name": "ThemeSwitcher",
|
|
2350
|
+
"boundary": "the user changes the theme from a control in the UI."
|
|
2351
|
+
}
|
|
2352
|
+
],
|
|
2353
|
+
"useWhen": "Apply the light or dark theme to an app, follow the operating system by default, and stop a wrong-theme flash on load.",
|
|
2354
|
+
"aliases": [
|
|
2355
|
+
"theme provider",
|
|
2356
|
+
"color scheme"
|
|
2357
|
+
]
|
|
1283
2358
|
},
|
|
1284
2359
|
{
|
|
1285
2360
|
"name": "Theme Switcher",
|
|
@@ -1295,6 +2370,18 @@
|
|
|
1295
2370
|
"examples": [
|
|
1296
2371
|
"```tsx\n<ThemeProvider>\n <header>\n <ThemeSwitcher />\n </header>\n</ThemeProvider>\n```",
|
|
1297
2372
|
"```tsx\n<ThemeSwitcher appearance=\"outlined\" label=\"Cambiar tema\" />\n```"
|
|
2373
|
+
],
|
|
2374
|
+
"siblings": [
|
|
2375
|
+
{
|
|
2376
|
+
"name": "Switch",
|
|
2377
|
+
"boundary": "the toggle controls a setting other than the theme."
|
|
2378
|
+
}
|
|
2379
|
+
],
|
|
2380
|
+
"useWhen": "Let the user switch between light and dark mode from a header, a toolbar, or an account menu.",
|
|
2381
|
+
"aliases": [
|
|
2382
|
+
"theme toggle",
|
|
2383
|
+
"dark mode toggle",
|
|
2384
|
+
"color mode toggle"
|
|
1298
2385
|
]
|
|
1299
2386
|
},
|
|
1300
2387
|
{
|
|
@@ -1312,9 +2399,26 @@
|
|
|
1312
2399
|
"Composition:\n```\nToast.Root\n├── Toast.Icon\n├── Toast.Message\n└── Toast.Action\n```",
|
|
1313
2400
|
"```tsx\nmakeToast(\n <Toast.Root intent=\"success\">\n <Toast.Icon />\n <Toast.Message>Operation completed successfully!</Toast.Message>\n <Toast.Action>Dismiss</Toast.Action>\n </Toast.Root>\n);\n```"
|
|
1314
2401
|
],
|
|
2402
|
+
"siblings": [
|
|
2403
|
+
{
|
|
2404
|
+
"name": "Alert",
|
|
2405
|
+
"boundary": "the message stays in the page next to the content it describes."
|
|
2406
|
+
},
|
|
2407
|
+
{
|
|
2408
|
+
"name": "AlertDialog",
|
|
2409
|
+
"boundary": "the user must respond before they continue."
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
"name": "Sandbar",
|
|
2413
|
+
"boundary": "the message waits for the user to save or discard pending changes."
|
|
2414
|
+
}
|
|
2415
|
+
],
|
|
2416
|
+
"useWhen": "Report the result of an action, such as a save or a copy, in a brief message that goes away on its own.",
|
|
1315
2417
|
"aliases": [
|
|
1316
2418
|
"notification",
|
|
1317
|
-
"snackbar"
|
|
2419
|
+
"snackbar",
|
|
2420
|
+
"toaster",
|
|
2421
|
+
"flash message"
|
|
1318
2422
|
]
|
|
1319
2423
|
},
|
|
1320
2424
|
{
|
|
@@ -1331,6 +2435,20 @@
|
|
|
1331
2435
|
"examples": [
|
|
1332
2436
|
"Composition:\n```\nTooltip.Root\n├── Tooltip.Trigger\n└── Tooltip.Content\n```",
|
|
1333
2437
|
"```tsx\n<Tooltip.Root>\n <Tooltip.Trigger asChild>\n <Button type=\"button\" appearance=\"outlined\" intent=\"neutral\">\n Hover me\n </Button>\n </Tooltip.Trigger>\n <Tooltip.Content>\n This is a tooltip\n </Tooltip.Content>\n</Tooltip.Root>\n```"
|
|
2438
|
+
],
|
|
2439
|
+
"siblings": [
|
|
2440
|
+
{
|
|
2441
|
+
"name": "Popover",
|
|
2442
|
+
"boundary": "the content is interactive, such as a form or a settings menu."
|
|
2443
|
+
},
|
|
2444
|
+
{
|
|
2445
|
+
"name": "HoverCard",
|
|
2446
|
+
"boundary": "the content is a rich preview of a link."
|
|
2447
|
+
}
|
|
2448
|
+
],
|
|
2449
|
+
"useWhen": "Show a short, non-interactive hint for an element on hover or focus, such as the meaning of an icon button.",
|
|
2450
|
+
"aliases": [
|
|
2451
|
+
"hint"
|
|
1334
2452
|
]
|
|
1335
2453
|
},
|
|
1336
2454
|
{
|
|
@@ -1357,7 +2475,12 @@
|
|
|
1357
2475
|
"boundary": "a value that may wrap over several lines."
|
|
1358
2476
|
}
|
|
1359
2477
|
],
|
|
1360
|
-
"useWhen": "Show one long opaque value on one line, and keep its end visible when it clips."
|
|
2478
|
+
"useWhen": "Show one long opaque value on one line, and keep its end visible when it clips.",
|
|
2479
|
+
"aliases": [
|
|
2480
|
+
"ellipsis",
|
|
2481
|
+
"middle truncation",
|
|
2482
|
+
"truncate"
|
|
2483
|
+
]
|
|
1361
2484
|
},
|
|
1362
2485
|
{
|
|
1363
2486
|
"name": "Visually Hidden",
|
|
@@ -1372,6 +2495,25 @@
|
|
|
1372
2495
|
"jsdoc": "Content for assistive technology only.",
|
|
1373
2496
|
"examples": [
|
|
1374
2497
|
"```tsx\nimport { VisuallyHidden } from \"@ngrok/mantle/visually-hidden\";\n\n<a href=\"https://status.ngrok.com\" target=\"_blank\" rel=\"noreferrer\">\n ngrok status\n <VisuallyHidden> (opens in a new tab)</VisuallyHidden>\n</a>\n```"
|
|
2498
|
+
],
|
|
2499
|
+
"siblings": [
|
|
2500
|
+
{
|
|
2501
|
+
"name": "LiveRegion",
|
|
2502
|
+
"boundary": "screen readers must announce the text when it changes."
|
|
2503
|
+
},
|
|
2504
|
+
{
|
|
2505
|
+
"name": "IconButton",
|
|
2506
|
+
"boundary": "the text names an icon-only button; pass it as the `label` prop."
|
|
2507
|
+
},
|
|
2508
|
+
{
|
|
2509
|
+
"name": "SkipToMainLink",
|
|
2510
|
+
"boundary": "the hidden content is a skip link that shows on focus."
|
|
2511
|
+
}
|
|
2512
|
+
],
|
|
2513
|
+
"useWhen": "Give screen readers text that sighted users never see, such as \"(opens in a new tab)\" on an external link.",
|
|
2514
|
+
"aliases": [
|
|
2515
|
+
"sr only",
|
|
2516
|
+
"screen reader only"
|
|
1375
2517
|
]
|
|
1376
2518
|
},
|
|
1377
2519
|
{
|
|
@@ -1403,7 +2545,10 @@
|
|
|
1403
2545
|
"boundary": "the content is code and needs highlighting and a copy button."
|
|
1404
2546
|
}
|
|
1405
2547
|
],
|
|
1406
|
-
"useWhen": "De-emphasize a block of content relative to the surface around it."
|
|
2548
|
+
"useWhen": "De-emphasize a block of content relative to the surface around it.",
|
|
2549
|
+
"aliases": [
|
|
2550
|
+
"inset"
|
|
2551
|
+
]
|
|
1407
2552
|
}
|
|
1408
2553
|
],
|
|
1409
2554
|
"hooks": [
|