@ceed/cds 1.34.1 → 1.36.0-next.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/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/CurrencyInput/CurrencyInput.d.ts +1 -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/Drawer/Drawer.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +28 -1
- package/dist/components/FilterableCheckboxGroup/FilterableCheckboxGroup.d.ts +1 -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 +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 +15 -0
- 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 +113 -116
- 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 -264
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +62 -2
- 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/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 +4 -4
- package/dist/components/navigation/Drawer.md +34 -25
- package/dist/components/navigation/Dropdown.md +745 -408
- package/dist/components/navigation/IconMenuButton.md +14 -6
- package/dist/components/navigation/InsetDrawer.md +8 -13
- package/dist/components/navigation/Link.md +1 -2
- 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/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +48 -36
- 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 +8 -8
- package/dist/index.browser.js +5 -5
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1082 -1036
- package/dist/index.d.ts +2 -1
- package/dist/index.js +749 -695
- package/framer/index.js +1 -1
- package/package.json +34 -36
|
@@ -5,19 +5,22 @@
|
|
|
5
5
|
Box is the most fundamental and essential layout component. It acts as a general-purpose container that wraps other components, and you can apply styles directly through CSS-in-JS. It also includes built-in Framer Motion support, making it easy to add animations. It is also a polymorphic component that can render as any HTML element.
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
|
-
<Box
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
<Box
|
|
9
|
+
{...args}
|
|
10
|
+
sx={{
|
|
11
|
+
width: 200,
|
|
12
|
+
height: 200,
|
|
13
|
+
backgroundColor: "primary.50",
|
|
14
|
+
border: "2px solid",
|
|
15
|
+
borderColor: "primary.200",
|
|
16
|
+
borderRadius: "md",
|
|
17
|
+
display: "flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
justifyContent: "center"
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
<Typography>Box 컴포넌트</Typography>
|
|
23
|
+
</Box>
|
|
21
24
|
```
|
|
22
25
|
|
|
23
26
|
| Field | Description | Default |
|
|
@@ -51,37 +54,45 @@ function MyComponent() {
|
|
|
51
54
|
The most basic way to use Box.
|
|
52
55
|
|
|
53
56
|
```tsx
|
|
54
|
-
<div
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
<div
|
|
58
|
+
style={{
|
|
59
|
+
display: "flex",
|
|
60
|
+
gap: "1rem",
|
|
61
|
+
flexWrap: "wrap"
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
<Box
|
|
65
|
+
sx={{
|
|
66
|
+
p: 2,
|
|
67
|
+
bgcolor: "background.body",
|
|
68
|
+
border: "1px solid",
|
|
69
|
+
borderColor: "divider"
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
<Typography>기본 Box</Typography>
|
|
73
|
+
</Box>
|
|
67
74
|
|
|
68
|
-
<Box
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
<Box
|
|
76
|
+
sx={{
|
|
77
|
+
p: 2,
|
|
78
|
+
bgcolor: "primary.50",
|
|
79
|
+
borderRadius: "sm"
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
<Typography>배경색과 둥근 모서리</Typography>
|
|
83
|
+
</Box>
|
|
75
84
|
|
|
76
|
-
<Box
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
</
|
|
85
|
+
<Box
|
|
86
|
+
sx={{
|
|
87
|
+
p: 2,
|
|
88
|
+
border: "2px solid",
|
|
89
|
+
borderColor: "primary.main",
|
|
90
|
+
borderRadius: "md"
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
<Typography>테두리가 있는 Box</Typography>
|
|
94
|
+
</Box>
|
|
95
|
+
</div>
|
|
85
96
|
```
|
|
86
97
|
|
|
87
98
|
### Colors
|
|
@@ -89,51 +100,63 @@ The most basic way to use Box.
|
|
|
89
100
|
You can apply various background colors.
|
|
90
101
|
|
|
91
102
|
```tsx
|
|
92
|
-
<div
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
<div
|
|
104
|
+
style={{
|
|
105
|
+
display: "flex",
|
|
106
|
+
gap: "1rem",
|
|
107
|
+
flexWrap: "wrap"
|
|
108
|
+
}}
|
|
109
|
+
>
|
|
110
|
+
<Box
|
|
111
|
+
sx={{
|
|
112
|
+
p: 2,
|
|
113
|
+
bgcolor: "primary.50",
|
|
114
|
+
borderRadius: "sm"
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
<Typography level="body-sm">Primary</Typography>
|
|
118
|
+
</Box>
|
|
104
119
|
|
|
105
|
-
<Box
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
120
|
+
<Box
|
|
121
|
+
sx={{
|
|
122
|
+
p: 2,
|
|
123
|
+
bgcolor: "neutral.50",
|
|
124
|
+
borderRadius: "sm"
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
<Typography level="body-sm">Neutral</Typography>
|
|
128
|
+
</Box>
|
|
112
129
|
|
|
113
|
-
<Box
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
130
|
+
<Box
|
|
131
|
+
sx={{
|
|
132
|
+
p: 2,
|
|
133
|
+
bgcolor: "danger.50",
|
|
134
|
+
borderRadius: "sm"
|
|
135
|
+
}}
|
|
136
|
+
>
|
|
137
|
+
<Typography level="body-sm">Danger</Typography>
|
|
138
|
+
</Box>
|
|
120
139
|
|
|
121
|
-
<Box
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
140
|
+
<Box
|
|
141
|
+
sx={{
|
|
142
|
+
p: 2,
|
|
143
|
+
bgcolor: "success.50",
|
|
144
|
+
borderRadius: "sm"
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
<Typography level="body-sm">Success</Typography>
|
|
148
|
+
</Box>
|
|
128
149
|
|
|
129
|
-
<Box
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
</
|
|
150
|
+
<Box
|
|
151
|
+
sx={{
|
|
152
|
+
p: 2,
|
|
153
|
+
bgcolor: "warning.50",
|
|
154
|
+
borderRadius: "sm"
|
|
155
|
+
}}
|
|
156
|
+
>
|
|
157
|
+
<Typography level="body-sm">Warning</Typography>
|
|
158
|
+
</Box>
|
|
159
|
+
</div>
|
|
137
160
|
```
|
|
138
161
|
|
|
139
162
|
### Spacing
|
|
@@ -141,76 +164,94 @@ You can apply various background colors.
|
|
|
141
164
|
You can adjust padding and margin.
|
|
142
165
|
|
|
143
166
|
```tsx
|
|
144
|
-
<div
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
borderRadius: 'sm'
|
|
161
|
-
}}>
|
|
162
|
-
<Typography level="body-sm">패딩 2 (16px)</Typography>
|
|
163
|
-
</Box>
|
|
164
|
-
|
|
165
|
-
<Box sx={{
|
|
166
|
-
p: 3,
|
|
167
|
-
bgcolor: 'neutral.100',
|
|
168
|
-
borderRadius: 'sm'
|
|
169
|
-
}}>
|
|
170
|
-
<Typography level="body-sm">패딩 3 (24px)</Typography>
|
|
171
|
-
</Box>
|
|
167
|
+
<div
|
|
168
|
+
style={{
|
|
169
|
+
display: "flex",
|
|
170
|
+
flexDirection: "column",
|
|
171
|
+
gap: "1rem"
|
|
172
|
+
}}
|
|
173
|
+
>
|
|
174
|
+
<Box
|
|
175
|
+
sx={{
|
|
176
|
+
p: 1,
|
|
177
|
+
bgcolor: "neutral.100",
|
|
178
|
+
borderRadius: "sm"
|
|
179
|
+
}}
|
|
180
|
+
>
|
|
181
|
+
<Typography level="body-sm">패딩 1 (8px)</Typography>
|
|
182
|
+
</Box>
|
|
172
183
|
|
|
173
|
-
<Box
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
184
|
+
<Box
|
|
185
|
+
sx={{
|
|
186
|
+
p: 2,
|
|
187
|
+
bgcolor: "neutral.100",
|
|
188
|
+
borderRadius: "sm"
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
<Typography level="body-sm">패딩 2 (16px)</Typography>
|
|
192
|
+
</Box>
|
|
180
193
|
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
borderRadius: 'sm'
|
|
191
|
-
}}>
|
|
192
|
-
<Typography level="body-sm">마진 1</Typography>
|
|
193
|
-
</Box>
|
|
194
|
+
<Box
|
|
195
|
+
sx={{
|
|
196
|
+
p: 3,
|
|
197
|
+
bgcolor: "neutral.100",
|
|
198
|
+
borderRadius: "sm"
|
|
199
|
+
}}
|
|
200
|
+
>
|
|
201
|
+
<Typography level="body-sm">패딩 3 (24px)</Typography>
|
|
202
|
+
</Box>
|
|
194
203
|
|
|
195
|
-
<Box
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}}
|
|
201
|
-
|
|
202
|
-
</
|
|
204
|
+
<Box
|
|
205
|
+
sx={{
|
|
206
|
+
p: 4,
|
|
207
|
+
bgcolor: "neutral.100",
|
|
208
|
+
borderRadius: "sm"
|
|
209
|
+
}}
|
|
210
|
+
>
|
|
211
|
+
<Typography level="body-sm">패딩 4 (32px)</Typography>
|
|
212
|
+
</Box>
|
|
203
213
|
|
|
204
|
-
<
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
+
<div
|
|
215
|
+
style={{
|
|
216
|
+
display: "flex",
|
|
217
|
+
gap: "1rem",
|
|
218
|
+
marginTop: "2rem"
|
|
219
|
+
}}
|
|
220
|
+
>
|
|
221
|
+
<Box
|
|
222
|
+
sx={{
|
|
223
|
+
m: 1,
|
|
224
|
+
p: 2,
|
|
225
|
+
bgcolor: "primary.50",
|
|
226
|
+
borderRadius: "sm"
|
|
227
|
+
}}
|
|
228
|
+
>
|
|
229
|
+
<Typography level="body-sm">마진 1</Typography>
|
|
230
|
+
</Box>
|
|
231
|
+
|
|
232
|
+
<Box
|
|
233
|
+
sx={{
|
|
234
|
+
m: 2,
|
|
235
|
+
p: 2,
|
|
236
|
+
bgcolor: "primary.50",
|
|
237
|
+
borderRadius: "sm"
|
|
238
|
+
}}
|
|
239
|
+
>
|
|
240
|
+
<Typography level="body-sm">마진 2</Typography>
|
|
241
|
+
</Box>
|
|
242
|
+
|
|
243
|
+
<Box
|
|
244
|
+
sx={{
|
|
245
|
+
m: 3,
|
|
246
|
+
p: 2,
|
|
247
|
+
bgcolor: "primary.50",
|
|
248
|
+
borderRadius: "sm"
|
|
249
|
+
}}
|
|
250
|
+
>
|
|
251
|
+
<Typography level="body-sm">마진 3</Typography>
|
|
252
|
+
</Box>
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
214
255
|
```
|
|
215
256
|
|
|
216
257
|
### Border Radius
|
|
@@ -218,83 +259,97 @@ You can adjust padding and margin.
|
|
|
218
259
|
You can configure different corner radius values.
|
|
219
260
|
|
|
220
261
|
```tsx
|
|
221
|
-
<div
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
262
|
+
<div
|
|
263
|
+
style={{
|
|
264
|
+
display: "flex",
|
|
265
|
+
gap: "1rem",
|
|
266
|
+
flexWrap: "wrap",
|
|
267
|
+
alignItems: "center"
|
|
268
|
+
}}
|
|
269
|
+
>
|
|
270
|
+
<Box
|
|
271
|
+
sx={{
|
|
272
|
+
width: 100,
|
|
273
|
+
height: 100,
|
|
274
|
+
bgcolor: "primary.100",
|
|
275
|
+
display: "flex",
|
|
276
|
+
alignItems: "center",
|
|
277
|
+
justifyContent: "center"
|
|
278
|
+
}}
|
|
279
|
+
>
|
|
280
|
+
<Typography level="body-xs">None</Typography>
|
|
281
|
+
</Box>
|
|
237
282
|
|
|
238
|
-
<Box
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
283
|
+
<Box
|
|
284
|
+
sx={{
|
|
285
|
+
width: 100,
|
|
286
|
+
height: 100,
|
|
287
|
+
bgcolor: "primary.100",
|
|
288
|
+
borderRadius: "xs",
|
|
289
|
+
display: "flex",
|
|
290
|
+
alignItems: "center",
|
|
291
|
+
justifyContent: "center"
|
|
292
|
+
}}
|
|
293
|
+
>
|
|
294
|
+
<Typography level="body-xs">XS</Typography>
|
|
295
|
+
</Box>
|
|
249
296
|
|
|
250
|
-
<Box
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
297
|
+
<Box
|
|
298
|
+
sx={{
|
|
299
|
+
width: 100,
|
|
300
|
+
height: 100,
|
|
301
|
+
bgcolor: "primary.100",
|
|
302
|
+
borderRadius: "sm",
|
|
303
|
+
display: "flex",
|
|
304
|
+
alignItems: "center",
|
|
305
|
+
justifyContent: "center"
|
|
306
|
+
}}
|
|
307
|
+
>
|
|
308
|
+
<Typography level="body-xs">SM</Typography>
|
|
309
|
+
</Box>
|
|
261
310
|
|
|
262
|
-
<Box
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
311
|
+
<Box
|
|
312
|
+
sx={{
|
|
313
|
+
width: 100,
|
|
314
|
+
height: 100,
|
|
315
|
+
bgcolor: "primary.100",
|
|
316
|
+
borderRadius: "md",
|
|
317
|
+
display: "flex",
|
|
318
|
+
alignItems: "center",
|
|
319
|
+
justifyContent: "center"
|
|
320
|
+
}}
|
|
321
|
+
>
|
|
322
|
+
<Typography level="body-xs">MD</Typography>
|
|
323
|
+
</Box>
|
|
273
324
|
|
|
274
|
-
<Box
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
325
|
+
<Box
|
|
326
|
+
sx={{
|
|
327
|
+
width: 100,
|
|
328
|
+
height: 100,
|
|
329
|
+
bgcolor: "primary.100",
|
|
330
|
+
borderRadius: "lg",
|
|
331
|
+
display: "flex",
|
|
332
|
+
alignItems: "center",
|
|
333
|
+
justifyContent: "center"
|
|
334
|
+
}}
|
|
335
|
+
>
|
|
336
|
+
<Typography level="body-xs">LG</Typography>
|
|
337
|
+
</Box>
|
|
285
338
|
|
|
286
|
-
<Box
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
</
|
|
339
|
+
<Box
|
|
340
|
+
sx={{
|
|
341
|
+
width: 100,
|
|
342
|
+
height: 100,
|
|
343
|
+
bgcolor: "primary.100",
|
|
344
|
+
borderRadius: "xl",
|
|
345
|
+
display: "flex",
|
|
346
|
+
alignItems: "center",
|
|
347
|
+
justifyContent: "center"
|
|
348
|
+
}}
|
|
349
|
+
>
|
|
350
|
+
<Typography level="body-xs">XL</Typography>
|
|
351
|
+
</Box>
|
|
352
|
+
</div>
|
|
298
353
|
```
|
|
299
354
|
|
|
300
355
|
### Shadows
|
|
@@ -302,90 +357,104 @@ You can configure different corner radius values.
|
|
|
302
357
|
You can add shadow effects.
|
|
303
358
|
|
|
304
359
|
```tsx
|
|
305
|
-
<div
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
360
|
+
<div
|
|
361
|
+
style={{
|
|
362
|
+
display: "flex",
|
|
363
|
+
gap: "2rem",
|
|
364
|
+
flexWrap: "wrap",
|
|
365
|
+
alignItems: "center",
|
|
366
|
+
padding: "2rem"
|
|
367
|
+
}}
|
|
368
|
+
>
|
|
369
|
+
<Box
|
|
370
|
+
sx={{
|
|
371
|
+
width: 120,
|
|
372
|
+
height: 80,
|
|
373
|
+
bgcolor: "background.body",
|
|
374
|
+
borderRadius: "md",
|
|
375
|
+
display: "flex",
|
|
376
|
+
alignItems: "center",
|
|
377
|
+
justifyContent: "center"
|
|
378
|
+
}}
|
|
379
|
+
>
|
|
380
|
+
<Typography level="body-sm">No Shadow</Typography>
|
|
381
|
+
</Box>
|
|
323
382
|
|
|
324
|
-
<Box
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
383
|
+
<Box
|
|
384
|
+
sx={{
|
|
385
|
+
width: 120,
|
|
386
|
+
height: 80,
|
|
387
|
+
bgcolor: "background.body",
|
|
388
|
+
borderRadius: "md",
|
|
389
|
+
boxShadow: "xs",
|
|
390
|
+
display: "flex",
|
|
391
|
+
alignItems: "center",
|
|
392
|
+
justifyContent: "center"
|
|
393
|
+
}}
|
|
394
|
+
>
|
|
395
|
+
<Typography level="body-sm">XS Shadow</Typography>
|
|
396
|
+
</Box>
|
|
336
397
|
|
|
337
|
-
<Box
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
398
|
+
<Box
|
|
399
|
+
sx={{
|
|
400
|
+
width: 120,
|
|
401
|
+
height: 80,
|
|
402
|
+
bgcolor: "background.body",
|
|
403
|
+
borderRadius: "md",
|
|
404
|
+
boxShadow: "sm",
|
|
405
|
+
display: "flex",
|
|
406
|
+
alignItems: "center",
|
|
407
|
+
justifyContent: "center"
|
|
408
|
+
}}
|
|
409
|
+
>
|
|
410
|
+
<Typography level="body-sm">SM Shadow</Typography>
|
|
411
|
+
</Box>
|
|
349
412
|
|
|
350
|
-
<Box
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
413
|
+
<Box
|
|
414
|
+
sx={{
|
|
415
|
+
width: 120,
|
|
416
|
+
height: 80,
|
|
417
|
+
bgcolor: "background.body",
|
|
418
|
+
borderRadius: "md",
|
|
419
|
+
boxShadow: "md",
|
|
420
|
+
display: "flex",
|
|
421
|
+
alignItems: "center",
|
|
422
|
+
justifyContent: "center"
|
|
423
|
+
}}
|
|
424
|
+
>
|
|
425
|
+
<Typography level="body-sm">MD Shadow</Typography>
|
|
426
|
+
</Box>
|
|
362
427
|
|
|
363
|
-
<Box
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
428
|
+
<Box
|
|
429
|
+
sx={{
|
|
430
|
+
width: 120,
|
|
431
|
+
height: 80,
|
|
432
|
+
bgcolor: "background.body",
|
|
433
|
+
borderRadius: "md",
|
|
434
|
+
boxShadow: "lg",
|
|
435
|
+
display: "flex",
|
|
436
|
+
alignItems: "center",
|
|
437
|
+
justifyContent: "center"
|
|
438
|
+
}}
|
|
439
|
+
>
|
|
440
|
+
<Typography level="body-sm">LG Shadow</Typography>
|
|
441
|
+
</Box>
|
|
375
442
|
|
|
376
|
-
<Box
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
</
|
|
443
|
+
<Box
|
|
444
|
+
sx={{
|
|
445
|
+
width: 120,
|
|
446
|
+
height: 80,
|
|
447
|
+
bgcolor: "background.body",
|
|
448
|
+
borderRadius: "md",
|
|
449
|
+
boxShadow: "xl",
|
|
450
|
+
display: "flex",
|
|
451
|
+
alignItems: "center",
|
|
452
|
+
justifyContent: "center"
|
|
453
|
+
}}
|
|
454
|
+
>
|
|
455
|
+
<Typography level="body-sm">XL Shadow</Typography>
|
|
456
|
+
</Box>
|
|
457
|
+
</div>
|
|
389
458
|
```
|
|
390
459
|
|
|
391
460
|
### Flex Layouts
|
|
@@ -393,108 +462,137 @@ You can add shadow effects.
|
|
|
393
462
|
You can easily build layouts using Flexbox.
|
|
394
463
|
|
|
395
464
|
```tsx
|
|
396
|
-
<div
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
}}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}}
|
|
428
|
-
|
|
429
|
-
</
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
</
|
|
440
|
-
|
|
441
|
-
<
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
</
|
|
463
|
-
<Box
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
465
|
+
<div
|
|
466
|
+
style={{
|
|
467
|
+
display: "flex",
|
|
468
|
+
flexDirection: "column",
|
|
469
|
+
gap: "2rem"
|
|
470
|
+
}}
|
|
471
|
+
>
|
|
472
|
+
<div>
|
|
473
|
+
<Typography
|
|
474
|
+
level="title-md"
|
|
475
|
+
sx={{
|
|
476
|
+
mb: 1
|
|
477
|
+
}}
|
|
478
|
+
>
|
|
479
|
+
Flex Row (수평 배치)
|
|
480
|
+
</Typography>
|
|
481
|
+
<Box
|
|
482
|
+
sx={{
|
|
483
|
+
display: "flex",
|
|
484
|
+
gap: 1,
|
|
485
|
+
p: 2,
|
|
486
|
+
bgcolor: "neutral.50",
|
|
487
|
+
borderRadius: "md"
|
|
488
|
+
}}
|
|
489
|
+
>
|
|
490
|
+
<Box
|
|
491
|
+
sx={{
|
|
492
|
+
p: 2,
|
|
493
|
+
bgcolor: "primary.100",
|
|
494
|
+
borderRadius: "sm",
|
|
495
|
+
flex: 1
|
|
496
|
+
}}
|
|
497
|
+
>
|
|
498
|
+
<Typography level="body-sm">Item 1</Typography>
|
|
499
|
+
</Box>
|
|
500
|
+
<Box
|
|
501
|
+
sx={{
|
|
502
|
+
p: 2,
|
|
503
|
+
bgcolor: "primary.100",
|
|
504
|
+
borderRadius: "sm",
|
|
505
|
+
flex: 1
|
|
506
|
+
}}
|
|
507
|
+
>
|
|
508
|
+
<Typography level="body-sm">Item 2</Typography>
|
|
509
|
+
</Box>
|
|
510
|
+
<Box
|
|
511
|
+
sx={{
|
|
512
|
+
p: 2,
|
|
513
|
+
bgcolor: "primary.100",
|
|
514
|
+
borderRadius: "sm",
|
|
515
|
+
flex: 1
|
|
516
|
+
}}
|
|
517
|
+
>
|
|
518
|
+
<Typography level="body-sm">Item 3</Typography>
|
|
519
|
+
</Box>
|
|
520
|
+
</Box>
|
|
521
|
+
</div>
|
|
522
|
+
|
|
523
|
+
<div>
|
|
524
|
+
<Typography
|
|
525
|
+
level="title-md"
|
|
526
|
+
sx={{
|
|
527
|
+
mb: 1
|
|
528
|
+
}}
|
|
529
|
+
>
|
|
530
|
+
Flex Column (수직 배치)
|
|
531
|
+
</Typography>
|
|
532
|
+
<Box
|
|
533
|
+
sx={{
|
|
534
|
+
display: "flex",
|
|
535
|
+
flexDirection: "column",
|
|
536
|
+
gap: 1,
|
|
537
|
+
p: 2,
|
|
538
|
+
bgcolor: "neutral.50",
|
|
539
|
+
borderRadius: "md",
|
|
540
|
+
width: 200
|
|
541
|
+
}}
|
|
542
|
+
>
|
|
543
|
+
<Box
|
|
544
|
+
sx={{
|
|
545
|
+
p: 2,
|
|
546
|
+
bgcolor: "success.100",
|
|
547
|
+
borderRadius: "sm"
|
|
548
|
+
}}
|
|
549
|
+
>
|
|
550
|
+
<Typography level="body-sm">Item 1</Typography>
|
|
551
|
+
</Box>
|
|
552
|
+
<Box
|
|
553
|
+
sx={{
|
|
554
|
+
p: 2,
|
|
555
|
+
bgcolor: "success.100",
|
|
556
|
+
borderRadius: "sm"
|
|
557
|
+
}}
|
|
558
|
+
>
|
|
559
|
+
<Typography level="body-sm">Item 2</Typography>
|
|
560
|
+
</Box>
|
|
561
|
+
<Box
|
|
562
|
+
sx={{
|
|
563
|
+
p: 2,
|
|
564
|
+
bgcolor: "success.100",
|
|
565
|
+
borderRadius: "sm"
|
|
566
|
+
}}
|
|
567
|
+
>
|
|
568
|
+
<Typography level="body-sm">Item 3</Typography>
|
|
569
|
+
</Box>
|
|
570
|
+
</Box>
|
|
571
|
+
</div>
|
|
572
|
+
|
|
573
|
+
<div>
|
|
574
|
+
<Typography
|
|
575
|
+
level="title-md"
|
|
576
|
+
sx={{
|
|
577
|
+
mb: 1
|
|
578
|
+
}}
|
|
579
|
+
>
|
|
580
|
+
Center Alignment
|
|
581
|
+
</Typography>
|
|
582
|
+
<Box
|
|
583
|
+
sx={{
|
|
584
|
+
display: "flex",
|
|
585
|
+
alignItems: "center",
|
|
586
|
+
justifyContent: "center",
|
|
587
|
+
height: 150,
|
|
588
|
+
bgcolor: "warning.50",
|
|
589
|
+
borderRadius: "md"
|
|
590
|
+
}}
|
|
591
|
+
>
|
|
592
|
+
<Typography level="title-lg">중앙 정렬된 콘텐츠</Typography>
|
|
593
|
+
</Box>
|
|
594
|
+
</div>
|
|
595
|
+
</div>
|
|
498
596
|
```
|
|
499
597
|
|
|
500
598
|
### Responsive Layout
|
|
@@ -502,51 +600,62 @@ You can easily build layouts using Flexbox.
|
|
|
502
600
|
You can create responsive layouts.
|
|
503
601
|
|
|
504
602
|
```tsx
|
|
505
|
-
<div
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
<
|
|
513
|
-
display: 'grid',
|
|
514
|
-
gridTemplateColumns: {
|
|
515
|
-
xs: '1fr',
|
|
516
|
-
sm: 'repeat(2, 1fr)',
|
|
517
|
-
md: 'repeat(3, 1fr)'
|
|
518
|
-
},
|
|
519
|
-
gap: 2,
|
|
520
|
-
p: 2,
|
|
521
|
-
bgcolor: 'neutral.50',
|
|
522
|
-
borderRadius: 'md'
|
|
523
|
-
}}>
|
|
524
|
-
{[1, 2, 3, 4, 5, 6].map(item => <Box key={item} sx={{
|
|
525
|
-
p: 2,
|
|
526
|
-
bgcolor: 'primary.100',
|
|
527
|
-
borderRadius: 'sm',
|
|
528
|
-
textAlign: 'center'
|
|
529
|
-
}}>
|
|
530
|
-
<Typography level="body-md">Item {item}</Typography>
|
|
531
|
-
</Box>)}
|
|
532
|
-
</Box>
|
|
603
|
+
<div
|
|
604
|
+
style={{
|
|
605
|
+
display: "flex",
|
|
606
|
+
flexDirection: "column",
|
|
607
|
+
gap: "2rem"
|
|
608
|
+
}}
|
|
609
|
+
>
|
|
610
|
+
<Typography level="title-md">반응형 레이아웃 (브라우저 크기를 조절해보세요)</Typography>
|
|
533
611
|
|
|
534
|
-
<Box
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
}}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
612
|
+
<Box
|
|
613
|
+
sx={{
|
|
614
|
+
display: "grid",
|
|
615
|
+
gridTemplateColumns: {
|
|
616
|
+
xs: "1fr",
|
|
617
|
+
sm: "repeat(2, 1fr)",
|
|
618
|
+
md: "repeat(3, 1fr)"
|
|
619
|
+
},
|
|
620
|
+
gap: 2,
|
|
621
|
+
p: 2,
|
|
622
|
+
bgcolor: "neutral.50",
|
|
623
|
+
borderRadius: "md"
|
|
624
|
+
}}
|
|
625
|
+
>
|
|
626
|
+
{[1, 2, 3, 4, 5, 6].map((item) => (
|
|
627
|
+
<Box
|
|
628
|
+
key={item}
|
|
629
|
+
sx={{
|
|
630
|
+
p: 2,
|
|
631
|
+
bgcolor: "primary.100",
|
|
632
|
+
borderRadius: "sm",
|
|
633
|
+
textAlign: "center"
|
|
634
|
+
}}
|
|
635
|
+
>
|
|
636
|
+
<Typography level="body-md">Item {item}</Typography>
|
|
637
|
+
</Box>
|
|
638
|
+
))}
|
|
639
|
+
</Box>
|
|
640
|
+
|
|
641
|
+
<Box
|
|
642
|
+
sx={{
|
|
643
|
+
p: {
|
|
644
|
+
xs: 2,
|
|
645
|
+
md: 4
|
|
646
|
+
},
|
|
647
|
+
fontSize: {
|
|
648
|
+
xs: "sm",
|
|
649
|
+
md: "lg"
|
|
650
|
+
},
|
|
651
|
+
bgcolor: "success.50",
|
|
652
|
+
borderRadius: "md",
|
|
653
|
+
textAlign: "center"
|
|
654
|
+
}}
|
|
655
|
+
>
|
|
656
|
+
<Typography>패딩과 폰트 크기가 화면 크기에 따라 달라집니다</Typography>
|
|
657
|
+
</Box>
|
|
658
|
+
</div>
|
|
550
659
|
```
|
|
551
660
|
|
|
552
661
|
### Polymorphic Components
|
|
@@ -554,51 +663,68 @@ You can create responsive layouts.
|
|
|
554
663
|
You can render it as different HTML elements using the `component` prop.
|
|
555
664
|
|
|
556
665
|
```tsx
|
|
557
|
-
<div
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
666
|
+
<div
|
|
667
|
+
style={{
|
|
668
|
+
display: "flex",
|
|
669
|
+
flexDirection: "column",
|
|
670
|
+
gap: "2rem"
|
|
671
|
+
}}
|
|
672
|
+
>
|
|
673
|
+
<Box
|
|
674
|
+
component="div"
|
|
675
|
+
sx={{
|
|
676
|
+
p: 2,
|
|
677
|
+
bgcolor: "neutral.100",
|
|
678
|
+
borderRadius: "sm"
|
|
679
|
+
}}
|
|
680
|
+
>
|
|
681
|
+
<Typography level="body-sm">component="div" (기본값)</Typography>
|
|
682
|
+
</Box>
|
|
569
683
|
|
|
570
|
-
<Box
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
684
|
+
<Box
|
|
685
|
+
component="section"
|
|
686
|
+
sx={{
|
|
687
|
+
p: 2,
|
|
688
|
+
bgcolor: "primary.100",
|
|
689
|
+
borderRadius: "sm"
|
|
690
|
+
}}
|
|
691
|
+
>
|
|
692
|
+
<Typography level="body-sm">component="section"</Typography>
|
|
693
|
+
</Box>
|
|
577
694
|
|
|
578
|
-
<Box
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
695
|
+
<Box
|
|
696
|
+
component="article"
|
|
697
|
+
sx={{
|
|
698
|
+
p: 2,
|
|
699
|
+
bgcolor: "success.100",
|
|
700
|
+
borderRadius: "sm"
|
|
701
|
+
}}
|
|
702
|
+
>
|
|
703
|
+
<Typography level="body-sm">component="article"</Typography>
|
|
704
|
+
</Box>
|
|
585
705
|
|
|
586
|
-
<Box
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
706
|
+
<Box
|
|
707
|
+
component="nav"
|
|
708
|
+
sx={{
|
|
709
|
+
p: 2,
|
|
710
|
+
bgcolor: "warning.100",
|
|
711
|
+
borderRadius: "sm"
|
|
712
|
+
}}
|
|
713
|
+
>
|
|
714
|
+
<Typography level="body-sm">component="nav"</Typography>
|
|
715
|
+
</Box>
|
|
593
716
|
|
|
594
|
-
<Box
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
717
|
+
<Box
|
|
718
|
+
component="main"
|
|
719
|
+
sx={{
|
|
720
|
+
p: 2,
|
|
721
|
+
bgcolor: "danger.100",
|
|
722
|
+
borderRadius: "sm"
|
|
723
|
+
}}
|
|
724
|
+
>
|
|
725
|
+
<Typography level="body-sm">component="main"</Typography>
|
|
726
|
+
</Box>
|
|
727
|
+
</div>
|
|
602
728
|
```
|
|
603
729
|
|
|
604
730
|
### Motion Animations
|
|
@@ -606,51 +732,65 @@ You can render it as different HTML elements using the `component` prop.
|
|
|
606
732
|
Animation effects using built-in Framer Motion.
|
|
607
733
|
|
|
608
734
|
```tsx
|
|
609
|
-
<div
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
{isVisible
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
735
|
+
<div
|
|
736
|
+
style={{
|
|
737
|
+
display: "flex",
|
|
738
|
+
flexDirection: "column",
|
|
739
|
+
gap: "2rem",
|
|
740
|
+
alignItems: "center"
|
|
741
|
+
}}
|
|
742
|
+
>
|
|
743
|
+
<button onClick={() => setIsVisible(!isVisible)}>{isVisible ? "숨기기" : "보이기"}</button>
|
|
744
|
+
|
|
745
|
+
{isVisible && (
|
|
746
|
+
<Box
|
|
747
|
+
sx={{
|
|
748
|
+
width: 200,
|
|
749
|
+
height: 200,
|
|
750
|
+
bgcolor: "primary.100",
|
|
751
|
+
borderRadius: "md",
|
|
752
|
+
display: "flex",
|
|
753
|
+
alignItems: "center",
|
|
754
|
+
justifyContent: "center"
|
|
755
|
+
}}
|
|
756
|
+
initial={{
|
|
757
|
+
opacity: 0,
|
|
758
|
+
scale: 0.8
|
|
759
|
+
}}
|
|
760
|
+
animate={{
|
|
761
|
+
opacity: 1,
|
|
762
|
+
scale: 1
|
|
763
|
+
}}
|
|
764
|
+
exit={{
|
|
765
|
+
opacity: 0,
|
|
766
|
+
scale: 0.8
|
|
767
|
+
}}
|
|
768
|
+
transition={{
|
|
769
|
+
duration: 0.3
|
|
770
|
+
}}
|
|
771
|
+
>
|
|
772
|
+
<Typography level="title-md">애니메이션 Box</Typography>
|
|
773
|
+
</Box>
|
|
774
|
+
)}
|
|
775
|
+
|
|
776
|
+
<Box
|
|
777
|
+
sx={{
|
|
778
|
+
width: 100,
|
|
779
|
+
height: 100,
|
|
780
|
+
bgcolor: "success.200",
|
|
781
|
+
borderRadius: "sm",
|
|
782
|
+
cursor: "pointer"
|
|
783
|
+
}}
|
|
784
|
+
whileHover={{
|
|
785
|
+
scale: 1.1,
|
|
786
|
+
rotate: 5
|
|
787
|
+
}}
|
|
788
|
+
whileTap={{
|
|
789
|
+
scale: 0.95
|
|
790
|
+
}}
|
|
791
|
+
/>
|
|
792
|
+
<Typography level="body-sm">위의 박스에 마우스를 올려보거나 클릭해보세요</Typography>
|
|
793
|
+
</div>
|
|
654
794
|
```
|
|
655
795
|
|
|
656
796
|
### Complex Layouts
|
|
@@ -658,132 +798,170 @@ Animation effects using built-in Framer Motion.
|
|
|
658
798
|
You can combine Box components to build complex layouts.
|
|
659
799
|
|
|
660
800
|
```tsx
|
|
661
|
-
<div
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
<Box
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
<
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
<Typography level="body-sm">메뉴
|
|
697
|
-
</Box>
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
p: 2,
|
|
711
|
-
bgcolor: 'neutral.50',
|
|
712
|
-
borderRadius: 'md',
|
|
713
|
-
display: 'flex',
|
|
714
|
-
flexDirection: 'column',
|
|
715
|
-
gap: 1
|
|
716
|
-
}}>
|
|
717
|
-
<Typography level="title-sm" sx={{
|
|
718
|
-
mb: 1
|
|
719
|
-
}}>
|
|
720
|
-
사이드바
|
|
721
|
-
</Typography>
|
|
722
|
-
{['Item 1', 'Item 2', 'Item 3'].map(item => <Box key={item} sx={{
|
|
723
|
-
p: 1.5,
|
|
724
|
-
bgcolor: 'background.body',
|
|
725
|
-
borderRadius: 'sm'
|
|
726
|
-
}}>
|
|
727
|
-
<Typography level="body-sm">{item}</Typography>
|
|
728
|
-
</Box>)}
|
|
729
|
-
</Box>
|
|
730
|
-
|
|
731
|
-
{/* Content */}
|
|
732
|
-
<Box sx={{
|
|
733
|
-
flex: 1,
|
|
734
|
-
display: 'flex',
|
|
735
|
-
flexDirection: 'column',
|
|
736
|
-
gap: 2
|
|
737
|
-
}}>
|
|
738
|
-
<Box sx={{
|
|
739
|
-
p: 3,
|
|
740
|
-
bgcolor: 'success.50',
|
|
741
|
-
borderRadius: 'md'
|
|
742
|
-
}}>
|
|
743
|
-
<Typography level="title-md" sx={{
|
|
744
|
-
mb: 1
|
|
745
|
-
}}>
|
|
746
|
-
메인 콘텐츠
|
|
747
|
-
</Typography>
|
|
748
|
-
<Typography level="body-md">
|
|
749
|
-
여기에 주요 콘텐츠가 들어갑니다. Box 컴포넌트를 사용하여 복잡한 레이아웃을 쉽게 만들 수 있습니다.
|
|
750
|
-
</Typography>
|
|
751
|
-
</Box>
|
|
801
|
+
<div
|
|
802
|
+
style={{
|
|
803
|
+
display: "flex",
|
|
804
|
+
flexDirection: "column",
|
|
805
|
+
gap: "2rem"
|
|
806
|
+
}}
|
|
807
|
+
>
|
|
808
|
+
<Typography level="title-lg">복잡한 레이아웃 예제</Typography>
|
|
809
|
+
|
|
810
|
+
{/* Header */}
|
|
811
|
+
<Box
|
|
812
|
+
sx={{
|
|
813
|
+
display: "flex",
|
|
814
|
+
justifyContent: "space-between",
|
|
815
|
+
alignItems: "center",
|
|
816
|
+
p: 3,
|
|
817
|
+
bgcolor: "primary.50",
|
|
818
|
+
borderRadius: "lg"
|
|
819
|
+
}}
|
|
820
|
+
>
|
|
821
|
+
<Typography level="title-lg">헤더</Typography>
|
|
822
|
+
<Box
|
|
823
|
+
sx={{
|
|
824
|
+
display: "flex",
|
|
825
|
+
gap: 1
|
|
826
|
+
}}
|
|
827
|
+
>
|
|
828
|
+
<Box
|
|
829
|
+
sx={{
|
|
830
|
+
px: 2,
|
|
831
|
+
py: 1,
|
|
832
|
+
bgcolor: "primary.200",
|
|
833
|
+
borderRadius: "sm"
|
|
834
|
+
}}
|
|
835
|
+
>
|
|
836
|
+
<Typography level="body-sm">메뉴 1</Typography>
|
|
837
|
+
</Box>
|
|
838
|
+
<Box
|
|
839
|
+
sx={{
|
|
840
|
+
px: 2,
|
|
841
|
+
py: 1,
|
|
842
|
+
bgcolor: "primary.200",
|
|
843
|
+
borderRadius: "sm"
|
|
844
|
+
}}
|
|
845
|
+
>
|
|
846
|
+
<Typography level="body-sm">메뉴 2</Typography>
|
|
847
|
+
</Box>
|
|
848
|
+
</Box>
|
|
849
|
+
</Box>
|
|
752
850
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
851
|
+
{/* Main content area */}
|
|
852
|
+
<Box
|
|
853
|
+
sx={{
|
|
854
|
+
display: "flex",
|
|
855
|
+
gap: 3,
|
|
856
|
+
minHeight: 300
|
|
857
|
+
}}
|
|
858
|
+
>
|
|
859
|
+
{/* Sidebar */}
|
|
860
|
+
<Box
|
|
861
|
+
sx={{
|
|
862
|
+
flex: "0 0 200px",
|
|
863
|
+
p: 2,
|
|
864
|
+
bgcolor: "neutral.50",
|
|
865
|
+
borderRadius: "md",
|
|
866
|
+
display: "flex",
|
|
867
|
+
flexDirection: "column",
|
|
868
|
+
gap: 1
|
|
869
|
+
}}
|
|
870
|
+
>
|
|
871
|
+
<Typography
|
|
872
|
+
level="title-sm"
|
|
873
|
+
sx={{
|
|
874
|
+
mb: 1
|
|
875
|
+
}}
|
|
876
|
+
>
|
|
877
|
+
사이드바
|
|
878
|
+
</Typography>
|
|
879
|
+
{["Item 1", "Item 2", "Item 3"].map((item) => (
|
|
880
|
+
<Box
|
|
881
|
+
key={item}
|
|
882
|
+
sx={{
|
|
883
|
+
p: 1.5,
|
|
884
|
+
bgcolor: "background.body",
|
|
885
|
+
borderRadius: "sm"
|
|
886
|
+
}}
|
|
887
|
+
>
|
|
888
|
+
<Typography level="body-sm">{item}</Typography>
|
|
889
|
+
</Box>
|
|
890
|
+
))}
|
|
891
|
+
</Box>
|
|
892
|
+
|
|
893
|
+
{/* Content */}
|
|
894
|
+
<Box
|
|
895
|
+
sx={{
|
|
896
|
+
flex: 1,
|
|
897
|
+
display: "flex",
|
|
898
|
+
flexDirection: "column",
|
|
899
|
+
gap: 2
|
|
900
|
+
}}
|
|
901
|
+
>
|
|
902
|
+
<Box
|
|
903
|
+
sx={{
|
|
904
|
+
p: 3,
|
|
905
|
+
bgcolor: "success.50",
|
|
906
|
+
borderRadius: "md"
|
|
907
|
+
}}
|
|
908
|
+
>
|
|
909
|
+
<Typography
|
|
910
|
+
level="title-md"
|
|
911
|
+
sx={{
|
|
912
|
+
mb: 1
|
|
913
|
+
}}
|
|
914
|
+
>
|
|
915
|
+
메인 콘텐츠
|
|
916
|
+
</Typography>
|
|
917
|
+
<Typography level="body-md">
|
|
918
|
+
여기에 주요 콘텐츠가 들어갑니다. Box 컴포넌트를 사용하여 복잡한 레이아웃을 쉽게 만들 수
|
|
919
|
+
있습니다.
|
|
920
|
+
</Typography>
|
|
921
|
+
</Box>
|
|
922
|
+
|
|
923
|
+
<Box
|
|
924
|
+
sx={{
|
|
925
|
+
display: "flex",
|
|
926
|
+
gap: 2
|
|
927
|
+
}}
|
|
928
|
+
>
|
|
929
|
+
<Box
|
|
930
|
+
sx={{
|
|
931
|
+
flex: 1,
|
|
932
|
+
p: 2,
|
|
933
|
+
bgcolor: "warning.50",
|
|
934
|
+
borderRadius: "md"
|
|
935
|
+
}}
|
|
936
|
+
>
|
|
937
|
+
<Typography level="body-sm">카드 1</Typography>
|
|
938
|
+
</Box>
|
|
939
|
+
<Box
|
|
940
|
+
sx={{
|
|
941
|
+
flex: 1,
|
|
942
|
+
p: 2,
|
|
943
|
+
bgcolor: "warning.50",
|
|
944
|
+
borderRadius: "md"
|
|
945
|
+
}}
|
|
946
|
+
>
|
|
947
|
+
<Typography level="body-sm">카드 2</Typography>
|
|
948
|
+
</Box>
|
|
949
|
+
</Box>
|
|
950
|
+
</Box>
|
|
951
|
+
</Box>
|
|
776
952
|
|
|
777
|
-
{/* Footer */}
|
|
778
|
-
<Box
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
953
|
+
{/* Footer */}
|
|
954
|
+
<Box
|
|
955
|
+
sx={{
|
|
956
|
+
p: 2,
|
|
957
|
+
textAlign: "center",
|
|
958
|
+
bgcolor: "neutral.100",
|
|
959
|
+
borderRadius: "md"
|
|
960
|
+
}}
|
|
961
|
+
>
|
|
962
|
+
<Typography level="body-sm">푸터 영역</Typography>
|
|
963
|
+
</Box>
|
|
964
|
+
</div>
|
|
787
965
|
```
|
|
788
966
|
|
|
789
967
|
## Key Features
|
|
@@ -795,11 +973,12 @@ The most powerful feature of Box is the `sx` prop. It allows you to apply CSS st
|
|
|
795
973
|
```tsx
|
|
796
974
|
<Box
|
|
797
975
|
sx={{
|
|
798
|
-
p: 2,
|
|
799
|
-
m: { xs: 1, md: 2 },
|
|
800
|
-
bgcolor: 'primary.50',
|
|
801
|
-
borderRadius: 'md',
|
|
802
|
-
'&:hover': {
|
|
976
|
+
p: 2, // padding: 16px
|
|
977
|
+
m: { xs: 1, md: 2 }, // responsive margin
|
|
978
|
+
bgcolor: 'primary.50', // theme color
|
|
979
|
+
borderRadius: 'md', // theme border-radius
|
|
980
|
+
'&:hover': {
|
|
981
|
+
// hover state
|
|
803
982
|
bgcolor: 'primary.100',
|
|
804
983
|
},
|
|
805
984
|
}}
|
|
@@ -907,7 +1086,7 @@ You can use animation props directly.
|
|
|
907
1086
|
gap: 2,
|
|
908
1087
|
}}
|
|
909
1088
|
>
|
|
910
|
-
{items.map(item => (
|
|
1089
|
+
{items.map((item) => (
|
|
911
1090
|
<Box key={item.id} sx={{ p: 2, bgcolor: 'background.surface' }}>
|
|
912
1091
|
{item.content}
|
|
913
1092
|
</Box>
|