@ceed/ads 1.30.0 → 1.30.1
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/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 +39 -5
- package/dist/components/inputs/DateRangePicker.md +29 -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 +28 -5
- package/dist/components/inputs/MonthRangePicker.md +26 -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/package.json +1 -1
|
@@ -1726,6 +1726,99 @@ This is inspector: {selectedRowId}
|
|
|
1726
1726
|
</Stack>
|
|
1727
1727
|
```
|
|
1728
1728
|
|
|
1729
|
+
## Props and Customization
|
|
1730
|
+
|
|
1731
|
+
### DataTableProps
|
|
1732
|
+
|
|
1733
|
+
| Prop | Type | Default | Description |
|
|
1734
|
+
| ------------------------------- | ------------------------------------------------------------------- | ----------------------- | ----------------------------------------------------- |
|
|
1735
|
+
| `rows` | `T[]` | (required) | Array of row data objects |
|
|
1736
|
+
| `columns` | `ColumnDef<T, ID>[]` | (required) | Column definitions array |
|
|
1737
|
+
| `getId` | `(row: T) => ID` | - | Custom row identifier function (defaults to `row.id`) |
|
|
1738
|
+
| `checkboxSelection` | `boolean` | `false` | Enables checkbox selection column |
|
|
1739
|
+
| `selectionModel` | `ID[]` | - | Controlled selection state |
|
|
1740
|
+
| `onSelectionModelChange` | `(model: ID[], isTotalSelected?: boolean) => void` | - | Callback when selection changes |
|
|
1741
|
+
| `isRowSelectable` | `(params: { row, id }) => boolean` | - | Determines if a row can be selected |
|
|
1742
|
+
| `disableSelectionOnClick` | `boolean` | `false` | Prevents selection when clicking a row |
|
|
1743
|
+
| `isTotalSelected` | `boolean` | `false` | Represents total selection state in server pagination |
|
|
1744
|
+
| `editMode` | `boolean` | `false` | Enables inline cell editing |
|
|
1745
|
+
| `pagination` | `boolean` | `false` | Enables pagination |
|
|
1746
|
+
| `paginationMode` | `'client' \| 'server'` | `'client'` | Client-side or server-side pagination |
|
|
1747
|
+
| `paginationModel` | `{ page: number; pageSize: number }` | - | Controlled pagination state |
|
|
1748
|
+
| `onPaginationModelChange` | `(model: { page, pageSize }) => void` | - | Callback when page or page size changes |
|
|
1749
|
+
| `rowCount` | `number` | - | Total row count (required for server pagination) |
|
|
1750
|
+
| `sortModel` | `SortModel<T>[]` | - | Controlled sort state |
|
|
1751
|
+
| `sortOrder` | `('asc' \| 'desc' \| null)[]` | `['asc', 'desc', null]` | Allowed sort directions cycle |
|
|
1752
|
+
| `onSortModelChange` | `(model: SortModel<T>[]) => void` | - | Callback when sort changes |
|
|
1753
|
+
| `pinnedColumns` | `{ left?: string[]; right?: string[] }` | - | Pin columns to left/right edges |
|
|
1754
|
+
| `columnGroupingModel` | `ColumnGroupingModel` | - | Column header grouping configuration |
|
|
1755
|
+
| `columnVisibilityModel` | `Record<string, boolean>` | - | Controlled column visibility (false = hidden) |
|
|
1756
|
+
| `onColumnVisibilityModelChange` | `(model: Record<string, boolean>) => void` | - | Callback when visibility changes |
|
|
1757
|
+
| `loading` | `boolean` | `false` | Shows loading overlay |
|
|
1758
|
+
| `hoverRow` | `boolean` | `false` | Highlights rows on hover |
|
|
1759
|
+
| `stickyHeader` | `boolean` | `false` | Fixes the header when scrolling |
|
|
1760
|
+
| `stripe` | `'even' \| 'odd'` | - | Applies striped row background |
|
|
1761
|
+
| `noWrap` | `boolean` | `false` | Prevents cell text wrapping |
|
|
1762
|
+
| `onRowClick` | `(params: { row, rowId }, event) => void` | - | Callback when a row is clicked |
|
|
1763
|
+
| `slots` | `{ checkbox?, toolbar?, footer?, loadingOverlay?, noRowsOverlay? }` | - | Custom component slots |
|
|
1764
|
+
| `slotProps` | `{ checkbox?, toolbar?, background?, noRowsOverlay? }` | - | Props passed to slot components |
|
|
1765
|
+
| `apiRef` | `React.RefObject<DataTableApi>` | - | Imperative API reference |
|
|
1766
|
+
| `initialState` | `{ sorting?, columns? }` | - | Initial state for uncontrolled sort/visibility |
|
|
1767
|
+
|
|
1768
|
+
### ColumnDef Union Type
|
|
1769
|
+
|
|
1770
|
+
All column types extend `BaseColumnDef` with shared properties:
|
|
1771
|
+
|
|
1772
|
+
| Prop | Type | Default | Description |
|
|
1773
|
+
| ----------------- | --------------------------------------------------------------------------------------------------------------- | ---------- | ------------------------------------------------ |
|
|
1774
|
+
| `field` | `keyof T` | (required) | Row data field to display |
|
|
1775
|
+
| `headerName` | `string` | - | Column header text |
|
|
1776
|
+
| `type` | `'text' \| 'number' \| 'currency' \| 'date' \| 'select' \| 'autocomplete' \| 'longText' \| 'link' \| 'actions'` | `'text'` | Column type (determines edit UI) |
|
|
1777
|
+
| `width` | `string` | - | Column width (e.g., `'200px'`, `'30%'`) |
|
|
1778
|
+
| `minWidth` | `string` | - | Minimum column width |
|
|
1779
|
+
| `maxWidth` | `string` | - | Maximum column width |
|
|
1780
|
+
| `resizable` | `boolean` | `false` | Enables column resizing by dragging |
|
|
1781
|
+
| `sortable` | `boolean` | `true` | Enables sorting for this column |
|
|
1782
|
+
| `sortComparator` | `(params: { rowA, rowB }) => number` | - | Custom sort logic |
|
|
1783
|
+
| `sortOrder` | `('asc' \| 'desc' \| null)[]` | - | Column-specific sort direction cycle |
|
|
1784
|
+
| `required` | `boolean` | `false` | Shows required indicator (\*) in header |
|
|
1785
|
+
| `headerLineClamp` | `1 \| 2` | `1` | Max header text lines before truncation |
|
|
1786
|
+
| `description` | `string` | - | Tooltip text for the column header |
|
|
1787
|
+
| `cellClassName` | `string \| ((params: { row, value }) => string)` | - | Dynamic cell CSS class |
|
|
1788
|
+
| `headerClassName` | `string \| ((params) => string)` | - | Dynamic header CSS class |
|
|
1789
|
+
| `renderCell` | `(params: { row, value, rowIndex, colIndex, id }) => ReactNode` | - | Custom cell renderer |
|
|
1790
|
+
| `renderEditCell` | `(params) => ReactNode` | - | Custom edit cell renderer |
|
|
1791
|
+
| `isCellEditable` | `boolean \| ((params: { row, value, id }) => boolean)` | `true` | Whether a cell is editable |
|
|
1792
|
+
| `componentProps` | `object \| ((params: { row, id }) => object)` | - | Props passed to the column type's edit component |
|
|
1793
|
+
| `onCellEditStart` | `(params: { row, originalRow, value }) => void` | - | Callback when cell editing begins |
|
|
1794
|
+
| `onCellEditStop` | `(params: { row, originalRow, value }) => void` | - | Callback when cell editing ends |
|
|
1795
|
+
|
|
1796
|
+
### ActionsColumnDef
|
|
1797
|
+
|
|
1798
|
+
For action columns, use `type: 'actions'` with `getActions`:
|
|
1799
|
+
|
|
1800
|
+
```tsx
|
|
1801
|
+
{
|
|
1802
|
+
field: 'actions',
|
|
1803
|
+
type: 'actions',
|
|
1804
|
+
getActions: ({ row, id }) => [
|
|
1805
|
+
<Button key="edit" size="sm">Edit</Button>,
|
|
1806
|
+
<IconMenuButton key="more" items={[...]} />,
|
|
1807
|
+
],
|
|
1808
|
+
}
|
|
1809
|
+
```
|
|
1810
|
+
|
|
1811
|
+
### DataTableApi
|
|
1812
|
+
|
|
1813
|
+
```tsx
|
|
1814
|
+
interface DataTableApi {
|
|
1815
|
+
getRowIndexRelativeToVisibleRows(rowId: string): number;
|
|
1816
|
+
setCellFocus(rowId: string): void;
|
|
1817
|
+
}
|
|
1818
|
+
```
|
|
1819
|
+
|
|
1820
|
+
> **Note**: DataTable also accepts all Joy UI Table props (e.g., `borderAxis`, `size`, `sx`).
|
|
1821
|
+
|
|
1729
1822
|
## Constraints and Considerations
|
|
1730
1823
|
|
|
1731
1824
|
### Required Conditions
|
|
@@ -45,9 +45,7 @@ The default InfoSign displays a question-mark icon that reveals a tooltip on hov
|
|
|
45
45
|
/>
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
##
|
|
49
|
-
|
|
50
|
-
### Form Field Help
|
|
48
|
+
## InfoSign Form Field Help
|
|
51
49
|
|
|
52
50
|
```tsx
|
|
53
51
|
import { InfoSign } from '@ceed/ads';
|
|
@@ -69,7 +67,7 @@ function PasswordField() {
|
|
|
69
67
|
}
|
|
70
68
|
```
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
## InfoSign Table Column Header
|
|
73
71
|
|
|
74
72
|
```tsx
|
|
75
73
|
import { InfoSign } from '@ceed/ads';
|
|
@@ -93,7 +91,7 @@ function TableHeader() {
|
|
|
93
91
|
}
|
|
94
92
|
```
|
|
95
93
|
|
|
96
|
-
|
|
94
|
+
## InfoSign Dashboard Metric Explanation
|
|
97
95
|
|
|
98
96
|
```tsx
|
|
99
97
|
import { InfoSign, Typography, Stack } from '@ceed/ads';
|
|
@@ -114,6 +112,18 @@ function MetricCard() {
|
|
|
114
112
|
}
|
|
115
113
|
```
|
|
116
114
|
|
|
115
|
+
## Props and Customization
|
|
116
|
+
|
|
117
|
+
### Key Props
|
|
118
|
+
|
|
119
|
+
| Prop | Type | Default | Description |
|
|
120
|
+
| ----------- | -------------------------------------------------------------- | ----------- | ------------------------------------- |
|
|
121
|
+
| `message` | `string` | (required) | Tooltip message text |
|
|
122
|
+
| `placement` | `TooltipPlacement` | `'top'` | Tooltip position relative to the icon |
|
|
123
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Icon color |
|
|
124
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Icon size |
|
|
125
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
126
|
+
|
|
117
127
|
## Best Practices
|
|
118
128
|
|
|
119
129
|
- **Keep messages concise.** Tooltip messages should be 1-2 sentences that quickly answer "what does this mean?" Avoid paragraphs of text.
|
|
@@ -43,9 +43,7 @@ function ArticleContent({ content }) {
|
|
|
43
43
|
}
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
##
|
|
47
|
-
|
|
48
|
-
### Playground
|
|
46
|
+
## Playground
|
|
49
47
|
|
|
50
48
|
Interactive example with basic markdown formatting.
|
|
51
49
|
|
|
@@ -55,7 +53,7 @@ Interactive example with basic markdown formatting.
|
|
|
55
53
|
/>
|
|
56
54
|
```
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
## Default Level
|
|
59
57
|
|
|
60
58
|
Control the base typography level for the content.
|
|
61
59
|
|
|
@@ -71,7 +69,7 @@ Control the base typography level for the content.
|
|
|
71
69
|
</Stack>
|
|
72
70
|
```
|
|
73
71
|
|
|
74
|
-
|
|
72
|
+
## Text Alignment
|
|
75
73
|
|
|
76
74
|
Align text to left, center, or right.
|
|
77
75
|
|
|
@@ -82,7 +80,7 @@ Align text to left, center, or right.
|
|
|
82
80
|
/>
|
|
83
81
|
```
|
|
84
82
|
|
|
85
|
-
|
|
83
|
+
## Colors
|
|
86
84
|
|
|
87
85
|
Apply different color themes to the markdown content.
|
|
88
86
|
|
|
@@ -96,7 +94,7 @@ Apply different color themes to the markdown content.
|
|
|
96
94
|
</div>
|
|
97
95
|
```
|
|
98
96
|
|
|
99
|
-
|
|
97
|
+
## Text Color
|
|
100
98
|
|
|
101
99
|
Use specific text colors from the theme palette.
|
|
102
100
|
|
|
@@ -108,7 +106,7 @@ Use specific text colors from the theme palette.
|
|
|
108
106
|
</Stack>
|
|
109
107
|
```
|
|
110
108
|
|
|
111
|
-
|
|
109
|
+
## Accent Color
|
|
112
110
|
|
|
113
111
|
Highlight text with custom accent color using `||text||` syntax.
|
|
114
112
|
|
|
@@ -119,7 +117,7 @@ Highlight text with custom accent color using `||text||` syntax.
|
|
|
119
117
|
</Stack>
|
|
120
118
|
```
|
|
121
119
|
|
|
122
|
-
|
|
120
|
+
## Bold Font Weight
|
|
123
121
|
|
|
124
122
|
Customize the weight of bold text.
|
|
125
123
|
|
|
@@ -139,7 +137,7 @@ Customize the weight of bold text.
|
|
|
139
137
|
</Stack>
|
|
140
138
|
```
|
|
141
139
|
|
|
142
|
-
|
|
140
|
+
## Strikethrough
|
|
143
141
|
|
|
144
142
|
GFM strikethrough support using `~text~` syntax.
|
|
145
143
|
|
|
@@ -147,7 +145,7 @@ GFM strikethrough support using `~text~` syntax.
|
|
|
147
145
|
<Markdown content="I am markdown with ~strikethrough~" />
|
|
148
146
|
```
|
|
149
147
|
|
|
150
|
-
|
|
148
|
+
## Tables
|
|
151
149
|
|
|
152
150
|
Full GFM table support with alignment options.
|
|
153
151
|
|
|
@@ -157,7 +155,7 @@ Full GFM table support with alignment options.
|
|
|
157
155
|
/>
|
|
158
156
|
```
|
|
159
157
|
|
|
160
|
-
|
|
158
|
+
## Code Blocks
|
|
161
159
|
|
|
162
160
|
Inline code and fenced code blocks with syntax highlighting.
|
|
163
161
|
|
|
@@ -167,7 +165,7 @@ Inline code and fenced code blocks with syntax highlighting.
|
|
|
167
165
|
/>
|
|
168
166
|
````
|
|
169
167
|
|
|
170
|
-
|
|
168
|
+
## Task Lists
|
|
171
169
|
|
|
172
170
|
Interactive task list checkboxes.
|
|
173
171
|
|
|
@@ -177,7 +175,7 @@ Interactive task list checkboxes.
|
|
|
177
175
|
/>
|
|
178
176
|
```
|
|
179
177
|
|
|
180
|
-
|
|
178
|
+
## Blockquotes
|
|
181
179
|
|
|
182
180
|
Styled blockquotes for quoted content.
|
|
183
181
|
|
|
@@ -187,7 +185,7 @@ Styled blockquotes for quoted content.
|
|
|
187
185
|
/>
|
|
188
186
|
```
|
|
189
187
|
|
|
190
|
-
|
|
188
|
+
## Lists
|
|
191
189
|
|
|
192
190
|
Ordered and unordered lists with nesting support.
|
|
193
191
|
|
|
@@ -197,7 +195,7 @@ Ordered and unordered lists with nesting support.
|
|
|
197
195
|
/>
|
|
198
196
|
```
|
|
199
197
|
|
|
200
|
-
|
|
198
|
+
## GFM Complete
|
|
201
199
|
|
|
202
200
|
Full demonstration of all GFM features.
|
|
203
201
|
|
|
@@ -227,9 +225,7 @@ Full demonstration of all GFM features.
|
|
|
227
225
|
- **Critical UI text**: Use Typography for button labels, form labels, etc.
|
|
228
226
|
- **Structured data**: Use DataTable or custom components for tabular data
|
|
229
227
|
|
|
230
|
-
##
|
|
231
|
-
|
|
232
|
-
### Article/Blog Content
|
|
228
|
+
## Article/Blog Content
|
|
233
229
|
|
|
234
230
|
```tsx
|
|
235
231
|
function ArticlePage({ article }) {
|
|
@@ -257,7 +253,7 @@ function ArticlePage({ article }) {
|
|
|
257
253
|
}
|
|
258
254
|
```
|
|
259
255
|
|
|
260
|
-
|
|
256
|
+
## Comment with Formatting
|
|
261
257
|
|
|
262
258
|
```tsx
|
|
263
259
|
function Comment({ comment }) {
|
|
@@ -283,7 +279,7 @@ function Comment({ comment }) {
|
|
|
283
279
|
}
|
|
284
280
|
```
|
|
285
281
|
|
|
286
|
-
|
|
282
|
+
## Release Notes
|
|
287
283
|
|
|
288
284
|
```tsx
|
|
289
285
|
function ReleaseNotes({ version, notes }) {
|
|
@@ -321,7 +317,7 @@ const releaseNotes = `
|
|
|
321
317
|
`;
|
|
322
318
|
```
|
|
323
319
|
|
|
324
|
-
|
|
320
|
+
## Help Documentation
|
|
325
321
|
|
|
326
322
|
```tsx
|
|
327
323
|
function HelpArticle({ title, content }) {
|
|
@@ -369,7 +365,7 @@ Contact us at [support@example.com](mailto:support@example.com).
|
|
|
369
365
|
`;
|
|
370
366
|
```
|
|
371
367
|
|
|
372
|
-
|
|
368
|
+
## Task Description with Checklist
|
|
373
369
|
|
|
374
370
|
```tsx
|
|
375
371
|
function TaskDetails({ task }) {
|
|
@@ -406,7 +402,7 @@ Make sure to follow the ||coding standards|| and add proper error handling.
|
|
|
406
402
|
`;
|
|
407
403
|
```
|
|
408
404
|
|
|
409
|
-
|
|
405
|
+
## Notification Content
|
|
410
406
|
|
|
411
407
|
```tsx
|
|
412
408
|
function NotificationDetail({ notification }) {
|
|
@@ -431,7 +427,7 @@ const notification = {
|
|
|
431
427
|
};
|
|
432
428
|
```
|
|
433
429
|
|
|
434
|
-
|
|
430
|
+
## Email Preview
|
|
435
431
|
|
|
436
432
|
```tsx
|
|
437
433
|
function EmailPreview({ subject, body }) {
|
|
@@ -453,7 +449,7 @@ function EmailPreview({ subject, body }) {
|
|
|
453
449
|
}
|
|
454
450
|
```
|
|
455
451
|
|
|
456
|
-
|
|
452
|
+
## API Documentation
|
|
457
453
|
|
|
458
454
|
```tsx
|
|
459
455
|
function APIDocumentation({ endpoint }) {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
>
|
|
5
|
+
> **Note**: If you need to display large volumes of data, the DataTable component may be a better fit. The Table component is better suited for smaller datasets, flexible customization, and rendering complex UI inside cells. For cell merging with `rowSpan`, `colSpan`, or non-trivial table structures, we recommend composing the Table component directly.
|
|
6
6
|
|
|
7
|
-
Table
|
|
7
|
+
The Table component is a foundational table component for displaying structured data in a tabular format. It is based on Joy UI Table and supports flexible customization and complex layouts. It can be used for everything from simple data display to complex cell merging and custom content.
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
10
|
<Table aria-label="basic table" {...args}>
|
|
@@ -60,11 +60,9 @@ function MyComponent() {
|
|
|
60
60
|
}
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
## Examples
|
|
63
|
+
## Table Basic Examples
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
가장 기본적인 Table 사용법들입니다.
|
|
65
|
+
The most basic Table usage patterns.
|
|
68
66
|
|
|
69
67
|
```tsx
|
|
70
68
|
<Table aria-label="basic table" {...args}>
|
|
@@ -86,9 +84,9 @@ function MyComponent() {
|
|
|
86
84
|
</Table>
|
|
87
85
|
```
|
|
88
86
|
|
|
89
|
-
|
|
87
|
+
## Table With Hover Effect
|
|
90
88
|
|
|
91
|
-
|
|
89
|
+
You can apply a highlight effect when hovering over rows.
|
|
92
90
|
|
|
93
91
|
```tsx
|
|
94
92
|
<Table
|
|
@@ -97,9 +95,9 @@ function MyComponent() {
|
|
|
97
95
|
/>
|
|
98
96
|
```
|
|
99
97
|
|
|
100
|
-
|
|
98
|
+
## Table With Checkbox Selection
|
|
101
99
|
|
|
102
|
-
|
|
100
|
+
A selectable table that includes checkboxes.
|
|
103
101
|
|
|
104
102
|
```tsx
|
|
105
103
|
<Table aria-label="checkbox table" hoverRow {...args}>
|
|
@@ -121,11 +119,9 @@ function MyComponent() {
|
|
|
121
119
|
</Table>
|
|
122
120
|
```
|
|
123
121
|
|
|
124
|
-
##
|
|
125
|
-
|
|
126
|
-
### User Management Table
|
|
122
|
+
## User Management Table
|
|
127
123
|
|
|
128
|
-
|
|
124
|
+
A table for user management. It includes avatars, role labels, status indicators, and action buttons.
|
|
129
125
|
|
|
130
126
|
```tsx
|
|
131
127
|
<Table aria-label="user management table" hoverRow>
|
|
@@ -300,9 +296,9 @@ function MyComponent() {
|
|
|
300
296
|
</Table>
|
|
301
297
|
```
|
|
302
298
|
|
|
303
|
-
|
|
299
|
+
## Product Inventory Table
|
|
304
300
|
|
|
305
|
-
|
|
301
|
+
A table for product inventory management. It includes stock status, price display, progress bars, and more.
|
|
306
302
|
|
|
307
303
|
```tsx
|
|
308
304
|
<Table aria-label="product inventory table" hoverRow>
|
|
@@ -419,9 +415,9 @@ function MyComponent() {
|
|
|
419
415
|
</Table>
|
|
420
416
|
```
|
|
421
417
|
|
|
422
|
-
|
|
418
|
+
## Task Management Table
|
|
423
419
|
|
|
424
|
-
|
|
420
|
+
A table for project task management. It displays assignees, priorities, progress, due dates, and more.
|
|
425
421
|
|
|
426
422
|
```tsx
|
|
427
423
|
<Table aria-label="task management table" hoverRow>
|
|
@@ -572,9 +568,9 @@ function MyComponent() {
|
|
|
572
568
|
</Table>
|
|
573
569
|
```
|
|
574
570
|
|
|
575
|
-
|
|
571
|
+
## Sales Report Table with Cell Merging
|
|
576
572
|
|
|
577
|
-
|
|
573
|
+
A sales report table that uses complex cell merging. This example uses `rowSpan` and `colSpan`.
|
|
578
574
|
|
|
579
575
|
```tsx
|
|
580
576
|
<Table aria-label="sales report table with merged cells">
|
|
@@ -768,9 +764,9 @@ function MyComponent() {
|
|
|
768
764
|
</Table>
|
|
769
765
|
```
|
|
770
766
|
|
|
771
|
-
|
|
767
|
+
## Comparison Table
|
|
772
768
|
|
|
773
|
-
|
|
769
|
+
A table for comparing plans or products. It visually represents boolean values.
|
|
774
770
|
|
|
775
771
|
```tsx
|
|
776
772
|
<Table aria-label="plan comparison table">
|
|
@@ -927,9 +923,9 @@ function MyComponent() {
|
|
|
927
923
|
</Table>
|
|
928
924
|
```
|
|
929
925
|
|
|
930
|
-
|
|
926
|
+
## Empty State Table
|
|
931
927
|
|
|
932
|
-
|
|
928
|
+
A table that displays an empty state when no data is available.
|
|
933
929
|
|
|
934
930
|
```tsx
|
|
935
931
|
<Stack spacing={2}>
|
|
@@ -994,9 +990,9 @@ function MyComponent() {
|
|
|
994
990
|
</Stack>
|
|
995
991
|
```
|
|
996
992
|
|
|
997
|
-
|
|
993
|
+
## Advanced Features Table
|
|
998
994
|
|
|
999
|
-
|
|
995
|
+
A table that includes advanced features such as sticky headers, scrolling, and responsiveness.
|
|
1000
996
|
|
|
1001
997
|
```tsx
|
|
1002
998
|
<Box sx={{
|
|
@@ -1073,9 +1069,9 @@ function MyComponent() {
|
|
|
1073
1069
|
</Box>
|
|
1074
1070
|
```
|
|
1075
1071
|
|
|
1076
|
-
|
|
1072
|
+
## Drag and Drop Headers Table
|
|
1077
1073
|
|
|
1078
|
-
|
|
1074
|
+
A table that uses `@atlaskit/pragmatic-drag-and-drop` so headers can be dragged to reorder columns.
|
|
1079
1075
|
|
|
1080
1076
|
```tsx
|
|
1081
1077
|
<Stack spacing={3}>
|
|
@@ -1125,13 +1121,11 @@ function MyComponent() {
|
|
|
1125
1121
|
</Stack>
|
|
1126
1122
|
```
|
|
1127
1123
|
|
|
1128
|
-
##
|
|
1124
|
+
## Table Implementation Guidelines
|
|
1129
1125
|
|
|
1130
|
-
|
|
1126
|
+
The Canvas examples above are fully working components. The Table component can be used in two ways:
|
|
1131
1127
|
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
#### 1. TableHead와 TableBody 사용 (간단한 데이터)
|
|
1128
|
+
### Using TableHead and TableBody
|
|
1135
1129
|
|
|
1136
1130
|
```tsx
|
|
1137
1131
|
import { Table, TableHead, TableBody } from '@ceed/ads';
|
|
@@ -1160,9 +1154,9 @@ function SimpleTable() {
|
|
|
1160
1154
|
}
|
|
1161
1155
|
```
|
|
1162
1156
|
|
|
1163
|
-
|
|
1157
|
+
### Using the HTML Table Structure for Complex UI
|
|
1164
1158
|
|
|
1165
|
-
|
|
1159
|
+
When rendering complex UI components inside cells, use the HTML table structure directly:
|
|
1166
1160
|
|
|
1167
1161
|
```tsx
|
|
1168
1162
|
import { Table, Stack, Avatar, Typography, Chip, IconButton } from '@ceed/ads';
|
|
@@ -1216,9 +1210,9 @@ function ComplexTable() {
|
|
|
1216
1210
|
}
|
|
1217
1211
|
```
|
|
1218
1212
|
|
|
1219
|
-
|
|
1213
|
+
### Cell Merging with rowSpan and colSpan
|
|
1220
1214
|
|
|
1221
|
-
|
|
1215
|
+
For complex table layouts, you can use the HTML table structure directly:
|
|
1222
1216
|
|
|
1223
1217
|
```tsx
|
|
1224
1218
|
<Table>
|
|
@@ -1239,13 +1233,11 @@ function ComplexTable() {
|
|
|
1239
1233
|
</Table>
|
|
1240
1234
|
```
|
|
1241
1235
|
|
|
1242
|
-
##
|
|
1243
|
-
|
|
1244
|
-
Table 컴포넌트는 다양한 고급 기능을 지원합니다:
|
|
1236
|
+
## Table Sticky Headers
|
|
1245
1237
|
|
|
1246
|
-
|
|
1238
|
+
The Table component supports various advanced features:
|
|
1247
1239
|
|
|
1248
|
-
|
|
1240
|
+
Keeps the header fixed while scrolling:
|
|
1249
1241
|
|
|
1250
1242
|
```tsx
|
|
1251
1243
|
<Table stickyHeader sx={{
|
|
@@ -1260,9 +1252,9 @@ Table 컴포넌트는 다양한 고급 기능을 지원합니다:
|
|
|
1260
1252
|
</Table>
|
|
1261
1253
|
```
|
|
1262
1254
|
|
|
1263
|
-
|
|
1255
|
+
## Table Empty States
|
|
1264
1256
|
|
|
1265
|
-
|
|
1257
|
+
Displays an appropriate empty state when no data is available:
|
|
1266
1258
|
|
|
1267
1259
|
```tsx
|
|
1268
1260
|
<tbody>
|
|
@@ -1279,9 +1271,9 @@ Table 컴포넌트는 다양한 고급 기능을 지원합니다:
|
|
|
1279
1271
|
</tbody>
|
|
1280
1272
|
```
|
|
1281
1273
|
|
|
1282
|
-
|
|
1274
|
+
## Table Responsive Design
|
|
1283
1275
|
|
|
1284
|
-
|
|
1276
|
+
Guidance for responsive design:
|
|
1285
1277
|
|
|
1286
1278
|
```tsx
|
|
1287
1279
|
<Table sx={{
|
|
@@ -1296,11 +1288,29 @@ Table 컴포넌트는 다양한 고급 기능을 지원합니다:
|
|
|
1296
1288
|
</Table>
|
|
1297
1289
|
```
|
|
1298
1290
|
|
|
1291
|
+
## Props and Customization
|
|
1292
|
+
|
|
1293
|
+
### Key Props
|
|
1294
|
+
|
|
1295
|
+
| Prop | Type | Default | Description |
|
|
1296
|
+
| -------------- | ----------------------------------------------------------------------------- | ------------ | ----------------------------------- |
|
|
1297
|
+
| `children` | `ReactNode` | - | Table content (thead, tbody, tfoot) |
|
|
1298
|
+
| `borderAxis` | `'none' \| 'x' \| 'y' \| 'both' \| 'xBetween' \| 'yBetween' \| 'bothBetween'` | `'xBetween'` | Border display mode |
|
|
1299
|
+
| `stripe` | `'odd' \| 'even'` | - | Striped row background |
|
|
1300
|
+
| `hoverRow` | `boolean` | `false` | Highlight rows on hover |
|
|
1301
|
+
| `stickyHeader` | `boolean` | `false` | Fix the header when scrolling |
|
|
1302
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Table size |
|
|
1303
|
+
| `variant` | `'plain' \| 'outlined' \| 'soft' \| 'solid'` | `'plain'` | Visual style |
|
|
1304
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Color scheme |
|
|
1305
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
1306
|
+
|
|
1307
|
+
> **Note**: Table also accepts all Joy UI Table props.
|
|
1308
|
+
|
|
1299
1309
|
## Best Practices
|
|
1300
1310
|
|
|
1301
|
-
1.
|
|
1311
|
+
1. **Choose the right component**: Use DataTable for large datasets and Table for complex layouts.
|
|
1302
1312
|
|
|
1303
|
-
2.
|
|
1313
|
+
2. **Consider accessibility**: Use proper table tags and ARIA attributes.
|
|
1304
1314
|
|
|
1305
1315
|
```tsx
|
|
1306
1316
|
<Table aria-label="사용자 목록">
|
|
@@ -1319,12 +1329,12 @@ Table 컴포넌트는 다양한 고급 기능을 지원합니다:
|
|
|
1319
1329
|
</Table>
|
|
1320
1330
|
```
|
|
1321
1331
|
|
|
1322
|
-
3.
|
|
1332
|
+
3. **Consistent alignment**: Right-align numeric data and left-align text.
|
|
1323
1333
|
|
|
1324
|
-
4.
|
|
1334
|
+
4. **Appropriate row height**: Set row heights that fit the content.
|
|
1325
1335
|
|
|
1326
|
-
5.
|
|
1336
|
+
5. **Responsive considerations**: On mobile, consider showing only key columns or transforming the layout into cards.
|
|
1327
1337
|
|
|
1328
|
-
6.
|
|
1338
|
+
6. **Performance optimization**: For long lists, consider virtualization or pagination.
|
|
1329
1339
|
|
|
1330
|
-
Table
|
|
1340
|
+
The Table component is a highly useful tool for presenting structured data and implementing complex layouts. With the right usage patterns and customization, it can satisfy a wide range of requirements.
|