@ceed/ads 1.35.1 → 1.36.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/README.md +85 -95
- package/dist/components/Accordions/Accordions.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +5 -5
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts +7 -17
- package/dist/components/Box/Box.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Calendar/Calendar.d.ts +1 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +1 -0
- package/dist/components/Container/Container.d.ts +6 -1
- package/dist/components/DialogActions/DialogActions.d.ts +1 -0
- package/dist/components/DialogContent/DialogContent.d.ts +1 -0
- package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
- package/dist/components/DialogTitle/DialogTitle.d.ts +1 -0
- package/dist/components/Divider/Divider.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +28 -1
- package/dist/components/FilterMenu/components/MonthRange.d.ts +11 -0
- package/dist/components/FilterMenu/types.d.ts +5 -1
- package/dist/components/FormControl/FormControl.d.ts +1 -0
- package/dist/components/FormHelperText/FormHelperText.d.ts +1 -0
- package/dist/components/FormLabel/FormLabel.d.ts +1 -0
- package/dist/components/Grid/Grid.d.ts +1 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -2
- package/dist/components/IconMenuButton/IconMenuButton.d.ts +7 -6
- package/dist/components/InfoSign/InfoSign.d.ts +3 -2
- package/dist/components/Input/Input.d.ts +8 -22
- package/dist/components/InsetDrawer/InsetDrawer.d.ts +1 -0
- package/dist/components/Markdown/Markdown.d.ts +9 -24
- package/dist/components/Menu/Menu.d.ts +2 -1
- package/dist/components/MenuButton/MenuButton.d.ts +10 -8
- package/dist/components/Modal/Modal.d.ts +4 -2
- package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -2
- package/dist/components/NavigationItem/NavigationItem.d.ts +3 -2
- package/dist/components/Navigator/Navigator.d.ts +5 -4
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/ProfileMenu/ProfileMenu.d.ts +2 -2
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/RadioList/RadioList.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +12 -10
- package/dist/components/Sheet/Sheet.d.ts +1 -0
- package/dist/components/Stack/Stack.d.ts +1 -0
- package/dist/components/Stepper/Stepper.d.ts +2 -1
- package/dist/components/Switch/Switch.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +7 -5
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts +8 -20
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +4 -2
- package/dist/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +1 -0
- package/dist/components/Uploader/Uploader.d.ts +18 -17
- package/dist/components/data-display/Avatar.md +60 -72
- package/dist/components/data-display/Badge.md +197 -181
- package/dist/components/data-display/Chip.md +164 -142
- package/dist/components/data-display/DataTable.md +843 -338
- package/dist/components/data-display/InfoSign.md +1 -3
- package/dist/components/data-display/Markdown.md +93 -125
- package/dist/components/data-display/Table.md +1453 -1007
- package/dist/components/data-display/Typography.md +101 -104
- package/dist/components/feedback/Alert.md +80 -86
- package/dist/components/feedback/CircularProgress.md +32 -36
- package/dist/components/feedback/Dialog.md +25 -17
- package/dist/components/feedback/Modal.md +296 -265
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +60 -1
- package/dist/components/inputs/Autocomplete.md +191 -95
- package/dist/components/inputs/Button.md +83 -83
- package/dist/components/inputs/ButtonGroup.md +195 -185
- package/dist/components/inputs/Calendar.md +25 -28
- package/dist/components/inputs/Checkbox.md +11 -29
- package/dist/components/inputs/CurrencyInput.md +4 -4
- package/dist/components/inputs/DatePicker.md +229 -110
- package/dist/components/inputs/DateRangePicker.md +248 -137
- package/dist/components/inputs/FilterMenu.md +138 -8
- package/dist/components/inputs/FilterableCheckboxGroup.md +115 -55
- package/dist/components/inputs/FormControl.md +75 -69
- package/dist/components/inputs/IconButton.md +229 -205
- package/dist/components/inputs/Input.md +131 -98
- package/dist/components/inputs/MonthPicker.md +186 -84
- package/dist/components/inputs/MonthRangePicker.md +73 -49
- package/dist/components/inputs/PercentageInput.md +15 -31
- package/dist/components/inputs/RadioButton.md +320 -256
- package/dist/components/inputs/RadioList.md +66 -50
- package/dist/components/inputs/RadioTileGroup.md +287 -170
- package/dist/components/inputs/SearchBar.md +82 -60
- package/dist/components/inputs/Select.md +106 -95
- package/dist/components/inputs/Slider.md +153 -102
- package/dist/components/inputs/Switch.md +193 -138
- package/dist/components/inputs/Textarea.md +15 -20
- package/dist/components/inputs/Uploader/Uploader.md +68 -39
- package/dist/components/layout/Box.md +841 -662
- package/dist/components/layout/Container.md +3 -11
- package/dist/components/layout/Grid.md +480 -394
- package/dist/components/layout/Stack.md +739 -566
- package/dist/components/navigation/Breadcrumbs.md +182 -116
- package/dist/components/navigation/Dropdown.md +732 -391
- package/dist/components/navigation/IconMenuButton.md +14 -6
- package/dist/components/navigation/InsetDrawer.md +550 -378
- package/dist/components/navigation/Link.md +104 -94
- package/dist/components/navigation/Menu.md +623 -502
- package/dist/components/navigation/MenuButton.md +18 -10
- package/dist/components/navigation/NavigationGroup.md +19 -50
- package/dist/components/navigation/NavigationItem.md +6 -6
- package/dist/components/navigation/Navigator.md +26 -28
- package/dist/components/navigation/Pagination.md +86 -75
- package/dist/components/navigation/ProfileMenu.md +65 -43
- package/dist/components/navigation/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +209 -183
- package/dist/components/surfaces/Accordions.md +89 -172
- package/dist/components/surfaces/Card.md +1094 -709
- package/dist/components/surfaces/Divider.md +562 -412
- package/dist/components/surfaces/Sheet.md +700 -518
- package/dist/guides/ThemeProvider.md +65 -40
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1643 -1550
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1303 -1202
- package/framer/index.js +1 -1
- package/package.json +32 -35
|
@@ -52,8 +52,8 @@ An avatar that uses an image.
|
|
|
52
52
|
|
|
53
53
|
```tsx
|
|
54
54
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
55
|
-
|
|
56
|
-
</Stack>
|
|
55
|
+
<Avatar {...args} />
|
|
56
|
+
</Stack>
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
## Avatar With Text
|
|
@@ -62,8 +62,8 @@ An avatar that uses text or initials.
|
|
|
62
62
|
|
|
63
63
|
```tsx
|
|
64
64
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
65
|
-
|
|
66
|
-
</Stack>
|
|
65
|
+
<Avatar {...args} />
|
|
66
|
+
</Stack>
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
## Avatar Variants
|
|
@@ -72,8 +72,10 @@ You can apply various visual styles.
|
|
|
72
72
|
|
|
73
73
|
```tsx
|
|
74
74
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
{variants.map((variant) => (
|
|
76
|
+
<Avatar key={variant} {...args} variant={variant} />
|
|
77
|
+
))}
|
|
78
|
+
</Stack>
|
|
77
79
|
```
|
|
78
80
|
|
|
79
81
|
- **solid**: A style with a filled background color
|
|
@@ -87,10 +89,12 @@ You can use avatars in various sizes.
|
|
|
87
89
|
|
|
88
90
|
```tsx
|
|
89
91
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</
|
|
92
|
+
{sizesWithXs.map((size) => (
|
|
93
|
+
<Avatar key={size} {...args} size={size}>
|
|
94
|
+
{getSizeContent(size)}
|
|
95
|
+
</Avatar>
|
|
96
|
+
))}
|
|
97
|
+
</Stack>
|
|
94
98
|
```
|
|
95
99
|
|
|
96
100
|
- **xs**: Extra small size (16px)
|
|
@@ -104,8 +108,10 @@ You can apply various color themes.
|
|
|
104
108
|
|
|
105
109
|
```tsx
|
|
106
110
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
{colors.map((color) => (
|
|
112
|
+
<Avatar key={color} {...args} color={color} />
|
|
113
|
+
))}
|
|
114
|
+
</Stack>
|
|
109
115
|
```
|
|
110
116
|
|
|
111
117
|
- **primary**: Primary brand color
|
|
@@ -120,26 +126,32 @@ You can review all variant, size, and color combinations.
|
|
|
120
126
|
|
|
121
127
|
```tsx
|
|
122
128
|
<Stack gap={8}>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
</
|
|
129
|
+
{variants.map((variant) => (
|
|
130
|
+
<Stack key={variant} gap={2}>
|
|
131
|
+
<Typography level="title-md">
|
|
132
|
+
{variant.slice(0, 1).toLocaleUpperCase()}
|
|
133
|
+
{variant.slice(1)} Variant
|
|
134
|
+
</Typography>
|
|
135
|
+
{colors.map((color) => (
|
|
136
|
+
<Stack key={color} direction="row" gap={2} alignItems="center">
|
|
137
|
+
{sizesWithXs.map((size) => (
|
|
138
|
+
<Stack key={size} alignItems="center" gap={1}>
|
|
139
|
+
<Avatar {...args} size={size} color={color} variant={variant}>
|
|
140
|
+
{getSizeContent(size)}
|
|
141
|
+
</Avatar>
|
|
142
|
+
<Typography level="body-sm">{size}</Typography>
|
|
143
|
+
</Stack>
|
|
144
|
+
))}
|
|
145
|
+
{/* With image */}
|
|
146
|
+
<Stack alignItems="center" gap={1}>
|
|
147
|
+
<Avatar {...args} size="md" color={color} variant={variant} />
|
|
148
|
+
<Typography level="body-sm">image</Typography>
|
|
149
|
+
</Stack>
|
|
150
|
+
</Stack>
|
|
151
|
+
))}
|
|
152
|
+
</Stack>
|
|
153
|
+
))}
|
|
154
|
+
</Stack>
|
|
143
155
|
```
|
|
144
156
|
|
|
145
157
|
## Avatar User Profile
|
|
@@ -148,11 +160,7 @@ An example of using an avatar in a user profile.
|
|
|
148
160
|
|
|
149
161
|
```tsx
|
|
150
162
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
151
|
-
<Avatar
|
|
152
|
-
src="/user-profile.jpg"
|
|
153
|
-
alt="김철수"
|
|
154
|
-
size="lg"
|
|
155
|
-
/>
|
|
163
|
+
<Avatar src="/user-profile.jpg" alt="김철수" size="lg" />
|
|
156
164
|
<Stack>
|
|
157
165
|
<Typography level="title-md">김철수</Typography>
|
|
158
166
|
<Typography level="body-sm" color="neutral">
|
|
@@ -194,9 +202,7 @@ Used to represent a user in comments or feeds.
|
|
|
194
202
|
2시간 전
|
|
195
203
|
</Typography>
|
|
196
204
|
</Stack>
|
|
197
|
-
<Typography level="body-md">
|
|
198
|
-
이것은 사용자의 댓글 내용입니다.
|
|
199
|
-
</Typography>
|
|
205
|
+
<Typography level="body-md">이것은 사용자의 댓글 내용입니다.</Typography>
|
|
200
206
|
</Stack>
|
|
201
207
|
</Stack>
|
|
202
208
|
```
|
|
@@ -211,13 +217,7 @@ Used to display a list of team members.
|
|
|
211
217
|
|
|
212
218
|
{teamMembers.map((member) => (
|
|
213
219
|
<Stack key={member.id} direction="row" spacing={2} alignItems="center">
|
|
214
|
-
<Avatar
|
|
215
|
-
src={member.avatar}
|
|
216
|
-
alt={member.name}
|
|
217
|
-
size="md"
|
|
218
|
-
variant="soft"
|
|
219
|
-
color="primary"
|
|
220
|
-
>
|
|
220
|
+
<Avatar src={member.avatar} alt={member.name} size="md" variant="soft" color="primary">
|
|
221
221
|
{member.name.charAt(0)}
|
|
222
222
|
</Avatar>
|
|
223
223
|
<Stack flex={1}>
|
|
@@ -240,9 +240,15 @@ Used to display multiple users as a group.
|
|
|
240
240
|
|
|
241
241
|
```tsx
|
|
242
242
|
<Stack direction="row" spacing={-1}>
|
|
243
|
-
<Avatar size="sm" variant="solid" color="primary"
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
<Avatar size="sm" variant="solid" color="primary">
|
|
244
|
+
김
|
|
245
|
+
</Avatar>
|
|
246
|
+
<Avatar size="sm" variant="solid" color="success">
|
|
247
|
+
이
|
|
248
|
+
</Avatar>
|
|
249
|
+
<Avatar size="sm" variant="solid" color="warning">
|
|
250
|
+
박
|
|
251
|
+
</Avatar>
|
|
246
252
|
<Avatar size="sm" variant="outlined" color="neutral">
|
|
247
253
|
<Typography level="body-xs">+3</Typography>
|
|
248
254
|
</Avatar>
|
|
@@ -321,12 +327,7 @@ Used to represent users or items in list items.
|
|
|
321
327
|
If image loading fails, it automatically falls back to initials or an icon.
|
|
322
328
|
|
|
323
329
|
```tsx
|
|
324
|
-
<Avatar
|
|
325
|
-
src="/broken-image-url.jpg"
|
|
326
|
-
alt="김철수"
|
|
327
|
-
color="primary"
|
|
328
|
-
variant="soft"
|
|
329
|
-
>
|
|
330
|
+
<Avatar src="/broken-image-url.jpg" alt="김철수" color="primary" variant="soft">
|
|
330
331
|
김
|
|
331
332
|
</Avatar>
|
|
332
333
|
```
|
|
@@ -336,12 +337,7 @@ If image loading fails, it automatically falls back to initials or an icon.
|
|
|
336
337
|
While the image is loading, `children` are shown first, then the image is displayed once loading completes.
|
|
337
338
|
|
|
338
339
|
```tsx
|
|
339
|
-
<Avatar
|
|
340
|
-
src="/slow-loading-image.jpg"
|
|
341
|
-
alt="사용자"
|
|
342
|
-
color="neutral"
|
|
343
|
-
variant="soft"
|
|
344
|
-
>
|
|
340
|
+
<Avatar src="/slow-loading-image.jpg" alt="사용자" color="neutral" variant="soft">
|
|
345
341
|
<PersonIcon />
|
|
346
342
|
</Avatar>
|
|
347
343
|
```
|
|
@@ -372,10 +368,7 @@ Avatar provides the following accessibility features:
|
|
|
372
368
|
For image avatars, provide appropriate alt text.
|
|
373
369
|
|
|
374
370
|
```tsx
|
|
375
|
-
<Avatar
|
|
376
|
-
src="/user-profile.jpg"
|
|
377
|
-
alt="김철수의 프로필 사진"
|
|
378
|
-
/>
|
|
371
|
+
<Avatar src="/user-profile.jpg" alt="김철수의 프로필 사진" />
|
|
379
372
|
```
|
|
380
373
|
|
|
381
374
|
### Semantic Meaning
|
|
@@ -383,12 +376,7 @@ For image avatars, provide appropriate alt text.
|
|
|
383
376
|
If the avatar carries meaning rather than serving a purely decorative purpose, provide an appropriate role.
|
|
384
377
|
|
|
385
378
|
```tsx
|
|
386
|
-
<Avatar
|
|
387
|
-
src="/user-avatar.jpg"
|
|
388
|
-
alt="현재 사용자"
|
|
389
|
-
role="img"
|
|
390
|
-
aria-label="현재 로그인한 사용자의 프로필 이미지"
|
|
391
|
-
/>
|
|
379
|
+
<Avatar src="/user-avatar.jpg" alt="현재 사용자" role="img" aria-label="현재 로그인한 사용자의 프로필 이미지" />
|
|
392
380
|
```
|
|
393
381
|
|
|
394
382
|
### Color Contrast
|
|
@@ -8,10 +8,10 @@ Badge supports multiple colors, variants, and sizes for flexible visual customiz
|
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
10
|
<Badge {...args}>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</Badge>
|
|
11
|
+
<IconButton>
|
|
12
|
+
<NotificationsIcon />
|
|
13
|
+
</IconButton>
|
|
14
|
+
</Badge>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
| Field | Description | Default |
|
|
@@ -46,28 +46,30 @@ function MyComponent() {
|
|
|
46
46
|
Basic Badge usage showing numeric counts, max overflow, and text content.
|
|
47
47
|
|
|
48
48
|
```tsx
|
|
49
|
-
<div
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</
|
|
49
|
+
<div
|
|
50
|
+
style={{
|
|
51
|
+
display: "flex",
|
|
52
|
+
gap: "2rem"
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
<Badge badgeContent={4}>
|
|
56
|
+
<IconButton>
|
|
57
|
+
<NotificationsIcon />
|
|
58
|
+
</IconButton>
|
|
59
|
+
</Badge>
|
|
60
|
+
|
|
61
|
+
<Badge badgeContent={100} max={99}>
|
|
62
|
+
<IconButton>
|
|
63
|
+
<EmailIcon />
|
|
64
|
+
</IconButton>
|
|
65
|
+
</Badge>
|
|
66
|
+
|
|
67
|
+
<Badge badgeContent="NEW">
|
|
68
|
+
<IconButton>
|
|
69
|
+
<NotificationsIcon />
|
|
70
|
+
</IconButton>
|
|
71
|
+
</Badge>
|
|
72
|
+
</div>
|
|
71
73
|
```
|
|
72
74
|
|
|
73
75
|
## Colors
|
|
@@ -75,40 +77,42 @@ Basic Badge usage showing numeric counts, max overflow, and text content.
|
|
|
75
77
|
Apply semantic colors to convey the badge's meaning: `primary` for general counts, `danger` for urgent notifications, `success` for online status, and `warning` for attention items.
|
|
76
78
|
|
|
77
79
|
```tsx
|
|
78
|
-
<div
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
</
|
|
80
|
+
<div
|
|
81
|
+
style={{
|
|
82
|
+
display: "flex",
|
|
83
|
+
gap: "2rem"
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
<Badge badgeContent={4} color="primary">
|
|
87
|
+
<IconButton>
|
|
88
|
+
<NotificationsIcon />
|
|
89
|
+
</IconButton>
|
|
90
|
+
</Badge>
|
|
91
|
+
|
|
92
|
+
<Badge badgeContent={4} color="neutral">
|
|
93
|
+
<IconButton>
|
|
94
|
+
<NotificationsIcon />
|
|
95
|
+
</IconButton>
|
|
96
|
+
</Badge>
|
|
97
|
+
|
|
98
|
+
<Badge badgeContent={4} color="danger">
|
|
99
|
+
<IconButton>
|
|
100
|
+
<NotificationsIcon />
|
|
101
|
+
</IconButton>
|
|
102
|
+
</Badge>
|
|
103
|
+
|
|
104
|
+
<Badge badgeContent={4} color="success">
|
|
105
|
+
<IconButton>
|
|
106
|
+
<NotificationsIcon />
|
|
107
|
+
</IconButton>
|
|
108
|
+
</Badge>
|
|
109
|
+
|
|
110
|
+
<Badge badgeContent={4} color="warning">
|
|
111
|
+
<IconButton>
|
|
112
|
+
<NotificationsIcon />
|
|
113
|
+
</IconButton>
|
|
114
|
+
</Badge>
|
|
115
|
+
</div>
|
|
112
116
|
```
|
|
113
117
|
|
|
114
118
|
## Variants
|
|
@@ -116,34 +120,36 @@ Apply semantic colors to convey the badge's meaning: `primary` for general count
|
|
|
116
120
|
Four style variants are available: `solid` (filled), `soft` (subtle background), `outlined` (border only), and `plain` (minimal).
|
|
117
121
|
|
|
118
122
|
```tsx
|
|
119
|
-
<div
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
</
|
|
123
|
+
<div
|
|
124
|
+
style={{
|
|
125
|
+
display: "flex",
|
|
126
|
+
gap: "2rem"
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
<Badge badgeContent={4} variant="solid">
|
|
130
|
+
<IconButton>
|
|
131
|
+
<NotificationsIcon />
|
|
132
|
+
</IconButton>
|
|
133
|
+
</Badge>
|
|
134
|
+
|
|
135
|
+
<Badge badgeContent={4} variant="soft">
|
|
136
|
+
<IconButton>
|
|
137
|
+
<NotificationsIcon />
|
|
138
|
+
</IconButton>
|
|
139
|
+
</Badge>
|
|
140
|
+
|
|
141
|
+
<Badge badgeContent={4} variant="outlined">
|
|
142
|
+
<IconButton>
|
|
143
|
+
<NotificationsIcon />
|
|
144
|
+
</IconButton>
|
|
145
|
+
</Badge>
|
|
146
|
+
|
|
147
|
+
<Badge badgeContent={4} variant="plain">
|
|
148
|
+
<IconButton>
|
|
149
|
+
<NotificationsIcon />
|
|
150
|
+
</IconButton>
|
|
151
|
+
</Badge>
|
|
152
|
+
</div>
|
|
147
153
|
```
|
|
148
154
|
|
|
149
155
|
## Sizes
|
|
@@ -151,29 +157,31 @@ Four style variants are available: `solid` (filled), `soft` (subtle background),
|
|
|
151
157
|
Three sizes -- `sm`, `md`, and `lg` -- allow the badge to scale proportionally with its wrapped element.
|
|
152
158
|
|
|
153
159
|
```tsx
|
|
154
|
-
<div
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
<
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
<
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
</
|
|
160
|
+
<div
|
|
161
|
+
style={{
|
|
162
|
+
display: "flex",
|
|
163
|
+
gap: "2rem",
|
|
164
|
+
alignItems: "center"
|
|
165
|
+
}}
|
|
166
|
+
>
|
|
167
|
+
<Badge badgeContent={4} size="sm">
|
|
168
|
+
<IconButton size="sm">
|
|
169
|
+
<NotificationsIcon />
|
|
170
|
+
</IconButton>
|
|
171
|
+
</Badge>
|
|
172
|
+
|
|
173
|
+
<Badge badgeContent={4} size="md">
|
|
174
|
+
<IconButton size="md">
|
|
175
|
+
<NotificationsIcon />
|
|
176
|
+
</IconButton>
|
|
177
|
+
</Badge>
|
|
178
|
+
|
|
179
|
+
<Badge badgeContent={4} size="lg">
|
|
180
|
+
<IconButton size="lg">
|
|
181
|
+
<NotificationsIcon />
|
|
182
|
+
</IconButton>
|
|
183
|
+
</Badge>
|
|
184
|
+
</div>
|
|
177
185
|
```
|
|
178
186
|
|
|
179
187
|
## With Avatar
|
|
@@ -181,18 +189,20 @@ Three sizes -- `sm`, `md`, and `lg` -- allow the badge to scale proportionally w
|
|
|
181
189
|
Badge pairs naturally with Avatar to indicate user status (e.g., notification count or online indicator).
|
|
182
190
|
|
|
183
191
|
```tsx
|
|
184
|
-
<div
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
<div
|
|
193
|
+
style={{
|
|
194
|
+
display: "flex",
|
|
195
|
+
gap: "2rem"
|
|
196
|
+
}}
|
|
197
|
+
>
|
|
198
|
+
<Badge badgeContent={4} color="danger">
|
|
199
|
+
<Avatar src="https://i.pravatar.cc/40?img=1" />
|
|
200
|
+
</Badge>
|
|
201
|
+
|
|
202
|
+
<Badge badgeContent="●" color="success">
|
|
203
|
+
<Avatar src="https://i.pravatar.cc/40?img=2" />
|
|
204
|
+
</Badge>
|
|
205
|
+
</div>
|
|
196
206
|
```
|
|
197
207
|
|
|
198
208
|
## Dot Badge
|
|
@@ -200,20 +210,22 @@ Badge pairs naturally with Avatar to indicate user status (e.g., notification co
|
|
|
200
210
|
When no `badgeContent` is provided, Badge renders as a small dot. This is useful for simple presence or status indicators without a specific count.
|
|
201
211
|
|
|
202
212
|
```tsx
|
|
203
|
-
<div
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
<div
|
|
214
|
+
style={{
|
|
215
|
+
display: "flex",
|
|
216
|
+
gap: "2rem"
|
|
217
|
+
}}
|
|
218
|
+
>
|
|
219
|
+
<Badge variant="solid" color="danger">
|
|
220
|
+
<IconButton>
|
|
221
|
+
<NotificationsIcon />
|
|
222
|
+
</IconButton>
|
|
223
|
+
</Badge>
|
|
224
|
+
|
|
225
|
+
<Badge variant="solid" color="success">
|
|
226
|
+
<Avatar src="https://i.pravatar.cc/40?img=3" />
|
|
227
|
+
</Badge>
|
|
228
|
+
</div>
|
|
217
229
|
```
|
|
218
230
|
|
|
219
231
|
## Max Count
|
|
@@ -221,28 +233,30 @@ When no `badgeContent` is provided, Badge renders as a small dot. This is useful
|
|
|
221
233
|
Use the `max` prop to cap the displayed number. When `badgeContent` exceeds `max`, it renders as "max+" (e.g., "99+").
|
|
222
234
|
|
|
223
235
|
```tsx
|
|
224
|
-
<div
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
<
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
<
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
<
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
</
|
|
236
|
+
<div
|
|
237
|
+
style={{
|
|
238
|
+
display: "flex",
|
|
239
|
+
gap: "2rem"
|
|
240
|
+
}}
|
|
241
|
+
>
|
|
242
|
+
<Badge badgeContent={99}>
|
|
243
|
+
<IconButton>
|
|
244
|
+
<NotificationsIcon />
|
|
245
|
+
</IconButton>
|
|
246
|
+
</Badge>
|
|
247
|
+
|
|
248
|
+
<Badge badgeContent={100} max={99}>
|
|
249
|
+
<IconButton>
|
|
250
|
+
<NotificationsIcon />
|
|
251
|
+
</IconButton>
|
|
252
|
+
</Badge>
|
|
253
|
+
|
|
254
|
+
<Badge badgeContent={1000} max={999}>
|
|
255
|
+
<IconButton>
|
|
256
|
+
<NotificationsIcon />
|
|
257
|
+
</IconButton>
|
|
258
|
+
</Badge>
|
|
259
|
+
</div>
|
|
246
260
|
```
|
|
247
261
|
|
|
248
262
|
## Show Zero
|
|
@@ -250,28 +264,30 @@ Use the `max` prop to cap the displayed number. When `badgeContent` exceeds `max
|
|
|
250
264
|
By default, Badge hides when `badgeContent` is `0`. Use the `showZero` prop to force it to remain visible.
|
|
251
265
|
|
|
252
266
|
```tsx
|
|
253
|
-
<div
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
<
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
</
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
<
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
</
|
|
274
|
-
</
|
|
267
|
+
<div
|
|
268
|
+
style={{
|
|
269
|
+
display: "flex",
|
|
270
|
+
gap: "2rem"
|
|
271
|
+
}}
|
|
272
|
+
>
|
|
273
|
+
<div>
|
|
274
|
+
<p>Default (0 숨김)</p>
|
|
275
|
+
<Badge badgeContent={0}>
|
|
276
|
+
<IconButton>
|
|
277
|
+
<NotificationsIcon />
|
|
278
|
+
</IconButton>
|
|
279
|
+
</Badge>
|
|
280
|
+
</div>
|
|
281
|
+
|
|
282
|
+
<div>
|
|
283
|
+
<p>Show zero</p>
|
|
284
|
+
<Badge badgeContent={0} showZero>
|
|
285
|
+
<IconButton>
|
|
286
|
+
<NotificationsIcon />
|
|
287
|
+
</IconButton>
|
|
288
|
+
</Badge>
|
|
289
|
+
</div>
|
|
290
|
+
</div>
|
|
275
291
|
```
|
|
276
292
|
|
|
277
293
|
## Badge Notification Bell
|