@ceed/cds 1.29.0 → 1.30.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 +110 -69
- package/dist/components/data-display/Badge.md +91 -39
- package/dist/components/data-display/Chip.md +49 -20
- package/dist/components/data-display/DataTable.md +93 -0
- package/dist/components/data-display/InfoSign.md +12 -0
- package/dist/components/data-display/Table.md +72 -55
- package/dist/components/data-display/Tooltip.md +40 -40
- package/dist/components/data-display/Typography.md +53 -70
- package/dist/components/feedback/Alert.md +88 -72
- package/dist/components/feedback/CircularProgress.md +17 -0
- package/dist/components/feedback/Skeleton.md +17 -0
- package/dist/components/inputs/Button.md +94 -68
- package/dist/components/inputs/ButtonGroup.md +17 -0
- package/dist/components/inputs/Calendar.md +118 -457
- package/dist/components/inputs/Checkbox.md +185 -430
- package/dist/components/inputs/CurrencyInput.md +22 -0
- package/dist/components/inputs/DatePicker.md +59 -5
- package/dist/components/inputs/DateRangePicker.md +46 -5
- package/dist/components/inputs/FilterableCheckboxGroup.md +20 -3
- package/dist/components/inputs/FormControl.md +32 -2
- package/dist/components/inputs/IconButton.md +18 -0
- package/dist/components/inputs/Input.md +198 -136
- package/dist/components/inputs/MonthPicker.md +59 -5
- package/dist/components/inputs/MonthRangePicker.md +44 -5
- package/dist/components/inputs/PercentageInput.md +25 -0
- package/dist/components/inputs/RadioButton.md +23 -0
- package/dist/components/inputs/RadioList.md +20 -1
- package/dist/components/inputs/RadioTileGroup.md +37 -3
- package/dist/components/inputs/Select.md +56 -0
- package/dist/components/inputs/Slider.md +23 -0
- package/dist/components/inputs/Switch.md +20 -0
- package/dist/components/inputs/Textarea.md +32 -8
- package/dist/components/inputs/Uploader/Uploader.md +21 -0
- package/dist/components/layout/Box.md +52 -41
- package/dist/components/layout/Grid.md +87 -81
- package/dist/components/layout/Stack.md +88 -68
- package/dist/components/navigation/Breadcrumbs.md +57 -46
- package/dist/components/navigation/Drawer.md +17 -0
- package/dist/components/navigation/Dropdown.md +13 -0
- package/dist/components/navigation/IconMenuButton.md +17 -0
- package/dist/components/navigation/InsetDrawer.md +130 -292
- package/dist/components/navigation/Link.md +78 -0
- package/dist/components/navigation/Menu.md +17 -0
- package/dist/components/navigation/MenuButton.md +18 -0
- package/dist/components/navigation/Pagination.md +13 -0
- package/dist/components/navigation/Stepper.md +15 -0
- package/dist/components/navigation/Tabs.md +27 -0
- package/dist/components/surfaces/Accordions.md +804 -49
- package/dist/components/surfaces/Card.md +173 -97
- package/dist/components/surfaces/Divider.md +246 -82
- package/dist/components/surfaces/Sheet.md +15 -0
- 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
package/dist/Overview.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# CDS (Customer Design System)
|
|
2
2
|
|
|
3
|
-
CDS
|
|
3
|
+
CDS stands for Customer Design System, and it was developed as a system centered around polished UI. It was created to provide a user-friendly experience and streamline development and design processes.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This design system is built on [JoyUI](https://mui.com/joy-ui/getting-started/), so you can refer to the [JoyUI](https://mui.com/joy-ui/getting-started/) documentation for most cases, although some components may have different interfaces due to added abstraction layers.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
It is named for UIs that prioritize visual and intuitive experiences over data-centric interfaces, and it is mainly applied to customer-facing UI.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Documentation and Guides
|
|
10
10
|
|
|
11
|
-
CDS
|
|
11
|
+
For more information about CDS, refer to the [Design System documentation](https://ecubelabs.atlassian.net/wiki/spaces/HP/pages/3256123430/Design+System).
|
|
@@ -3,6 +3,7 @@ export declare const getYearName: (date: Date, locale: string) => string;
|
|
|
3
3
|
export declare const getMonthName: (date: Date, locale: string, options?: {
|
|
4
4
|
hideYear?: boolean;
|
|
5
5
|
}) => string;
|
|
6
|
+
export declare const getShortMonthName: (date: Date, locale: string) => string;
|
|
6
7
|
export declare const getMonthNameFromIndex: (index: number, locale: string) => string;
|
|
7
8
|
/**
|
|
8
9
|
* 일~토 / Sun ~ Sat 같은 요일 이름을 가져옵니다.
|
|
@@ -36,6 +36,10 @@ interface BaseDatePickerProps {
|
|
|
36
36
|
* Input 에 표시되는 값의 포맷을 지정한다.
|
|
37
37
|
*/
|
|
38
38
|
displayFormat?: string;
|
|
39
|
+
/**
|
|
40
|
+
* 월 이름 표시에 사용할 locale (예: 'en-US', 'ko-KR'). MMM/MMMM 토큰 사용 시 적용된다.
|
|
41
|
+
*/
|
|
42
|
+
locale?: string;
|
|
39
43
|
inputReadOnly?: boolean;
|
|
40
44
|
hideClearButton?: boolean;
|
|
41
45
|
/**
|
|
@@ -36,6 +36,10 @@ interface BaseDateRangePickerProps {
|
|
|
36
36
|
* Input 에 표시되는 값의 포맷을 지정한다.
|
|
37
37
|
*/
|
|
38
38
|
displayFormat?: string;
|
|
39
|
+
/**
|
|
40
|
+
* 월 이름 표시에 사용할 locale (예: 'en-US', 'ko-KR'). MMM/MMMM 토큰 사용 시 적용된다.
|
|
41
|
+
*/
|
|
42
|
+
locale?: string;
|
|
39
43
|
inputReadOnly?: boolean;
|
|
40
44
|
hideClearButton?: boolean;
|
|
41
45
|
/**
|
|
@@ -20,6 +20,14 @@ interface BaseMonthRangePickerProps {
|
|
|
20
20
|
disableFuture?: boolean;
|
|
21
21
|
disablePast?: boolean;
|
|
22
22
|
format?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Input 에 표시되는 값의 포맷을 지정한다.
|
|
25
|
+
*/
|
|
26
|
+
displayFormat?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 월 이름 표시에 사용할 locale (예: 'en-US', 'ko-KR'). MMM/MMMM 토큰 사용 시 적용된다.
|
|
29
|
+
*/
|
|
30
|
+
locale?: string;
|
|
23
31
|
}
|
|
24
32
|
export type MonthRangePickerProps = BaseMonthRangePickerProps & Omit<React.ComponentProps<typeof Input>, 'onChange' | 'value' | 'defaultValue'>;
|
|
25
33
|
declare const MonthRangePicker: React.ForwardRefExoticComponent<Omit<MonthRangePickerProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
Avatar
|
|
5
|
+
The Avatar component displays a user's profile image, initials, or icon. It is based on Joy UI Avatar and supports various sizes, colors, and variants. It is used to visually represent individuals, groups, or brands in a user interface.
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
<Avatar alt="User avatar" />
|
|
@@ -25,13 +25,13 @@ import { Avatar } from '@ceed/cds';
|
|
|
25
25
|
function MyComponent() {
|
|
26
26
|
return (
|
|
27
27
|
<div>
|
|
28
|
-
{/*
|
|
28
|
+
{/* Avatar with an image */}
|
|
29
29
|
<Avatar src="/path/to/image.jpg" alt="사용자 이름" />
|
|
30
30
|
|
|
31
|
-
{/*
|
|
31
|
+
{/* Initials avatar */}
|
|
32
32
|
<Avatar>김철수</Avatar>
|
|
33
33
|
|
|
34
|
-
{/*
|
|
34
|
+
{/* Single-character avatar */}
|
|
35
35
|
<Avatar>김</Avatar>
|
|
36
36
|
</div>
|
|
37
37
|
);
|
|
@@ -42,7 +42,7 @@ function MyComponent() {
|
|
|
42
42
|
|
|
43
43
|
### Basic Usage
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
The most basic Avatar usage.
|
|
46
46
|
|
|
47
47
|
```tsx
|
|
48
48
|
<Avatar alt="User avatar" />
|
|
@@ -50,7 +50,7 @@ function MyComponent() {
|
|
|
50
50
|
|
|
51
51
|
### With Image
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
An avatar that uses an image.
|
|
54
54
|
|
|
55
55
|
```tsx
|
|
56
56
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
@@ -60,7 +60,7 @@ function MyComponent() {
|
|
|
60
60
|
|
|
61
61
|
### With Text
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
An avatar that uses text or initials.
|
|
64
64
|
|
|
65
65
|
```tsx
|
|
66
66
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
@@ -72,7 +72,7 @@ function MyComponent() {
|
|
|
72
72
|
|
|
73
73
|
### Variants
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
You can apply various visual styles.
|
|
76
76
|
|
|
77
77
|
```tsx
|
|
78
78
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
@@ -80,14 +80,14 @@ function MyComponent() {
|
|
|
80
80
|
</Stack>
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
- **solid**:
|
|
84
|
-
- **soft**:
|
|
85
|
-
- **outlined**:
|
|
86
|
-
- **plain**:
|
|
83
|
+
- **solid**: A style with a filled background color
|
|
84
|
+
- **soft**: A style with a soft background color
|
|
85
|
+
- **outlined**: A style with only a border
|
|
86
|
+
- **plain**: A minimal style
|
|
87
87
|
|
|
88
88
|
### Sizes
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
You can use avatars in various sizes.
|
|
91
91
|
|
|
92
92
|
```tsx
|
|
93
93
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
@@ -97,14 +97,14 @@ function MyComponent() {
|
|
|
97
97
|
</Stack>
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
- **xs**:
|
|
101
|
-
- **sm**:
|
|
102
|
-
- **md**:
|
|
103
|
-
- **lg**:
|
|
100
|
+
- **xs**: Extra small size (16px)
|
|
101
|
+
- **sm**: Small size (24px)
|
|
102
|
+
- **md**: Medium size (32px, default)
|
|
103
|
+
- **lg**: Large size (40px)
|
|
104
104
|
|
|
105
105
|
### Colors
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
You can apply various color themes.
|
|
108
108
|
|
|
109
109
|
```tsx
|
|
110
110
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
@@ -112,15 +112,15 @@ function MyComponent() {
|
|
|
112
112
|
</Stack>
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
- **primary**:
|
|
116
|
-
- **neutral**:
|
|
117
|
-
- **danger**:
|
|
118
|
-
- **success**:
|
|
119
|
-
- **warning**:
|
|
115
|
+
- **primary**: Primary brand color
|
|
116
|
+
- **neutral**: Neutral gray tone
|
|
117
|
+
- **danger**: Red for warnings or errors
|
|
118
|
+
- **success**: Green for success
|
|
119
|
+
- **warning**: Orange for caution
|
|
120
120
|
|
|
121
121
|
### All Combinations
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
You can review all variant, size, and color combinations.
|
|
124
124
|
|
|
125
125
|
```tsx
|
|
126
126
|
<Stack gap={8}>
|
|
@@ -150,11 +150,15 @@ function MyComponent() {
|
|
|
150
150
|
|
|
151
151
|
### User Profile
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
An example of using an avatar in a user profile.
|
|
154
154
|
|
|
155
155
|
```tsx
|
|
156
156
|
<Stack direction="row" spacing={2} alignItems="center">
|
|
157
|
-
<Avatar
|
|
157
|
+
<Avatar
|
|
158
|
+
src="/user-profile.jpg"
|
|
159
|
+
alt="김철수"
|
|
160
|
+
size="lg"
|
|
161
|
+
/>
|
|
158
162
|
<Stack>
|
|
159
163
|
<Typography level="title-md">김철수</Typography>
|
|
160
164
|
<Typography level="body-sm" color="neutral">
|
|
@@ -166,7 +170,7 @@ function MyComponent() {
|
|
|
166
170
|
|
|
167
171
|
### Navigation Bar
|
|
168
172
|
|
|
169
|
-
|
|
173
|
+
Used to display the current user in a navigation bar.
|
|
170
174
|
|
|
171
175
|
```tsx
|
|
172
176
|
<Stack direction="row" spacing={2} alignItems="center" sx={{ ml: 'auto' }}>
|
|
@@ -182,7 +186,7 @@ function MyComponent() {
|
|
|
182
186
|
|
|
183
187
|
### Comment System
|
|
184
188
|
|
|
185
|
-
|
|
189
|
+
Used to represent a user in comments or feeds.
|
|
186
190
|
|
|
187
191
|
```tsx
|
|
188
192
|
<Stack direction="row" spacing={2}>
|
|
@@ -196,14 +200,16 @@ function MyComponent() {
|
|
|
196
200
|
2시간 전
|
|
197
201
|
</Typography>
|
|
198
202
|
</Stack>
|
|
199
|
-
<Typography level="body-md"
|
|
203
|
+
<Typography level="body-md">
|
|
204
|
+
이것은 사용자의 댓글 내용입니다.
|
|
205
|
+
</Typography>
|
|
200
206
|
</Stack>
|
|
201
207
|
</Stack>
|
|
202
208
|
```
|
|
203
209
|
|
|
204
210
|
### Team Members
|
|
205
211
|
|
|
206
|
-
|
|
212
|
+
Used to display a list of team members.
|
|
207
213
|
|
|
208
214
|
```tsx
|
|
209
215
|
<Stack spacing={3}>
|
|
@@ -211,7 +217,13 @@ function MyComponent() {
|
|
|
211
217
|
|
|
212
218
|
{teamMembers.map((member) => (
|
|
213
219
|
<Stack key={member.id} direction="row" spacing={2} alignItems="center">
|
|
214
|
-
<Avatar
|
|
220
|
+
<Avatar
|
|
221
|
+
src={member.avatar}
|
|
222
|
+
alt={member.name}
|
|
223
|
+
size="md"
|
|
224
|
+
variant="soft"
|
|
225
|
+
color="primary"
|
|
226
|
+
>
|
|
215
227
|
{member.name.charAt(0)}
|
|
216
228
|
</Avatar>
|
|
217
229
|
<Stack flex={1}>
|
|
@@ -230,19 +242,13 @@ function MyComponent() {
|
|
|
230
242
|
|
|
231
243
|
### Avatar Groups
|
|
232
244
|
|
|
233
|
-
|
|
245
|
+
Used to display multiple users as a group.
|
|
234
246
|
|
|
235
247
|
```tsx
|
|
236
248
|
<Stack direction="row" spacing={-1}>
|
|
237
|
-
<Avatar size="sm" variant="solid" color="primary">
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
<Avatar size="sm" variant="solid" color="success">
|
|
241
|
-
이
|
|
242
|
-
</Avatar>
|
|
243
|
-
<Avatar size="sm" variant="solid" color="warning">
|
|
244
|
-
박
|
|
245
|
-
</Avatar>
|
|
249
|
+
<Avatar size="sm" variant="solid" color="primary">김</Avatar>
|
|
250
|
+
<Avatar size="sm" variant="solid" color="success">이</Avatar>
|
|
251
|
+
<Avatar size="sm" variant="solid" color="warning">박</Avatar>
|
|
246
252
|
<Avatar size="sm" variant="outlined" color="neutral">
|
|
247
253
|
<Typography level="body-xs">+3</Typography>
|
|
248
254
|
</Avatar>
|
|
@@ -251,7 +257,7 @@ function MyComponent() {
|
|
|
251
257
|
|
|
252
258
|
### Status Indicators
|
|
253
259
|
|
|
254
|
-
|
|
260
|
+
Used to display user status alongside the avatar.
|
|
255
261
|
|
|
256
262
|
```tsx
|
|
257
263
|
<Box sx={{ position: 'relative', display: 'inline-block' }}>
|
|
@@ -274,7 +280,7 @@ function MyComponent() {
|
|
|
274
280
|
|
|
275
281
|
### Empty State
|
|
276
282
|
|
|
277
|
-
|
|
283
|
+
Used as a placeholder when no data is available.
|
|
278
284
|
|
|
279
285
|
```tsx
|
|
280
286
|
<Stack alignItems="center" spacing={2}>
|
|
@@ -292,7 +298,7 @@ function MyComponent() {
|
|
|
292
298
|
|
|
293
299
|
### List Items
|
|
294
300
|
|
|
295
|
-
|
|
301
|
+
Used to represent users or items in list items.
|
|
296
302
|
|
|
297
303
|
```tsx
|
|
298
304
|
<List>
|
|
@@ -318,72 +324,107 @@ function MyComponent() {
|
|
|
318
324
|
|
|
319
325
|
### Fallback Behavior
|
|
320
326
|
|
|
321
|
-
|
|
327
|
+
If image loading fails, it automatically falls back to initials or an icon.
|
|
322
328
|
|
|
323
329
|
```tsx
|
|
324
|
-
<Avatar
|
|
330
|
+
<Avatar
|
|
331
|
+
src="/broken-image-url.jpg"
|
|
332
|
+
alt="김철수"
|
|
333
|
+
color="primary"
|
|
334
|
+
variant="soft"
|
|
335
|
+
>
|
|
325
336
|
김
|
|
326
337
|
</Avatar>
|
|
327
338
|
```
|
|
328
339
|
|
|
329
340
|
### Loading States
|
|
330
341
|
|
|
331
|
-
|
|
342
|
+
While the image is loading, `children` are shown first, then the image is displayed once loading completes.
|
|
332
343
|
|
|
333
344
|
```tsx
|
|
334
|
-
<Avatar
|
|
345
|
+
<Avatar
|
|
346
|
+
src="/slow-loading-image.jpg"
|
|
347
|
+
alt="사용자"
|
|
348
|
+
color="neutral"
|
|
349
|
+
variant="soft"
|
|
350
|
+
>
|
|
335
351
|
<PersonIcon />
|
|
336
352
|
</Avatar>
|
|
337
353
|
```
|
|
338
354
|
|
|
355
|
+
## Props and Customization
|
|
356
|
+
|
|
357
|
+
### Key Props
|
|
358
|
+
|
|
359
|
+
| Prop | Type | Default | Description |
|
|
360
|
+
| ------------ | -------------------------------------------------------------- | --------------- | ----------------------------------------------- |
|
|
361
|
+
| `src` | `string` | - | Image URL for the avatar |
|
|
362
|
+
| `alt` | `string` | - | Alt text for the avatar image |
|
|
363
|
+
| `children` | `ReactNode` | - | Fallback content (text, icon) when no image |
|
|
364
|
+
| `getInitial` | `(name: string) => string` | First character | Custom function to extract initials from a name |
|
|
365
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Avatar size |
|
|
366
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'soft'` | Visual style |
|
|
367
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Color scheme |
|
|
368
|
+
| `sx` | `SxProps` | - | Custom styles using the MUI system |
|
|
369
|
+
|
|
370
|
+
> **Note**: Avatar also accepts all Joy UI Avatar props and Framer Motion props.
|
|
371
|
+
|
|
339
372
|
## Accessibility
|
|
340
373
|
|
|
341
|
-
Avatar
|
|
374
|
+
Avatar provides the following accessibility features:
|
|
342
375
|
|
|
343
376
|
### Image Alt Text
|
|
344
377
|
|
|
345
|
-
|
|
378
|
+
For image avatars, provide appropriate alt text.
|
|
346
379
|
|
|
347
380
|
```tsx
|
|
348
|
-
<Avatar
|
|
381
|
+
<Avatar
|
|
382
|
+
src="/user-profile.jpg"
|
|
383
|
+
alt="김철수의 프로필 사진"
|
|
384
|
+
/>
|
|
349
385
|
```
|
|
350
386
|
|
|
351
387
|
### Semantic Meaning
|
|
352
388
|
|
|
353
|
-
|
|
389
|
+
If the avatar carries meaning rather than serving a purely decorative purpose, provide an appropriate role.
|
|
354
390
|
|
|
355
391
|
```tsx
|
|
356
|
-
<Avatar
|
|
392
|
+
<Avatar
|
|
393
|
+
src="/user-avatar.jpg"
|
|
394
|
+
alt="현재 사용자"
|
|
395
|
+
role="img"
|
|
396
|
+
aria-label="현재 로그인한 사용자의 프로필 이미지"
|
|
397
|
+
/>
|
|
357
398
|
```
|
|
358
399
|
|
|
359
400
|
### Color Contrast
|
|
360
401
|
|
|
361
|
-
|
|
402
|
+
For text avatars, maintain sufficient color contrast.
|
|
362
403
|
|
|
363
404
|
```tsx
|
|
364
|
-
//
|
|
405
|
+
// Color combinations that provide good contrast
|
|
365
406
|
<Avatar variant="solid" color="primary">김</Avatar>
|
|
366
407
|
<Avatar variant="soft" color="neutral">이</Avatar>
|
|
367
408
|
```
|
|
368
409
|
|
|
369
410
|
## Best Practices
|
|
370
411
|
|
|
371
|
-
1.
|
|
412
|
+
1. **Choose an appropriate size**: Select a size that fits the usage context.
|
|
372
413
|
|
|
373
414
|
```tsx
|
|
374
|
-
// ✅
|
|
375
|
-
<Avatar size="sm">김</Avatar> //
|
|
376
|
-
<Avatar size="lg">김</Avatar> //
|
|
415
|
+
// ✅ Appropriate size usage
|
|
416
|
+
<Avatar size="sm">김</Avatar> // In a list item
|
|
417
|
+
<Avatar size="lg">김</Avatar> // On a profile page
|
|
377
418
|
|
|
378
|
-
// ❌
|
|
379
|
-
<Avatar size="lg">김</Avatar> //
|
|
419
|
+
// ❌ Inappropriate size usage
|
|
420
|
+
<Avatar size="lg">김</Avatar> // In a navigation bar (too large)
|
|
380
421
|
```
|
|
381
422
|
|
|
382
|
-
2.
|
|
423
|
+
2. **Consistent styling**: Use consistent variants and colors within the same context.
|
|
383
424
|
|
|
384
|
-
3.
|
|
425
|
+
3. **Optimize images**: Use avatar images optimized to an appropriate size.
|
|
385
426
|
|
|
386
|
-
4.
|
|
427
|
+
4. **Provide a fallback**: Prepare an appropriate fallback for missing or failed image loads.
|
|
387
428
|
|
|
388
429
|
```tsx
|
|
389
430
|
<Avatar src={user.avatar} alt={user.name} color="primary" variant="soft">
|
|
@@ -391,14 +432,14 @@ Avatar 컴포넌트는 다음과 같은 접근성 기능을 제공합니다:
|
|
|
391
432
|
</Avatar>
|
|
392
433
|
```
|
|
393
434
|
|
|
394
|
-
5.
|
|
435
|
+
5. **Meaningful usage**: It should be clear whom the avatar represents.
|
|
395
436
|
|
|
396
437
|
## Performance Considerations
|
|
397
438
|
|
|
398
|
-
1.
|
|
439
|
+
1. **Image optimization**: Optimize avatar images to a small size to improve loading speed.
|
|
399
440
|
|
|
400
|
-
2. **Lazy Loading**:
|
|
441
|
+
2. **Lazy Loading**: Consider lazy loading on pages with many avatars.
|
|
401
442
|
|
|
402
|
-
3.
|
|
443
|
+
3. **Caching**: Cache frequently used avatar images appropriately.
|
|
403
444
|
|
|
404
|
-
Avatar
|
|
445
|
+
Avatar is an important component for visually representing people in a user interface. By choosing the right size, color, and variant, you can provide a consistent and accessible user experience.
|