@ceed/ads 1.30.0 → 1.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Overview.md +5 -5
- package/dist/components/data-display/Avatar.md +85 -74
- package/dist/components/data-display/Badge.md +23 -5
- package/dist/components/data-display/Chip.md +49 -35
- package/dist/components/data-display/DataTable.md +93 -0
- package/dist/components/data-display/InfoSign.md +15 -5
- package/dist/components/data-display/Markdown.md +22 -26
- package/dist/components/data-display/Table.md +63 -53
- package/dist/components/data-display/Tooltip.md +70 -58
- package/dist/components/data-display/Typography.md +28 -11
- package/dist/components/feedback/Alert.md +86 -74
- package/dist/components/feedback/CircularProgress.md +20 -5
- package/dist/components/feedback/Dialog.md +8 -12
- package/dist/components/feedback/Modal.md +12 -16
- package/dist/components/feedback/Skeleton.md +20 -5
- package/dist/components/inputs/Autocomplete.md +8 -10
- package/dist/components/inputs/Button.md +107 -87
- package/dist/components/inputs/ButtonGroup.md +20 -5
- package/dist/components/inputs/Calendar.md +25 -5
- package/dist/components/inputs/Checkbox.md +171 -450
- package/dist/components/inputs/CurrencyInput.md +25 -5
- package/dist/components/inputs/DatePicker.md +39 -5
- package/dist/components/inputs/DateRangePicker.md +29 -5
- package/dist/components/inputs/FilterMenu.md +85 -9
- package/dist/components/inputs/FilterableCheckboxGroup.md +23 -8
- package/dist/components/inputs/FormControl.md +34 -6
- package/dist/components/inputs/IconButton.md +21 -5
- package/dist/components/inputs/Input.md +254 -68
- package/dist/components/inputs/MonthPicker.md +28 -5
- package/dist/components/inputs/MonthRangePicker.md +26 -5
- package/dist/components/inputs/PercentageInput.md +28 -5
- package/dist/components/inputs/RadioButton.md +26 -5
- package/dist/components/inputs/RadioList.md +23 -6
- package/dist/components/inputs/RadioTileGroup.md +40 -8
- package/dist/components/inputs/Select.md +59 -5
- package/dist/components/inputs/Slider.md +26 -5
- package/dist/components/inputs/Switch.md +23 -5
- package/dist/components/inputs/Textarea.md +27 -5
- package/dist/components/inputs/Uploader/Uploader.md +24 -5
- package/dist/components/layout/Box.md +66 -58
- package/dist/components/layout/Container.md +9 -13
- package/dist/components/layout/Grid.md +91 -75
- package/dist/components/layout/Stack.md +85 -70
- package/dist/components/navigation/Breadcrumbs.md +23 -14
- package/dist/components/navigation/Dropdown.md +29 -20
- package/dist/components/navigation/IconMenuButton.md +24 -11
- package/dist/components/navigation/InsetDrawer.md +16 -5
- package/dist/components/navigation/Link.md +30 -14
- package/dist/components/navigation/Menu.md +33 -20
- package/dist/components/navigation/MenuButton.md +26 -12
- package/dist/components/navigation/NavigationGroup.md +7 -11
- package/dist/components/navigation/NavigationItem.md +8 -12
- package/dist/components/navigation/Navigator.md +5 -9
- package/dist/components/navigation/Pagination.md +21 -12
- package/dist/components/navigation/ProfileMenu.md +17 -5
- package/dist/components/navigation/Stepper.md +18 -5
- package/dist/components/navigation/Tabs.md +37 -14
- package/dist/components/surfaces/Accordions.md +12 -16
- package/dist/components/surfaces/Card.md +59 -47
- package/dist/components/surfaces/Divider.md +70 -61
- package/dist/components/surfaces/Sheet.md +18 -5
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
Grid
|
|
5
|
+
The Grid component is a powerful layout system built on CSS Grid. It uses a 12-column grid system, making it easy to create responsive layouts and apply different layouts at different breakpoints. It is well suited for complex dashboards, product catalogs, card layouts, and more.
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
<Grid container spacing={args.spacing}>
|
|
@@ -53,11 +53,9 @@ function MyComponent() {
|
|
|
53
53
|
}
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
##
|
|
56
|
+
## Grid Basic Usage
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
12열 그리드 시스템의 기본 사용법입니다.
|
|
58
|
+
The basic usage of the 12-column grid system.
|
|
61
59
|
|
|
62
60
|
```tsx
|
|
63
61
|
<div style={{
|
|
@@ -87,9 +85,9 @@ function MyComponent() {
|
|
|
87
85
|
</div>
|
|
88
86
|
```
|
|
89
87
|
|
|
90
|
-
|
|
88
|
+
## Responsive Grid Layout
|
|
91
89
|
|
|
92
|
-
|
|
90
|
+
A responsive grid that applies different layouts across different screen sizes.
|
|
93
91
|
|
|
94
92
|
```tsx
|
|
95
93
|
<div>
|
|
@@ -135,9 +133,9 @@ function MyComponent() {
|
|
|
135
133
|
</div>
|
|
136
134
|
```
|
|
137
135
|
|
|
138
|
-
|
|
136
|
+
## Grid Spacing Examples
|
|
139
137
|
|
|
140
|
-
|
|
138
|
+
Grid layouts with different spacing values.
|
|
141
139
|
|
|
142
140
|
```tsx
|
|
143
141
|
<div style={{
|
|
@@ -199,9 +197,9 @@ function MyComponent() {
|
|
|
199
197
|
</div>
|
|
200
198
|
```
|
|
201
199
|
|
|
202
|
-
|
|
200
|
+
## Nested Grid Layout
|
|
203
201
|
|
|
204
|
-
|
|
202
|
+
You can nest one grid inside another.
|
|
205
203
|
|
|
206
204
|
```tsx
|
|
207
205
|
<div>
|
|
@@ -263,9 +261,9 @@ function MyComponent() {
|
|
|
263
261
|
</div>
|
|
264
262
|
```
|
|
265
263
|
|
|
266
|
-
|
|
264
|
+
## Grid Auto Layout Example
|
|
267
265
|
|
|
268
|
-
|
|
266
|
+
A grid using auto layout.
|
|
269
267
|
|
|
270
268
|
```tsx
|
|
271
269
|
<div style={{
|
|
@@ -307,9 +305,9 @@ function MyComponent() {
|
|
|
307
305
|
</div>
|
|
308
306
|
```
|
|
309
307
|
|
|
310
|
-
|
|
308
|
+
## Complex Grid Layouts
|
|
311
309
|
|
|
312
|
-
|
|
310
|
+
Complex layout examples based on real use cases.
|
|
313
311
|
|
|
314
312
|
```tsx
|
|
315
313
|
<div style={{
|
|
@@ -433,9 +431,9 @@ function MyComponent() {
|
|
|
433
431
|
</div>
|
|
434
432
|
```
|
|
435
433
|
|
|
436
|
-
|
|
434
|
+
## Grid Breakpoint Demo
|
|
437
435
|
|
|
438
|
-
|
|
436
|
+
An example showing how Grid behaves at each breakpoint.
|
|
439
437
|
|
|
440
438
|
```tsx
|
|
441
439
|
<div>
|
|
@@ -491,9 +489,9 @@ function MyComponent() {
|
|
|
491
489
|
|
|
492
490
|
## Grid System
|
|
493
491
|
|
|
494
|
-
### 12
|
|
492
|
+
### 12-Column System
|
|
495
493
|
|
|
496
|
-
Grid
|
|
494
|
+
Grid is based on a 12-column system. Each item can span 1 to 12 columns.
|
|
497
495
|
|
|
498
496
|
```tsx
|
|
499
497
|
<Grid container spacing={2}>
|
|
@@ -508,32 +506,32 @@ Grid는 12열 시스템을 기반으로 합니다. 각 아이템은 1-12열을
|
|
|
508
506
|
|
|
509
507
|
### Container & Item
|
|
510
508
|
|
|
511
|
-
- `container`:
|
|
512
|
-
- `item`:
|
|
513
|
-
-
|
|
509
|
+
- `container`: Used to create a Grid container
|
|
510
|
+
- `item`: Used to create a Grid item
|
|
511
|
+
- A single component can be both a `container` and an `item` at the same time (nested grid)
|
|
514
512
|
|
|
515
513
|
## Breakpoints
|
|
516
514
|
|
|
517
|
-
Grid
|
|
515
|
+
Grid supports the following breakpoints:
|
|
518
516
|
|
|
519
|
-
|
|
|
520
|
-
|
|
|
521
|
-
| `xs`
|
|
522
|
-
| `sm`
|
|
523
|
-
| `md`
|
|
524
|
-
| `lg`
|
|
525
|
-
| `xl`
|
|
517
|
+
| Breakpoint | Size | Description |
|
|
518
|
+
| ---------- | ------- | --------------------------------- |
|
|
519
|
+
| `xs` | 0px+ | Mobile (portrait) |
|
|
520
|
+
| `sm` | 600px+ | Mobile (landscape) / small tablet |
|
|
521
|
+
| `md` | 900px+ | Tablet |
|
|
522
|
+
| `lg` | 1200px+ | Desktop |
|
|
523
|
+
| `xl` | 1536px+ | Large desktop |
|
|
526
524
|
|
|
527
|
-
###
|
|
525
|
+
### Responsive Usage
|
|
528
526
|
|
|
529
527
|
```tsx
|
|
530
528
|
<Grid container spacing={2}>
|
|
531
529
|
<Grid item xs={12} sm={6} md={4} lg={3}>
|
|
532
530
|
{/*
|
|
533
|
-
xs: 100% (12/12) -
|
|
534
|
-
sm: 50% (6/12) -
|
|
535
|
-
md: 33% (4/12) -
|
|
536
|
-
lg: 25% (3/12) -
|
|
531
|
+
xs: 100% (12/12) - full width on mobile
|
|
532
|
+
sm: 50% (6/12) - half width on small screens
|
|
533
|
+
md: 33% (4/12) - one-third width on tablets
|
|
534
|
+
lg: 25% (3/12) - one-quarter width on desktop
|
|
537
535
|
*/}
|
|
538
536
|
반응형 아이템
|
|
539
537
|
</Grid>
|
|
@@ -542,21 +540,21 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
542
540
|
|
|
543
541
|
## Spacing
|
|
544
542
|
|
|
545
|
-
|
|
543
|
+
You can control the spacing between grid items using the `spacing` prop.
|
|
546
544
|
|
|
547
|
-
|
|
|
548
|
-
|
|
|
549
|
-
| `0`
|
|
550
|
-
| `1`
|
|
551
|
-
| `2`
|
|
552
|
-
| `3`
|
|
553
|
-
| `4`
|
|
554
|
-
| `5`
|
|
555
|
-
| `6`
|
|
545
|
+
| Value | Size | Description |
|
|
546
|
+
| ----- | ---- | ----------------------- |
|
|
547
|
+
| `0` | 0px | No spacing |
|
|
548
|
+
| `1` | 8px | Very small spacing |
|
|
549
|
+
| `2` | 16px | Small spacing (default) |
|
|
550
|
+
| `3` | 24px | Medium spacing |
|
|
551
|
+
| `4` | 32px | Large spacing |
|
|
552
|
+
| `5` | 40px | Very large spacing |
|
|
553
|
+
| `6` | 48px | Maximum spacing |
|
|
556
554
|
|
|
557
555
|
## Auto Layout
|
|
558
556
|
|
|
559
|
-
|
|
557
|
+
You can let items size and position automatically without explicitly defining the column count:
|
|
560
558
|
|
|
561
559
|
```tsx
|
|
562
560
|
<Grid container spacing={2}>
|
|
@@ -572,9 +570,7 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
572
570
|
</Grid>
|
|
573
571
|
```
|
|
574
572
|
|
|
575
|
-
##
|
|
576
|
-
|
|
577
|
-
### Card Layout
|
|
573
|
+
## Grid Card Layout
|
|
578
574
|
|
|
579
575
|
```tsx
|
|
580
576
|
<Grid container spacing={3}>
|
|
@@ -591,7 +587,7 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
591
587
|
</Grid>
|
|
592
588
|
```
|
|
593
589
|
|
|
594
|
-
|
|
590
|
+
## Grid Dashboard Layout
|
|
595
591
|
|
|
596
592
|
```tsx
|
|
597
593
|
<Grid container spacing={2}>
|
|
@@ -626,7 +622,7 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
626
622
|
</Grid>
|
|
627
623
|
```
|
|
628
624
|
|
|
629
|
-
|
|
625
|
+
## Grid Form Layout
|
|
630
626
|
|
|
631
627
|
```tsx
|
|
632
628
|
<Grid container spacing={2}>
|
|
@@ -657,7 +653,7 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
657
653
|
</Grid>
|
|
658
654
|
```
|
|
659
655
|
|
|
660
|
-
|
|
656
|
+
## Grid Image Gallery
|
|
661
657
|
|
|
662
658
|
```tsx
|
|
663
659
|
<Grid container spacing={1}>
|
|
@@ -666,7 +662,7 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
666
662
|
<Box
|
|
667
663
|
sx={{
|
|
668
664
|
position: 'relative',
|
|
669
|
-
paddingTop: '100%', // 1:1
|
|
665
|
+
paddingTop: '100%', // maintain a 1:1 ratio
|
|
670
666
|
overflow: 'hidden',
|
|
671
667
|
borderRadius: 'sm',
|
|
672
668
|
}}
|
|
@@ -691,38 +687,58 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
691
687
|
|
|
692
688
|
## Best Practices
|
|
693
689
|
|
|
694
|
-
1.
|
|
690
|
+
1. **Use meaningful structure**: Choose appropriate elements while considering semantic HTML structure when using Grid.
|
|
691
|
+
|
|
692
|
+
2. **Design responsively first**: Start with mobile layouts and scale up to larger screens.
|
|
693
|
+
|
|
694
|
+
3. **Keep spacing consistent**: Use consistent spacing values across the project.
|
|
695
|
+
|
|
696
|
+
4. **Optimize performance**:
|
|
697
|
+
- Avoid unnecessarily deep nesting
|
|
698
|
+
- Consider virtualization when rendering many items
|
|
699
|
+
|
|
700
|
+
5. **Consider accessibility**:
|
|
701
|
+
- Use appropriate semantic tags
|
|
702
|
+
- Arrange content so keyboard navigation remains logical
|
|
695
703
|
|
|
696
|
-
|
|
704
|
+
6. **Prioritize content**: Let the grid adapt to the content instead of forcing content into the grid.
|
|
697
705
|
|
|
698
|
-
|
|
706
|
+
7. **Debug effectively**: Apply background colors to Grid items during development to inspect the layout more easily.
|
|
699
707
|
|
|
700
|
-
|
|
701
|
-
- 불필요하게 깊은 중첩은 피하세요
|
|
702
|
-
- 많은 아이템이 있을 때는 가상화를 고려하세요
|
|
708
|
+
## Props and Customization
|
|
703
709
|
|
|
704
|
-
|
|
705
|
-
- 적절한 시맨틱 태그를 사용하세요
|
|
706
|
-
- 키보드 탐색이 논리적으로 이뤄지도록 배치하세요
|
|
710
|
+
### Key Props
|
|
707
711
|
|
|
708
|
-
|
|
712
|
+
| Prop | Type | Default | Description |
|
|
713
|
+
| ----------- | -------------------------------------------------------- | ------- | ------------------------------------ |
|
|
714
|
+
| `children` | `ReactNode` | - | Grid children (items) |
|
|
715
|
+
| `container` | `boolean` | `false` | Sets the element as a grid container |
|
|
716
|
+
| `xs` | `number \| 'auto' \| boolean` | - | Column span at xs breakpoint |
|
|
717
|
+
| `sm` | `number \| 'auto' \| boolean` | - | Column span at sm breakpoint |
|
|
718
|
+
| `md` | `number \| 'auto' \| boolean` | - | Column span at md breakpoint |
|
|
719
|
+
| `lg` | `number \| 'auto' \| boolean` | - | Column span at lg breakpoint |
|
|
720
|
+
| `xl` | `number \| 'auto' \| boolean` | - | Column span at xl breakpoint |
|
|
721
|
+
| `spacing` | `number \| string` | `0` | Gap between grid items |
|
|
722
|
+
| `direction` | `'row' \| 'row-reverse' \| 'column' \| 'column-reverse'` | `'row'` | Flex direction |
|
|
723
|
+
| `columns` | `number` | `12` | Total number of columns |
|
|
724
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
709
725
|
|
|
710
|
-
|
|
726
|
+
> **Note**: Grid accepts all Joy UI Grid (MUI) props.
|
|
711
727
|
|
|
712
728
|
## Troubleshooting
|
|
713
729
|
|
|
714
|
-
###
|
|
730
|
+
### Common Issues
|
|
715
731
|
|
|
716
|
-
1.
|
|
717
|
-
-
|
|
718
|
-
- container
|
|
732
|
+
1. **Items are positioned differently than expected**
|
|
733
|
+
- Check that the total column count does not exceed 12
|
|
734
|
+
- Make sure the `container` and `item` props are set correctly
|
|
719
735
|
|
|
720
|
-
2.
|
|
721
|
-
-
|
|
722
|
-
-
|
|
736
|
+
2. **Spacing is not applied**
|
|
737
|
+
- Verify that the `spacing` prop is set on the container
|
|
738
|
+
- Verify that child elements are wrapped in Grid items
|
|
723
739
|
|
|
724
|
-
3.
|
|
725
|
-
-
|
|
726
|
-
-
|
|
740
|
+
3. **Responsive behavior is not working**
|
|
741
|
+
- Check that the breakpoint values are correct
|
|
742
|
+
- Make sure the intended total at each breakpoint is 12 or less
|
|
727
743
|
|
|
728
|
-
Grid
|
|
744
|
+
Grid is a powerful tool for building complex layouts. Responsive design and consistent spacing help improve the overall user experience.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
Stack
|
|
5
|
+
The Stack component is a layout component that arranges child elements in one dimension, either vertically or horizontally, with consistent spacing. Built on Flexbox, it provides a simple and intuitive API for creating complex layouts with ease. It is useful across many UI patterns, including navigation bars, form layouts, and card internals.
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
<Stack {...args}>
|
|
@@ -35,11 +35,9 @@ function MyComponent() {
|
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## Stack Basic Usage
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
세로(column)와 가로(row) 배치의 기본 사용법입니다.
|
|
40
|
+
The basic usage for vertical (`column`) and horizontal (`row`) layouts.
|
|
43
41
|
|
|
44
42
|
```tsx
|
|
45
43
|
<div style={{
|
|
@@ -75,9 +73,9 @@ function MyComponent() {
|
|
|
75
73
|
</div>
|
|
76
74
|
```
|
|
77
75
|
|
|
78
|
-
|
|
76
|
+
## Stack Directions
|
|
79
77
|
|
|
80
|
-
|
|
78
|
+
You can use different layout directions.
|
|
81
79
|
|
|
82
80
|
```tsx
|
|
83
81
|
<div style={{
|
|
@@ -144,9 +142,9 @@ function MyComponent() {
|
|
|
144
142
|
</div>
|
|
145
143
|
```
|
|
146
144
|
|
|
147
|
-
|
|
145
|
+
## Stack Spacing Examples
|
|
148
146
|
|
|
149
|
-
|
|
147
|
+
You can apply different spacing values.
|
|
150
148
|
|
|
151
149
|
```tsx
|
|
152
150
|
<div style={{
|
|
@@ -208,9 +206,9 @@ function MyComponent() {
|
|
|
208
206
|
</div>
|
|
209
207
|
```
|
|
210
208
|
|
|
211
|
-
|
|
209
|
+
## Stack Alignment
|
|
212
210
|
|
|
213
|
-
|
|
211
|
+
You can control element alignment in different ways.
|
|
214
212
|
|
|
215
213
|
```tsx
|
|
216
214
|
<div style={{
|
|
@@ -277,9 +275,9 @@ function MyComponent() {
|
|
|
277
275
|
</div>
|
|
278
276
|
```
|
|
279
277
|
|
|
280
|
-
|
|
278
|
+
## Stack Responsive Direction
|
|
281
279
|
|
|
282
|
-
|
|
280
|
+
You can change the layout direction based on screen size.
|
|
283
281
|
|
|
284
282
|
```tsx
|
|
285
283
|
<div>
|
|
@@ -335,9 +333,9 @@ function MyComponent() {
|
|
|
335
333
|
</div>
|
|
336
334
|
```
|
|
337
335
|
|
|
338
|
-
|
|
336
|
+
## Nested Stack Layouts
|
|
339
337
|
|
|
340
|
-
Stack
|
|
338
|
+
You can nest Stack components to build more complex layouts.
|
|
341
339
|
|
|
342
340
|
```tsx
|
|
343
341
|
<div>
|
|
@@ -393,9 +391,9 @@ Stack을 중첩하여 더 복잡한 레이아웃을 만들 수 있습니다.
|
|
|
393
391
|
</div>
|
|
394
392
|
```
|
|
395
393
|
|
|
396
|
-
|
|
394
|
+
## Stack Real World Examples
|
|
397
395
|
|
|
398
|
-
|
|
396
|
+
Examples that demonstrate real-world use cases.
|
|
399
397
|
|
|
400
398
|
```tsx
|
|
401
399
|
<div style={{
|
|
@@ -640,7 +638,7 @@ Stack을 중첩하여 더 복잡한 레이아웃을 만들 수 있습니다.
|
|
|
640
638
|
|
|
641
639
|
### direction
|
|
642
640
|
|
|
643
|
-
|
|
641
|
+
Sets the layout direction of the elements.
|
|
644
642
|
|
|
645
643
|
```tsx
|
|
646
644
|
<Stack direction="row">가로 배치</Stack>
|
|
@@ -648,7 +646,7 @@ Stack을 중첩하여 더 복잡한 레이아웃을 만들 수 있습니다.
|
|
|
648
646
|
<Stack direction="row-reverse">가로 역순</Stack>
|
|
649
647
|
<Stack direction="column-reverse">세로 역순</Stack>
|
|
650
648
|
|
|
651
|
-
//
|
|
649
|
+
// responsive direction
|
|
652
650
|
<Stack direction={{ xs: 'column', sm: 'row' }}>
|
|
653
651
|
반응형 배치
|
|
654
652
|
</Stack>
|
|
@@ -656,26 +654,26 @@ Stack을 중첩하여 더 복잡한 레이아웃을 만들 수 있습니다.
|
|
|
656
654
|
|
|
657
655
|
### spacing
|
|
658
656
|
|
|
659
|
-
|
|
657
|
+
Sets the spacing between elements.
|
|
660
658
|
|
|
661
|
-
|
|
|
662
|
-
| ----- | ---- |
|
|
663
|
-
| `0` | 0px |
|
|
664
|
-
| `0.5` | 4px |
|
|
665
|
-
| `1` | 8px |
|
|
666
|
-
| `1.5` | 12px |
|
|
667
|
-
| `2` | 16px |
|
|
668
|
-
| `3` | 24px |
|
|
669
|
-
| `4` | 32px |
|
|
670
|
-
| `5` | 40px |
|
|
671
|
-
| `6` | 48px |
|
|
659
|
+
| Value | Size | Description |
|
|
660
|
+
| ----- | ---- | ------------------------ |
|
|
661
|
+
| `0` | 0px | No spacing |
|
|
662
|
+
| `0.5` | 4px | Very small spacing |
|
|
663
|
+
| `1` | 8px | Small spacing |
|
|
664
|
+
| `1.5` | 12px | Small-to-medium spacing |
|
|
665
|
+
| `2` | 16px | Medium spacing (default) |
|
|
666
|
+
| `3` | 24px | Large spacing |
|
|
667
|
+
| `4` | 32px | Very large spacing |
|
|
668
|
+
| `5` | 40px | Extra large spacing |
|
|
669
|
+
| `6` | 48px | Maximum spacing |
|
|
672
670
|
|
|
673
671
|
```tsx
|
|
674
672
|
<Stack spacing={2}>기본 간격</Stack>
|
|
675
673
|
<Stack spacing={0}>간격 없음</Stack>
|
|
676
674
|
<Stack spacing={4}>큰 간격</Stack>
|
|
677
675
|
|
|
678
|
-
//
|
|
676
|
+
// responsive spacing
|
|
679
677
|
<Stack spacing={{ xs: 1, sm: 2, md: 3 }}>
|
|
680
678
|
반응형 간격
|
|
681
679
|
</Stack>
|
|
@@ -683,7 +681,7 @@ Stack을 중첩하여 더 복잡한 레이아웃을 만들 수 있습니다.
|
|
|
683
681
|
|
|
684
682
|
### alignItems
|
|
685
683
|
|
|
686
|
-
|
|
684
|
+
Sets alignment along the cross axis.
|
|
687
685
|
|
|
688
686
|
```tsx
|
|
689
687
|
<Stack alignItems="center">중앙 정렬</Stack>
|
|
@@ -695,7 +693,7 @@ Stack을 중첩하여 더 복잡한 레이아웃을 만들 수 있습니다.
|
|
|
695
693
|
|
|
696
694
|
### justifyContent
|
|
697
695
|
|
|
698
|
-
|
|
696
|
+
Sets alignment along the main axis.
|
|
699
697
|
|
|
700
698
|
```tsx
|
|
701
699
|
<Stack justifyContent="center">중앙 정렬</Stack>
|
|
@@ -707,7 +705,7 @@ Stack을 중첩하여 더 복잡한 레이아웃을 만들 수 있습니다.
|
|
|
707
705
|
|
|
708
706
|
## Responsive Behavior
|
|
709
707
|
|
|
710
|
-
Stack
|
|
708
|
+
Stack supports responsive values for all props:
|
|
711
709
|
|
|
712
710
|
```tsx
|
|
713
711
|
<Stack
|
|
@@ -715,13 +713,11 @@ Stack은 모든 props에서 반응형 값을 지원합니다:
|
|
|
715
713
|
spacing={{ xs: 1, sm: 2, md: 3 }}
|
|
716
714
|
alignItems={{ xs: 'stretch', md: 'center' }}
|
|
717
715
|
>
|
|
718
|
-
{/*
|
|
716
|
+
{/* different layouts for different screen sizes */}
|
|
719
717
|
</Stack>
|
|
720
718
|
```
|
|
721
719
|
|
|
722
|
-
##
|
|
723
|
-
|
|
724
|
-
### Navigation Bar
|
|
720
|
+
## Stack Navigation Bar
|
|
725
721
|
|
|
726
722
|
```tsx
|
|
727
723
|
<Stack
|
|
@@ -740,7 +736,7 @@ Stack은 모든 props에서 반응형 값을 지원합니다:
|
|
|
740
736
|
</Stack>
|
|
741
737
|
```
|
|
742
738
|
|
|
743
|
-
|
|
739
|
+
## Stack Form Layout
|
|
744
740
|
|
|
745
741
|
```tsx
|
|
746
742
|
<Stack spacing={3}>
|
|
@@ -770,7 +766,7 @@ Stack은 모든 props에서 반응형 값을 지원합니다:
|
|
|
770
766
|
</Stack>
|
|
771
767
|
```
|
|
772
768
|
|
|
773
|
-
|
|
769
|
+
## Stack Card Content
|
|
774
770
|
|
|
775
771
|
```tsx
|
|
776
772
|
<Card sx={{ maxWidth: 400 }}>
|
|
@@ -799,7 +795,7 @@ Stack은 모든 props에서 반응형 값을 지원합니다:
|
|
|
799
795
|
</Card>
|
|
800
796
|
```
|
|
801
797
|
|
|
802
|
-
|
|
798
|
+
## Stack User Profile
|
|
803
799
|
|
|
804
800
|
```tsx
|
|
805
801
|
<Stack spacing={3}>
|
|
@@ -830,7 +826,7 @@ Stack은 모든 props에서 반응형 값을 지원합니다:
|
|
|
830
826
|
</Stack>
|
|
831
827
|
```
|
|
832
828
|
|
|
833
|
-
|
|
829
|
+
## Stack List Layout
|
|
834
830
|
|
|
835
831
|
```tsx
|
|
836
832
|
<Stack spacing={2}>
|
|
@@ -861,7 +857,7 @@ Stack은 모든 props에서 반응형 값을 지원합니다:
|
|
|
861
857
|
</Stack>
|
|
862
858
|
```
|
|
863
859
|
|
|
864
|
-
|
|
860
|
+
## Stack Button Group
|
|
865
861
|
|
|
866
862
|
```tsx
|
|
867
863
|
<Stack direction="row" spacing={1}>
|
|
@@ -885,53 +881,72 @@ Stack은 모든 props에서 반응형 값을 지원합니다:
|
|
|
885
881
|
|
|
886
882
|
## Best Practices
|
|
887
883
|
|
|
888
|
-
1.
|
|
884
|
+
1. **Choose appropriate spacing**: Use spacing values that match the content hierarchy.
|
|
889
885
|
|
|
890
|
-
2.
|
|
886
|
+
2. **Design responsively**: Use responsive props so layouts work well across different screen sizes.
|
|
891
887
|
|
|
892
|
-
3.
|
|
888
|
+
3. **Use meaningful alignment**: Use `alignItems` and `justifyContent` to create intentional alignment.
|
|
893
889
|
|
|
894
|
-
4.
|
|
890
|
+
4. **Minimize nesting**: Avoid excessive nesting and only nest Stack when it is actually needed.
|
|
895
891
|
|
|
896
|
-
5.
|
|
892
|
+
5. **Consider performance**: Use virtualization when rendering many items.
|
|
897
893
|
|
|
898
|
-
6.
|
|
899
|
-
-
|
|
900
|
-
-
|
|
894
|
+
6. **Consider accessibility**:
|
|
895
|
+
- Arrange elements to preserve a logical tab order
|
|
896
|
+
- Use appropriate semantic tags alongside Stack
|
|
901
897
|
|
|
902
|
-
7.
|
|
898
|
+
7. **Maintain consistency**: Use consistent spacing values across the project.
|
|
903
899
|
|
|
904
900
|
## When to Use Stack vs Other Layout Components
|
|
905
901
|
|
|
906
902
|
### Stack vs Flexbox (Box)
|
|
907
903
|
|
|
908
|
-
- **Stack**:
|
|
909
|
-
- **Box with flex**:
|
|
904
|
+
- **Stack**: For simple one-dimensional layouts with consistent spacing
|
|
905
|
+
- **Box with flex**: For cases that need more complex Flexbox behavior
|
|
910
906
|
|
|
911
907
|
### Stack vs Grid
|
|
912
908
|
|
|
913
|
-
- **Stack**:
|
|
914
|
-
- **Grid**:
|
|
909
|
+
- **Stack**: One-dimensional layouts (vertical or horizontal)
|
|
910
|
+
- **Grid**: Two-dimensional layouts (rows and columns)
|
|
915
911
|
|
|
916
912
|
### Stack vs Space (if available)
|
|
917
913
|
|
|
918
|
-
- **Stack**:
|
|
919
|
-
- **Space**:
|
|
914
|
+
- **Stack**: Provides both a container and spacing
|
|
915
|
+
- **Space**: Provides spacing only (between children)
|
|
916
|
+
|
|
917
|
+
## Props and Customization
|
|
918
|
+
|
|
919
|
+
### Key Props
|
|
920
|
+
|
|
921
|
+
| Prop | Type | Default | Description |
|
|
922
|
+
| ---------------- | -------------------------------------------------------- | ---------- | ----------------------------------------- |
|
|
923
|
+
| `children` | `ReactNode` | - | Stack children |
|
|
924
|
+
| `direction` | `'row' \| 'row-reverse' \| 'column' \| 'column-reverse'` | `'column'` | Flex direction |
|
|
925
|
+
| `spacing` | `number \| string` | `0` | Gap between children |
|
|
926
|
+
| `alignItems` | `string` | - | CSS align-items |
|
|
927
|
+
| `justifyContent` | `string` | - | CSS justify-content |
|
|
928
|
+
| `flexWrap` | `'nowrap' \| 'wrap' \| 'wrap-reverse'` | `'nowrap'` | Flex wrapping behavior |
|
|
929
|
+
| `divider` | `ReactNode` | - | Element inserted between each child |
|
|
930
|
+
| `component` | `ElementType` | `'div'` | Root element type |
|
|
931
|
+
| `useFlexGap` | `boolean` | `false` | Use CSS gap instead of margin for spacing |
|
|
932
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
933
|
+
|
|
934
|
+
> **Note**: Stack accepts all Joy UI Stack props.
|
|
920
935
|
|
|
921
936
|
## Troubleshooting
|
|
922
937
|
|
|
923
|
-
###
|
|
938
|
+
### Common Issues
|
|
924
939
|
|
|
925
|
-
1.
|
|
926
|
-
-
|
|
927
|
-
- Fragment
|
|
940
|
+
1. **Spacing is not applied**
|
|
941
|
+
- Make sure the elements are direct children
|
|
942
|
+
- Check whether a Fragment or another wrapper is interfering
|
|
928
943
|
|
|
929
|
-
2.
|
|
930
|
-
-
|
|
931
|
-
- alignItems
|
|
944
|
+
2. **Alignment is different from what you expected**
|
|
945
|
+
- Remember that the main axis and cross axis change based on `direction`
|
|
946
|
+
- Understand the difference between `alignItems` and `justifyContent`
|
|
932
947
|
|
|
933
|
-
3.
|
|
934
|
-
-
|
|
935
|
-
-
|
|
948
|
+
3. **Responsive behavior is not working**
|
|
949
|
+
- Check that object syntax like `{ xs: 'column', md: 'row' }` is correct
|
|
950
|
+
- Verify that the breakpoint values are correct
|
|
936
951
|
|
|
937
|
-
Stack
|
|
952
|
+
Stack is an intuitive and powerful layout tool. Its simple API makes complex layouts easy to build, so it fits a wide range of UI patterns.
|