@ceed/ads 1.29.1 → 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/DatePicker/DatePicker.d.ts +10 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +10 -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 +87 -5
- package/dist/components/inputs/DateRangePicker.md +91 -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/dist/index.browser.js +2 -2
- package/dist/index.browser.js.map +3 -3
- package/dist/index.cjs +173 -6
- package/dist/index.js +173 -6
- package/framer/index.js +1 -1
- package/package.json +1 -1
|
@@ -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.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
Tooltip
|
|
5
|
+
The Tooltip component is an overlay that provides additional information or help when a user hovers over an element. It is based on Joy UI Tooltip and is used to display concise, useful information that improves the user experience. Common use cases include button descriptions, icon meanings, and showing the full content of truncated text.
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
<Tooltip
|
|
@@ -35,11 +35,9 @@ function MyComponent() {
|
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## Basic Usage
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
가장 기본적인 Tooltip 사용법입니다.
|
|
40
|
+
The most basic Tooltip usage.
|
|
43
41
|
|
|
44
42
|
```tsx
|
|
45
43
|
<Tooltip
|
|
@@ -49,9 +47,9 @@ function MyComponent() {
|
|
|
49
47
|
/>
|
|
50
48
|
```
|
|
51
49
|
|
|
52
|
-
|
|
50
|
+
## Controlled Tooltip
|
|
53
51
|
|
|
54
|
-
|
|
52
|
+
A Tooltip controlled programmatically.
|
|
55
53
|
|
|
56
54
|
```tsx
|
|
57
55
|
<Tooltip
|
|
@@ -62,11 +60,9 @@ function MyComponent() {
|
|
|
62
60
|
/>
|
|
63
61
|
```
|
|
64
62
|
|
|
65
|
-
##
|
|
66
|
-
|
|
67
|
-
### Icon Button Descriptions
|
|
63
|
+
## Tooltip for Icon Buttons
|
|
68
64
|
|
|
69
|
-
|
|
65
|
+
Used to explain the meaning of icon buttons.
|
|
70
66
|
|
|
71
67
|
```tsx
|
|
72
68
|
<Stack direction="row" spacing={1}>
|
|
@@ -90,9 +86,9 @@ function MyComponent() {
|
|
|
90
86
|
</Stack>
|
|
91
87
|
```
|
|
92
88
|
|
|
93
|
-
|
|
89
|
+
## Tooltip for Truncated Text
|
|
94
90
|
|
|
95
|
-
|
|
91
|
+
Used to display the full content of truncated text.
|
|
96
92
|
|
|
97
93
|
```tsx
|
|
98
94
|
function TruncatedText({ text }: { text: string }) {
|
|
@@ -117,9 +113,9 @@ function TruncatedText({ text }: { text: string }) {
|
|
|
117
113
|
}
|
|
118
114
|
```
|
|
119
115
|
|
|
120
|
-
|
|
116
|
+
## Tooltip for Form Field Help
|
|
121
117
|
|
|
122
|
-
|
|
118
|
+
Used to provide additional help for form fields.
|
|
123
119
|
|
|
124
120
|
```tsx
|
|
125
121
|
<Stack spacing={2}>
|
|
@@ -137,9 +133,9 @@ function TruncatedText({ text }: { text: string }) {
|
|
|
137
133
|
</Stack>
|
|
138
134
|
```
|
|
139
135
|
|
|
140
|
-
|
|
136
|
+
## Tooltip for Status Indicators
|
|
141
137
|
|
|
142
|
-
|
|
138
|
+
Used to display status or progress information.
|
|
143
139
|
|
|
144
140
|
```tsx
|
|
145
141
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
@@ -166,9 +162,9 @@ function TruncatedText({ text }: { text: string }) {
|
|
|
166
162
|
</Stack>
|
|
167
163
|
```
|
|
168
164
|
|
|
169
|
-
|
|
165
|
+
## Tooltip for Navigation Hints
|
|
170
166
|
|
|
171
|
-
|
|
167
|
+
Used to provide help text for navigation elements.
|
|
172
168
|
|
|
173
169
|
```tsx
|
|
174
170
|
<Stack direction="row" spacing={2}>
|
|
@@ -194,9 +190,9 @@ function TruncatedText({ text }: { text: string }) {
|
|
|
194
190
|
</Stack>
|
|
195
191
|
```
|
|
196
192
|
|
|
197
|
-
|
|
193
|
+
## Tooltip with Rich Content
|
|
198
194
|
|
|
199
|
-
|
|
195
|
+
A Tooltip with complex content.
|
|
200
196
|
|
|
201
197
|
```tsx
|
|
202
198
|
<Tooltip
|
|
@@ -220,9 +216,9 @@ function TruncatedText({ text }: { text: string }) {
|
|
|
220
216
|
</Tooltip>
|
|
221
217
|
```
|
|
222
218
|
|
|
223
|
-
|
|
219
|
+
## Tooltip with Interactive Elements
|
|
224
220
|
|
|
225
|
-
|
|
221
|
+
Used with interactive elements.
|
|
226
222
|
|
|
227
223
|
```tsx
|
|
228
224
|
<Stack direction="row" spacing={2}>
|
|
@@ -246,17 +242,33 @@ function TruncatedText({ text }: { text: string }) {
|
|
|
246
242
|
|
|
247
243
|
## Props and Customization
|
|
248
244
|
|
|
249
|
-
###
|
|
245
|
+
### Key Props
|
|
246
|
+
|
|
247
|
+
| Prop | Type | Default | Description |
|
|
248
|
+
| ----------- | ------------------------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------- |
|
|
249
|
+
| `title` | `ReactNode` | - | Content displayed inside the tooltip |
|
|
250
|
+
| `placement` | `'top' \| 'bottom' \| 'left' \| 'right' \| 'top-start' \| 'top-end' \| 'bottom-start' \| 'bottom-end' \| ...` | `'bottom'` | Tooltip position relative to the child element |
|
|
251
|
+
| `arrow` | `boolean` | `false` | Show an arrow pointing to the target element |
|
|
252
|
+
| `open` | `boolean` | - | Controls tooltip visibility (controlled mode) |
|
|
253
|
+
| `onClose` | `() => void` | - | Callback when tooltip should close |
|
|
254
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Tooltip color scheme |
|
|
255
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'solid'` | Visual style |
|
|
256
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Tooltip size |
|
|
257
|
+
| `sx` | `SxProps` | - | Custom styles using the MUI system |
|
|
258
|
+
|
|
259
|
+
> **Note**: Tooltip also accepts all Joy UI Tooltip props and Framer Motion props.
|
|
260
|
+
|
|
261
|
+
## Tooltip Title Prop
|
|
250
262
|
|
|
251
|
-
|
|
263
|
+
Specifies the content displayed in the Tooltip.
|
|
252
264
|
|
|
253
265
|
```tsx
|
|
254
|
-
//
|
|
266
|
+
// Simple text
|
|
255
267
|
<Tooltip title="간단한 도움말">
|
|
256
268
|
<Button>버튼</Button>
|
|
257
269
|
</Tooltip>
|
|
258
270
|
|
|
259
|
-
// React
|
|
271
|
+
// React element
|
|
260
272
|
<Tooltip
|
|
261
273
|
title={
|
|
262
274
|
<div>
|
|
@@ -269,9 +281,9 @@ Tooltip에 표시될 내용을 지정합니다.
|
|
|
269
281
|
</Tooltip>
|
|
270
282
|
```
|
|
271
283
|
|
|
272
|
-
|
|
284
|
+
## Tooltip Placement
|
|
273
285
|
|
|
274
|
-
|
|
286
|
+
You can adjust where the Tooltip appears.
|
|
275
287
|
|
|
276
288
|
```tsx
|
|
277
289
|
<Stack direction="row" spacing={2} sx={{ mt: 4 }}>
|
|
@@ -293,9 +305,9 @@ Tooltip이 나타나는 위치를 조정할 수 있습니다.
|
|
|
293
305
|
</Stack>
|
|
294
306
|
```
|
|
295
307
|
|
|
296
|
-
|
|
308
|
+
## Tooltip Colors and Variants
|
|
297
309
|
|
|
298
|
-
|
|
310
|
+
You can apply various colors and variants.
|
|
299
311
|
|
|
300
312
|
```tsx
|
|
301
313
|
<Stack direction="row" spacing={2}>
|
|
@@ -317,9 +329,9 @@ Tooltip이 나타나는 위치를 조정할 수 있습니다.
|
|
|
317
329
|
</Stack>
|
|
318
330
|
```
|
|
319
331
|
|
|
320
|
-
|
|
332
|
+
## Tooltip Arrow
|
|
321
333
|
|
|
322
|
-
|
|
334
|
+
You can show an arrow to make it clear which element the Tooltip points to.
|
|
323
335
|
|
|
324
336
|
```tsx
|
|
325
337
|
<Stack direction="row" spacing={2}>
|
|
@@ -333,9 +345,9 @@ Tooltip이 나타나는 위치를 조정할 수 있습니다.
|
|
|
333
345
|
</Stack>
|
|
334
346
|
```
|
|
335
347
|
|
|
336
|
-
|
|
348
|
+
## Tooltip Controlled Mode
|
|
337
349
|
|
|
338
|
-
|
|
350
|
+
You can control the Tooltip's visibility programmatically.
|
|
339
351
|
|
|
340
352
|
```tsx
|
|
341
353
|
function ControlledTooltip() {
|
|
@@ -355,11 +367,11 @@ function ControlledTooltip() {
|
|
|
355
367
|
|
|
356
368
|
## Accessibility
|
|
357
369
|
|
|
358
|
-
Tooltip
|
|
370
|
+
The Tooltip component provides the following accessibility features:
|
|
359
371
|
|
|
360
|
-
### ARIA
|
|
372
|
+
### ARIA Attributes
|
|
361
373
|
|
|
362
|
-
|
|
374
|
+
Appropriate ARIA attributes are applied automatically.
|
|
363
375
|
|
|
364
376
|
```tsx
|
|
365
377
|
<Tooltip title="저장 버튼">
|
|
@@ -369,16 +381,16 @@ Tooltip 컴포넌트는 다음과 같은 접근성 기능을 제공합니다:
|
|
|
369
381
|
</Tooltip>
|
|
370
382
|
```
|
|
371
383
|
|
|
372
|
-
###
|
|
384
|
+
### Keyboard Support
|
|
373
385
|
|
|
374
|
-
|
|
386
|
+
Keyboard users can also use the Tooltip.
|
|
375
387
|
|
|
376
|
-
- **Tab**:
|
|
377
|
-
- **Escape**:
|
|
388
|
+
- **Tab**: Move to a focusable element
|
|
389
|
+
- **Escape**: Close the open Tooltip
|
|
378
390
|
|
|
379
|
-
###
|
|
391
|
+
### Touch Device Support
|
|
380
392
|
|
|
381
|
-
|
|
393
|
+
Supports tap gestures so the Tooltip can also be used on touch devices.
|
|
382
394
|
|
|
383
395
|
```tsx
|
|
384
396
|
<Tooltip title="터치 기기에서도 동작합니다" touchTapDelay={0}>
|
|
@@ -388,30 +400,30 @@ Tooltip 컴포넌트는 다음과 같은 접근성 기능을 제공합니다:
|
|
|
388
400
|
|
|
389
401
|
## Best Practices
|
|
390
402
|
|
|
391
|
-
1.
|
|
403
|
+
1. **Concise content**: Keep Tooltip content brief and easy to understand.
|
|
392
404
|
|
|
393
405
|
```tsx
|
|
394
|
-
// ✅
|
|
406
|
+
// ✅ Good example
|
|
395
407
|
<Tooltip title="삭제">
|
|
396
408
|
<IconButton><DeleteIcon /></IconButton>
|
|
397
409
|
</Tooltip>
|
|
398
410
|
|
|
399
|
-
// ❌
|
|
411
|
+
// ❌ Bad example
|
|
400
412
|
<Tooltip title="이 버튼을 클릭하면 선택된 항목이 영구적으로 삭제되며 복구할 수 없습니다">
|
|
401
413
|
<IconButton><DeleteIcon /></IconButton>
|
|
402
414
|
</Tooltip>
|
|
403
415
|
```
|
|
404
416
|
|
|
405
|
-
2.
|
|
417
|
+
2. **Use another channel for critical information**: Do not rely on a Tooltip alone for essential information.
|
|
406
418
|
|
|
407
|
-
3.
|
|
419
|
+
3. **Appropriate timing**: Show it only when the user needs help.
|
|
408
420
|
|
|
409
|
-
4.
|
|
421
|
+
4. **Consistent placement**: Use consistent placement across the application.
|
|
410
422
|
|
|
411
|
-
5.
|
|
423
|
+
5. **Performance considerations**: On pages with many Tooltips, render them only when needed.
|
|
412
424
|
|
|
413
425
|
```tsx
|
|
414
|
-
//
|
|
426
|
+
// Conditional Tooltip
|
|
415
427
|
{
|
|
416
428
|
(needsTooltip && (
|
|
417
429
|
<Tooltip title="도움말">
|
|
@@ -421,15 +433,15 @@ Tooltip 컴포넌트는 다음과 같은 접근성 기능을 제공합니다:
|
|
|
421
433
|
}
|
|
422
434
|
```
|
|
423
435
|
|
|
424
|
-
6.
|
|
436
|
+
6. **Mobile considerations**: Consider alternative ways to provide information in mobile environments.
|
|
425
437
|
|
|
426
|
-
7.
|
|
438
|
+
7. **Do not rely on color alone**: Communicate information with text or icons as well.
|
|
427
439
|
|
|
428
440
|
## Performance Considerations
|
|
429
441
|
|
|
430
|
-
1.
|
|
442
|
+
1. **Deferred rendering**: If there are many Tooltips, render them only when needed.
|
|
431
443
|
|
|
432
|
-
2.
|
|
444
|
+
2. **Memoization**: Consider memoizing complex `title` content.
|
|
433
445
|
|
|
434
446
|
```tsx
|
|
435
447
|
const tooltipContent = useMemo(() => <ComplexTooltipContent data={data} />, [data]);
|
|
@@ -439,6 +451,6 @@ const tooltipContent = useMemo(() => <ComplexTooltipContent data={data} />, [dat
|
|
|
439
451
|
</Tooltip>;
|
|
440
452
|
```
|
|
441
453
|
|
|
442
|
-
3.
|
|
454
|
+
3. **Event listener optimization**: Clean up custom event handlers properly.
|
|
443
455
|
|
|
444
|
-
Tooltip
|
|
456
|
+
Tooltip is an important UI component for providing additional context and guidance to users. Used appropriately, it can significantly improve the user experience.
|