@ceed/ads 1.30.0 → 1.31.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/Overview.md +5 -5
- package/dist/components/Calendar/utils/index.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +4 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +4 -0
- package/dist/components/MonthRangePicker/MonthRangePicker.d.ts +8 -0
- package/dist/components/data-display/Avatar.md +85 -74
- package/dist/components/data-display/Badge.md +23 -5
- package/dist/components/data-display/Chip.md +49 -35
- package/dist/components/data-display/DataTable.md +93 -0
- package/dist/components/data-display/InfoSign.md +15 -5
- package/dist/components/data-display/Markdown.md +22 -26
- package/dist/components/data-display/Table.md +63 -53
- package/dist/components/data-display/Tooltip.md +70 -58
- package/dist/components/data-display/Typography.md +28 -11
- package/dist/components/feedback/Alert.md +86 -74
- package/dist/components/feedback/CircularProgress.md +20 -5
- package/dist/components/feedback/Dialog.md +8 -12
- package/dist/components/feedback/Modal.md +12 -16
- package/dist/components/feedback/Skeleton.md +20 -5
- package/dist/components/inputs/Autocomplete.md +8 -10
- package/dist/components/inputs/Button.md +107 -87
- package/dist/components/inputs/ButtonGroup.md +20 -5
- package/dist/components/inputs/Calendar.md +25 -5
- package/dist/components/inputs/Checkbox.md +171 -450
- package/dist/components/inputs/CurrencyInput.md +25 -5
- package/dist/components/inputs/DatePicker.md +59 -5
- package/dist/components/inputs/DateRangePicker.md +46 -5
- package/dist/components/inputs/FilterMenu.md +85 -9
- package/dist/components/inputs/FilterableCheckboxGroup.md +23 -8
- package/dist/components/inputs/FormControl.md +34 -6
- package/dist/components/inputs/IconButton.md +21 -5
- package/dist/components/inputs/Input.md +254 -68
- package/dist/components/inputs/MonthPicker.md +59 -5
- package/dist/components/inputs/MonthRangePicker.md +44 -5
- package/dist/components/inputs/PercentageInput.md +28 -5
- package/dist/components/inputs/RadioButton.md +26 -5
- package/dist/components/inputs/RadioList.md +23 -6
- package/dist/components/inputs/RadioTileGroup.md +40 -8
- package/dist/components/inputs/Select.md +59 -5
- package/dist/components/inputs/Slider.md +26 -5
- package/dist/components/inputs/Switch.md +23 -5
- package/dist/components/inputs/Textarea.md +27 -5
- package/dist/components/inputs/Uploader/Uploader.md +24 -5
- package/dist/components/layout/Box.md +66 -58
- package/dist/components/layout/Container.md +9 -13
- package/dist/components/layout/Grid.md +91 -75
- package/dist/components/layout/Stack.md +85 -70
- package/dist/components/navigation/Breadcrumbs.md +23 -14
- package/dist/components/navigation/Dropdown.md +29 -20
- package/dist/components/navigation/IconMenuButton.md +24 -11
- package/dist/components/navigation/InsetDrawer.md +16 -5
- package/dist/components/navigation/Link.md +30 -14
- package/dist/components/navigation/Menu.md +33 -20
- package/dist/components/navigation/MenuButton.md +26 -12
- package/dist/components/navigation/NavigationGroup.md +7 -11
- package/dist/components/navigation/NavigationItem.md +8 -12
- package/dist/components/navigation/Navigator.md +5 -9
- package/dist/components/navigation/Pagination.md +21 -12
- package/dist/components/navigation/ProfileMenu.md +17 -5
- package/dist/components/navigation/Stepper.md +18 -5
- package/dist/components/navigation/Tabs.md +37 -14
- package/dist/components/surfaces/Accordions.md +12 -16
- package/dist/components/surfaces/Card.md +59 -47
- package/dist/components/surfaces/Divider.md +70 -61
- package/dist/components/surfaces/Sheet.md +18 -5
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +3 -3
- package/dist/index.cjs +99 -39
- package/dist/index.js +99 -39
- package/framer/index.js +1 -1
- package/package.json +1 -1
|
@@ -65,9 +65,7 @@ function MyComponent() {
|
|
|
65
65
|
}
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
##
|
|
69
|
-
|
|
70
|
-
### Basic Breadcrumbs
|
|
68
|
+
## Basic Breadcrumbs
|
|
71
69
|
|
|
72
70
|
A simple breadcrumb trail with a few levels of hierarchy. The last item uses `type: 'text'` to indicate the current page.
|
|
73
71
|
|
|
@@ -89,7 +87,7 @@ A simple breadcrumb trail with a few levels of hierarchy. The last item uses `ty
|
|
|
89
87
|
/>
|
|
90
88
|
```
|
|
91
89
|
|
|
92
|
-
|
|
90
|
+
## Breadcrumbs Sizes
|
|
93
91
|
|
|
94
92
|
Breadcrumbs are available in three sizes -- `sm`, `md`, and `lg` -- allowing you to match the surrounding layout density.
|
|
95
93
|
|
|
@@ -101,7 +99,7 @@ Breadcrumbs are available in three sizes -- `sm`, `md`, and `lg` -- allowing you
|
|
|
101
99
|
</div>
|
|
102
100
|
```
|
|
103
101
|
|
|
104
|
-
|
|
102
|
+
## Breadcrumbs Custom Separator
|
|
105
103
|
|
|
106
104
|
The separator character between items can be customized via the `separator` prop. Common choices include `/`, `>`, and `-`.
|
|
107
105
|
|
|
@@ -150,7 +148,7 @@ The separator character between items can be customized via the `separator` prop
|
|
|
150
148
|
</div>
|
|
151
149
|
```
|
|
152
150
|
|
|
153
|
-
|
|
151
|
+
## Collapsed Breadcrumbs
|
|
154
152
|
|
|
155
153
|
When paths are deep, the component automatically collapses middle items behind an ellipsis. You can control how many items appear at the start and end using `startCrumbCount` and `endCrumbCount`.
|
|
156
154
|
|
|
@@ -215,7 +213,7 @@ When paths are deep, the component automatically collapses middle items behind a
|
|
|
215
213
|
</div>
|
|
216
214
|
```
|
|
217
215
|
|
|
218
|
-
|
|
216
|
+
## Expanded Breadcrumbs
|
|
219
217
|
|
|
220
218
|
Setting `collapsed={false}` renders every item in the path without collapsing.
|
|
221
219
|
|
|
@@ -253,7 +251,7 @@ Setting `collapsed={false}` renders every item in the path without collapsing.
|
|
|
253
251
|
/>
|
|
254
252
|
```
|
|
255
253
|
|
|
256
|
-
|
|
254
|
+
## Single Breadcrumb
|
|
257
255
|
|
|
258
256
|
The component handles the edge case of a single breadcrumb item gracefully.
|
|
259
257
|
|
|
@@ -267,7 +265,7 @@ The component handles the edge case of a single breadcrumb item gracefully.
|
|
|
267
265
|
/>
|
|
268
266
|
```
|
|
269
267
|
|
|
270
|
-
|
|
268
|
+
## Breadcrumbs with Icons
|
|
271
269
|
|
|
272
270
|
Breadcrumb items can include icons alongside their labels.
|
|
273
271
|
|
|
@@ -286,9 +284,7 @@ Breadcrumb items can include icons alongside their labels.
|
|
|
286
284
|
}]} collapsed={false} />
|
|
287
285
|
```
|
|
288
286
|
|
|
289
|
-
##
|
|
290
|
-
|
|
291
|
-
### Admin Dashboard Navigation
|
|
287
|
+
## Breadcrumbs in Admin Dashboard
|
|
292
288
|
|
|
293
289
|
```tsx
|
|
294
290
|
function UserDetailPage({ user }) {
|
|
@@ -307,7 +303,7 @@ function UserDetailPage({ user }) {
|
|
|
307
303
|
}
|
|
308
304
|
```
|
|
309
305
|
|
|
310
|
-
|
|
306
|
+
## Breadcrumbs for E-commerce Product Page
|
|
311
307
|
|
|
312
308
|
```tsx
|
|
313
309
|
function ProductPage({ product, category, subcategory }) {
|
|
@@ -332,7 +328,7 @@ function ProductPage({ product, category, subcategory }) {
|
|
|
332
328
|
}
|
|
333
329
|
```
|
|
334
330
|
|
|
335
|
-
|
|
331
|
+
## Dynamic Breadcrumbs from Route
|
|
336
332
|
|
|
337
333
|
```tsx
|
|
338
334
|
function DynamicBreadcrumbs() {
|
|
@@ -352,6 +348,19 @@ function DynamicBreadcrumbs() {
|
|
|
352
348
|
}
|
|
353
349
|
```
|
|
354
350
|
|
|
351
|
+
## Props and Customization
|
|
352
|
+
|
|
353
|
+
### Key Props
|
|
354
|
+
|
|
355
|
+
| Prop | Type | Default | Description |
|
|
356
|
+
| ----------------- | ---------------------------------------------------------------- | -------------------------------- | ---------------------------------------------------- |
|
|
357
|
+
| `crumbs` | `{ type: 'text' \| 'link'; label: string; linkHref?: string }[]` | (required) | Breadcrumb items |
|
|
358
|
+
| `collapsed` | `boolean` | `true` | Whether long crumb lists are collapsed with ellipsis |
|
|
359
|
+
| `startCrumbCount` | `number` | `1` | Number of crumbs shown at the start when collapsed |
|
|
360
|
+
| `endCrumbCount` | `number` | `3` | Number of crumbs shown at the end when collapsed |
|
|
361
|
+
| `slots` | `{ link?: ElementType }` | - | Custom component for link crumbs |
|
|
362
|
+
| `slotProps` | `{ link?: { color?: string } }` | `{ link: { color: 'neutral' } }` | Props passed to slot components |
|
|
363
|
+
|
|
355
364
|
## Best Practices
|
|
356
365
|
|
|
357
366
|
- **Always start with a root item.** Begin the trail with "Home" or an equivalent top-level link so users can always navigate back to the starting point.
|
|
@@ -52,9 +52,7 @@ Dropdown, Menu, MenuItem, MenuButton, and IconMenuButton form a **menu component
|
|
|
52
52
|
| `Dropdown` + `MenuButton` + `Menu` | Custom menu content (headers, dividers, mixed elements) |
|
|
53
53
|
| `Dropdown` + custom trigger + `Menu` | Fully custom trigger elements |
|
|
54
54
|
|
|
55
|
-
##
|
|
56
|
-
|
|
57
|
-
### Basic Dropdown
|
|
55
|
+
## Dropdown Basic
|
|
58
56
|
|
|
59
57
|
The simplest Dropdown pairs a MenuButton trigger with a Menu of items.
|
|
60
58
|
|
|
@@ -82,7 +80,7 @@ The simplest Dropdown pairs a MenuButton trigger with a Menu of items.
|
|
|
82
80
|
</Stack>
|
|
83
81
|
```
|
|
84
82
|
|
|
85
|
-
|
|
83
|
+
## Dropdown Button Variants
|
|
86
84
|
|
|
87
85
|
MenuButton supports `plain`, `outlined`, `soft`, and `solid` variants to match your design context.
|
|
88
86
|
|
|
@@ -122,7 +120,7 @@ MenuButton supports `plain`, `outlined`, `soft`, and `solid` variants to match y
|
|
|
122
120
|
</Stack>
|
|
123
121
|
```
|
|
124
122
|
|
|
125
|
-
|
|
123
|
+
## Dropdown Button Colors
|
|
126
124
|
|
|
127
125
|
Apply semantic colors to the trigger button for different emphasis levels.
|
|
128
126
|
|
|
@@ -180,7 +178,7 @@ Apply semantic colors to the trigger button for different emphasis levels.
|
|
|
180
178
|
</Stack>
|
|
181
179
|
```
|
|
182
180
|
|
|
183
|
-
|
|
181
|
+
## Dropdown Menu Placements
|
|
184
182
|
|
|
185
183
|
Control where the menu appears relative to the trigger using the `placement` prop on Menu.
|
|
186
184
|
|
|
@@ -226,7 +224,7 @@ Control where the menu appears relative to the trigger using the `placement` pro
|
|
|
226
224
|
</Stack>
|
|
227
225
|
```
|
|
228
226
|
|
|
229
|
-
|
|
227
|
+
## Dropdown with Icons
|
|
230
228
|
|
|
231
229
|
Add icons to menu items and decorators to the trigger button for richer visual communication.
|
|
232
230
|
|
|
@@ -259,7 +257,7 @@ Add icons to menu items and decorators to the trigger button for richer visual c
|
|
|
259
257
|
</Dropdown>
|
|
260
258
|
```
|
|
261
259
|
|
|
262
|
-
|
|
260
|
+
## Dropdown Actions Menu
|
|
263
261
|
|
|
264
262
|
Build action menus for edit, delete, and other operations. Use `color="danger"` on destructive items.
|
|
265
263
|
|
|
@@ -290,7 +288,7 @@ Build action menus for edit, delete, and other operations. Use `color="danger"`
|
|
|
290
288
|
</Dropdown>
|
|
291
289
|
```
|
|
292
290
|
|
|
293
|
-
|
|
291
|
+
## Dropdown Filter Menu
|
|
294
292
|
|
|
295
293
|
Use Dropdown as an interactive filter selector with state management.
|
|
296
294
|
|
|
@@ -308,7 +306,7 @@ Use Dropdown as an interactive filter selector with state management.
|
|
|
308
306
|
</Dropdown>
|
|
309
307
|
```
|
|
310
308
|
|
|
311
|
-
|
|
309
|
+
## Dropdown Profile
|
|
312
310
|
|
|
313
311
|
Combine custom content (user info header) with standard menu items for profile menus.
|
|
314
312
|
|
|
@@ -360,7 +358,7 @@ Combine custom content (user info header) with standard menu items for profile m
|
|
|
360
358
|
</Dropdown>
|
|
361
359
|
```
|
|
362
360
|
|
|
363
|
-
|
|
361
|
+
## Dropdown Nested Menus
|
|
364
362
|
|
|
365
363
|
Place multiple Dropdown instances side by side to create menu bar patterns.
|
|
366
364
|
|
|
@@ -401,7 +399,7 @@ Place multiple Dropdown instances side by side to create menu bar patterns.
|
|
|
401
399
|
</Stack>
|
|
402
400
|
```
|
|
403
401
|
|
|
404
|
-
|
|
402
|
+
## Dropdown Controlled State
|
|
405
403
|
|
|
406
404
|
Use the `open` and `onOpenChange` props to programmatically control the menu state.
|
|
407
405
|
|
|
@@ -426,7 +424,7 @@ Use the `open` and `onOpenChange` props to programmatically control the menu sta
|
|
|
426
424
|
</Stack>
|
|
427
425
|
```
|
|
428
426
|
|
|
429
|
-
|
|
427
|
+
## Dropdown Disabled State
|
|
430
428
|
|
|
431
429
|
Disable the entire trigger button or individual menu items.
|
|
432
430
|
|
|
@@ -450,7 +448,7 @@ Disable the entire trigger button or individual menu items.
|
|
|
450
448
|
</Stack>
|
|
451
449
|
```
|
|
452
450
|
|
|
453
|
-
|
|
451
|
+
## Dropdown Long Menu
|
|
454
452
|
|
|
455
453
|
Apply `maxHeight` and `overflow: 'auto'` to Menu for scrollable lists with many items.
|
|
456
454
|
|
|
@@ -470,7 +468,7 @@ Apply `maxHeight` and `overflow: 'auto'` to Menu for scrollable lists with many
|
|
|
470
468
|
</Dropdown>
|
|
471
469
|
```
|
|
472
470
|
|
|
473
|
-
|
|
471
|
+
## Dropdown Custom Styling
|
|
474
472
|
|
|
475
473
|
Customize borders, shadows, border-radius, and gradients through the `sx` prop.
|
|
476
474
|
|
|
@@ -527,9 +525,7 @@ Customize borders, shadows, border-radius, and gradients through the `sx` prop.
|
|
|
527
525
|
</Stack>
|
|
528
526
|
```
|
|
529
527
|
|
|
530
|
-
##
|
|
531
|
-
|
|
532
|
-
### Navigation Menu
|
|
528
|
+
## Navigation Menu
|
|
533
529
|
|
|
534
530
|
```tsx
|
|
535
531
|
<Dropdown>
|
|
@@ -544,7 +540,7 @@ Customize borders, shadows, border-radius, and gradients through the `sx` prop.
|
|
|
544
540
|
</Dropdown>
|
|
545
541
|
```
|
|
546
542
|
|
|
547
|
-
|
|
543
|
+
## Filter Selector
|
|
548
544
|
|
|
549
545
|
```tsx
|
|
550
546
|
const [filter, setFilter] = useState('All');
|
|
@@ -565,7 +561,7 @@ const [filter, setFilter] = useState('All');
|
|
|
565
561
|
</Dropdown>
|
|
566
562
|
```
|
|
567
563
|
|
|
568
|
-
|
|
564
|
+
## Controlled State with External Toggle
|
|
569
565
|
|
|
570
566
|
```tsx
|
|
571
567
|
const [open, setOpen] = useState(false);
|
|
@@ -583,6 +579,19 @@ const [open, setOpen] = useState(false);
|
|
|
583
579
|
</Button>
|
|
584
580
|
```
|
|
585
581
|
|
|
582
|
+
## Props and Customization
|
|
583
|
+
|
|
584
|
+
### Key Props
|
|
585
|
+
|
|
586
|
+
| Prop | Type | Default | Description |
|
|
587
|
+
| -------------- | -------------------------------- | ------- | ------------------------------------ |
|
|
588
|
+
| `children` | `ReactNode` | - | Dropdown content (MenuButton + Menu) |
|
|
589
|
+
| `open` | `boolean` | - | Controlled open state |
|
|
590
|
+
| `defaultOpen` | `boolean` | `false` | Initial open state (uncontrolled) |
|
|
591
|
+
| `onOpenChange` | `(event, open: boolean) => void` | - | Callback when open state changes |
|
|
592
|
+
|
|
593
|
+
> **Note**: Dropdown accepts all Joy UI Dropdown props. It is a state management wrapper — style props go on Menu and MenuButton.
|
|
594
|
+
|
|
586
595
|
## Best Practices
|
|
587
596
|
|
|
588
597
|
- **Use the right abstraction level.** If you only need a simple list of text items, prefer `MenuButton` or `IconMenuButton` standalone components. Use `Dropdown` + `Menu` when you need dividers, custom headers, or mixed content inside the menu.
|
|
@@ -50,9 +50,7 @@ function RowActions({ onEdit, onDelete }) {
|
|
|
50
50
|
}
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
##
|
|
54
|
-
|
|
55
|
-
### Standalone
|
|
53
|
+
## IconMenuButton Standalone
|
|
56
54
|
|
|
57
55
|
Icon button rendered without dropdown menu functionality, useful as a custom link trigger.
|
|
58
56
|
|
|
@@ -75,7 +73,7 @@ Icon button rendered without dropdown menu functionality, useful as a custom lin
|
|
|
75
73
|
/>
|
|
76
74
|
```
|
|
77
75
|
|
|
78
|
-
|
|
76
|
+
## IconMenuButton Placement Bottom Start
|
|
79
77
|
|
|
80
78
|
Menu aligns to the left edge of the icon button.
|
|
81
79
|
|
|
@@ -98,7 +96,7 @@ Menu aligns to the left edge of the icon button.
|
|
|
98
96
|
/>
|
|
99
97
|
```
|
|
100
98
|
|
|
101
|
-
|
|
99
|
+
## IconMenuButton Placement Bottom
|
|
102
100
|
|
|
103
101
|
Menu centers below the icon button.
|
|
104
102
|
|
|
@@ -121,7 +119,7 @@ Menu centers below the icon button.
|
|
|
121
119
|
/>
|
|
122
120
|
```
|
|
123
121
|
|
|
124
|
-
|
|
122
|
+
## IconMenuButton Placement Bottom End
|
|
125
123
|
|
|
126
124
|
Menu aligns to the right edge of the icon button. Recommended when the button is positioned on the right side of a container to prevent the menu from overflowing the viewport.
|
|
127
125
|
|
|
@@ -144,9 +142,7 @@ Menu aligns to the right edge of the icon button. Recommended when the button is
|
|
|
144
142
|
/>
|
|
145
143
|
```
|
|
146
144
|
|
|
147
|
-
##
|
|
148
|
-
|
|
149
|
-
### Table Row Actions
|
|
145
|
+
## IconMenuButton for Table Row Actions
|
|
150
146
|
|
|
151
147
|
```tsx
|
|
152
148
|
function DataTableRow({ row, onEdit, onDelete, onDuplicate }) {
|
|
@@ -173,7 +169,7 @@ function DataTableRow({ row, onEdit, onDelete, onDuplicate }) {
|
|
|
173
169
|
}
|
|
174
170
|
```
|
|
175
171
|
|
|
176
|
-
|
|
172
|
+
## IconMenuButton for Card Actions
|
|
177
173
|
|
|
178
174
|
```tsx
|
|
179
175
|
function ProductCard({ product, onAction }) {
|
|
@@ -200,7 +196,7 @@ function ProductCard({ product, onAction }) {
|
|
|
200
196
|
}
|
|
201
197
|
```
|
|
202
198
|
|
|
203
|
-
|
|
199
|
+
## IconMenuButton for Toolbar Overflow
|
|
204
200
|
|
|
205
201
|
```tsx
|
|
206
202
|
function EditorToolbar({ onAction }) {
|
|
@@ -225,6 +221,23 @@ function EditorToolbar({ onAction }) {
|
|
|
225
221
|
}
|
|
226
222
|
```
|
|
227
223
|
|
|
224
|
+
## Props and Customization
|
|
225
|
+
|
|
226
|
+
### Key Props
|
|
227
|
+
|
|
228
|
+
| Prop | Type | Default | Description |
|
|
229
|
+
| ---------------------- | ---------------------------------------------------------------------- | ----------- | -------------------------------------------- |
|
|
230
|
+
| `icon` | `ReactNode` | (required) | Icon element to render in the trigger button |
|
|
231
|
+
| `items` | `{ text: string; component?: ElementType; componentProps?: object }[]` | - | Menu items |
|
|
232
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size |
|
|
233
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Button color |
|
|
234
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'plain'` | Button visual style |
|
|
235
|
+
| `disabled` | `boolean` | `false` | Disables the button |
|
|
236
|
+
| `loading` | `boolean` | `false` | Shows loading indicator |
|
|
237
|
+
| `placement` | `Placement` | `'bottom'` | Menu position |
|
|
238
|
+
| `buttonComponent` | `ElementType` | - | Custom trigger element |
|
|
239
|
+
| `buttonComponentProps` | `object` | - | Props passed to custom trigger |
|
|
240
|
+
|
|
228
241
|
## Best Practices
|
|
229
242
|
|
|
230
243
|
- **Always provide `aria-label`.** Since IconMenuButton has no visible text, screen readers rely entirely on the `aria-label` to announce the button's purpose. Include context when possible.
|
|
@@ -435,9 +435,7 @@ Booking options
|
|
|
435
435
|
</Box>
|
|
436
436
|
```
|
|
437
437
|
|
|
438
|
-
##
|
|
439
|
-
|
|
440
|
-
### Settings Drawer
|
|
438
|
+
## Settings Drawer
|
|
441
439
|
|
|
442
440
|
```tsx
|
|
443
441
|
function SettingsDrawer({ open, onClose }) {
|
|
@@ -487,7 +485,7 @@ function SettingsDrawer({ open, onClose }) {
|
|
|
487
485
|
}
|
|
488
486
|
```
|
|
489
487
|
|
|
490
|
-
|
|
488
|
+
## Detail View Drawer
|
|
491
489
|
|
|
492
490
|
```tsx
|
|
493
491
|
function DetailDrawer({ open, onClose, itemId }) {
|
|
@@ -515,7 +513,7 @@ function DetailDrawer({ open, onClose, itemId }) {
|
|
|
515
513
|
}
|
|
516
514
|
```
|
|
517
515
|
|
|
518
|
-
|
|
516
|
+
## Bottom Sheet for Mobile Actions
|
|
519
517
|
|
|
520
518
|
```tsx
|
|
521
519
|
function ActionSheet({ open, onClose, onAction }) {
|
|
@@ -550,6 +548,19 @@ function ActionSheet({ open, onClose, onAction }) {
|
|
|
550
548
|
}
|
|
551
549
|
```
|
|
552
550
|
|
|
551
|
+
## Props and Customization
|
|
552
|
+
|
|
553
|
+
### Key Props
|
|
554
|
+
|
|
555
|
+
| Prop | Type | Default | Description |
|
|
556
|
+
| ---------- | -------------------------------------------------------------- | ----------- | -------------- |
|
|
557
|
+
| `children` | `ReactNode` | - | Drawer content |
|
|
558
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'plain'` | Visual style |
|
|
559
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Color scheme |
|
|
560
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
561
|
+
|
|
562
|
+
> **Note**: InsetDrawer is a styled Sheet component designed for sidebar layouts. It accepts all Joy UI Sheet props.
|
|
563
|
+
|
|
553
564
|
## Best Practices
|
|
554
565
|
|
|
555
566
|
1. **Use appropriate anchor positions**: Match the drawer position to the content type for intuitive UX.
|
|
@@ -43,9 +43,7 @@ function MyComponent() {
|
|
|
43
43
|
}
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
##
|
|
47
|
-
|
|
48
|
-
### Variants
|
|
46
|
+
## Link Variants
|
|
49
47
|
|
|
50
48
|
Links support four visual styles through the `variant` prop: `plain`, `outlined`, `soft`, and `solid`.
|
|
51
49
|
|
|
@@ -70,7 +68,7 @@ Links support four visual styles through the `variant` prop: `plain`, `outlined`
|
|
|
70
68
|
</div>
|
|
71
69
|
```
|
|
72
70
|
|
|
73
|
-
|
|
71
|
+
## Link Colors
|
|
74
72
|
|
|
75
73
|
Apply semantic colors to communicate different purposes -- `primary`, `neutral`, `success`, `warning`, and `danger`.
|
|
76
74
|
|
|
@@ -98,7 +96,7 @@ Apply semantic colors to communicate different purposes -- `primary`, `neutral`,
|
|
|
98
96
|
</div>
|
|
99
97
|
```
|
|
100
98
|
|
|
101
|
-
|
|
99
|
+
## Link Underline Styles
|
|
102
100
|
|
|
103
101
|
Control the underline behavior with three options: `none` (never shown), `hover` (shown on hover), and `always` (permanently visible).
|
|
104
102
|
|
|
@@ -120,7 +118,7 @@ Control the underline behavior with three options: `none` (never shown), `hover`
|
|
|
120
118
|
</div>
|
|
121
119
|
```
|
|
122
120
|
|
|
123
|
-
|
|
121
|
+
## Link Typography Levels
|
|
124
122
|
|
|
125
123
|
Links can adopt any typography level from the design system, enabling consistent text hierarchies when links appear alongside headings or body text.
|
|
126
124
|
|
|
@@ -158,7 +156,7 @@ Links can adopt any typography level from the design system, enabling consistent
|
|
|
158
156
|
</div>
|
|
159
157
|
```
|
|
160
158
|
|
|
161
|
-
|
|
159
|
+
## Disabled Link
|
|
162
160
|
|
|
163
161
|
Links can be disabled to prevent interaction while remaining visible in the layout.
|
|
164
162
|
|
|
@@ -171,7 +169,7 @@ Links can be disabled to prevent interaction while remaining visible in the layo
|
|
|
171
169
|
/>
|
|
172
170
|
```
|
|
173
171
|
|
|
174
|
-
|
|
172
|
+
## External Links
|
|
175
173
|
|
|
176
174
|
For links that navigate away from your application, include `target="_blank"` and `rel="noopener noreferrer"` for security.
|
|
177
175
|
|
|
@@ -181,7 +179,7 @@ For links that navigate away from your application, include `target="_blank"` an
|
|
|
181
179
|
</Link>
|
|
182
180
|
```
|
|
183
181
|
|
|
184
|
-
|
|
182
|
+
## Link Inline with Text
|
|
185
183
|
|
|
186
184
|
Links integrate seamlessly within paragraph text, inheriting the surrounding font styles.
|
|
187
185
|
|
|
@@ -193,9 +191,7 @@ This is a paragraph with an <Link href="#">inline link</Link> that flows natural
|
|
|
193
191
|
</p>
|
|
194
192
|
```
|
|
195
193
|
|
|
196
|
-
##
|
|
197
|
-
|
|
198
|
-
### Inline Text Links
|
|
194
|
+
## Inline Text Links
|
|
199
195
|
|
|
200
196
|
```tsx
|
|
201
197
|
function ArticleContent() {
|
|
@@ -209,7 +205,7 @@ function ArticleContent() {
|
|
|
209
205
|
}
|
|
210
206
|
```
|
|
211
207
|
|
|
212
|
-
|
|
208
|
+
## Footer Navigation Links
|
|
213
209
|
|
|
214
210
|
```tsx
|
|
215
211
|
function FooterLinks() {
|
|
@@ -229,7 +225,7 @@ function FooterLinks() {
|
|
|
229
225
|
}
|
|
230
226
|
```
|
|
231
227
|
|
|
232
|
-
|
|
228
|
+
## Link Router Integration
|
|
233
229
|
|
|
234
230
|
```tsx
|
|
235
231
|
import { Link as RouterLink } from 'react-router-dom';
|
|
@@ -243,6 +239,26 @@ function AppNavigation() {
|
|
|
243
239
|
}
|
|
244
240
|
```
|
|
245
241
|
|
|
242
|
+
## Props and Customization
|
|
243
|
+
|
|
244
|
+
### Key Props
|
|
245
|
+
|
|
246
|
+
| Prop | Type | Default | Description |
|
|
247
|
+
| ---------------- | -------------------------------------------------------------- | ----------- | -------------------------------------- |
|
|
248
|
+
| `children` | `ReactNode` | - | Link content |
|
|
249
|
+
| `href` | `string` | - | Link URL |
|
|
250
|
+
| `level` | Typography level | `'body-md'` | Text size (inherits Typography levels) |
|
|
251
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'primary'` | Link color |
|
|
252
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | - | Visual style |
|
|
253
|
+
| `underline` | `'none' \| 'hover' \| 'always'` | `'hover'` | Underline behavior |
|
|
254
|
+
| `disabled` | `boolean` | `false` | Disables the link |
|
|
255
|
+
| `startDecorator` | `ReactNode` | - | Content before link text |
|
|
256
|
+
| `endDecorator` | `ReactNode` | - | Content after link text |
|
|
257
|
+
| `component` | `ElementType` | `'a'` | Root element type (polymorphic) |
|
|
258
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
259
|
+
|
|
260
|
+
> **Note**: Link also accepts all Joy UI Link props.
|
|
261
|
+
|
|
246
262
|
## Best Practices
|
|
247
263
|
|
|
248
264
|
- **Use descriptive link text.** The text should clearly communicate the destination. Avoid generic labels such as "click here" or "read more".
|