@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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
Box
|
|
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
8
|
<Box {...args} sx={{
|
|
@@ -48,7 +48,7 @@ function MyComponent() {
|
|
|
48
48
|
|
|
49
49
|
### Basic Usage
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
The most basic way to use Box.
|
|
52
52
|
|
|
53
53
|
```tsx
|
|
54
54
|
<div style={{
|
|
@@ -86,7 +86,7 @@ function MyComponent() {
|
|
|
86
86
|
|
|
87
87
|
### Colors
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
You can apply various background colors.
|
|
90
90
|
|
|
91
91
|
```tsx
|
|
92
92
|
<div style={{
|
|
@@ -138,7 +138,7 @@ function MyComponent() {
|
|
|
138
138
|
|
|
139
139
|
### Spacing
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
You can adjust padding and margin.
|
|
142
142
|
|
|
143
143
|
```tsx
|
|
144
144
|
<div style={{
|
|
@@ -215,7 +215,7 @@ function MyComponent() {
|
|
|
215
215
|
|
|
216
216
|
### Border Radius
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
You can configure different corner radius values.
|
|
219
219
|
|
|
220
220
|
```tsx
|
|
221
221
|
<div style={{
|
|
@@ -299,7 +299,7 @@ function MyComponent() {
|
|
|
299
299
|
|
|
300
300
|
### Shadows
|
|
301
301
|
|
|
302
|
-
|
|
302
|
+
You can add shadow effects.
|
|
303
303
|
|
|
304
304
|
```tsx
|
|
305
305
|
<div style={{
|
|
@@ -390,7 +390,7 @@ function MyComponent() {
|
|
|
390
390
|
|
|
391
391
|
### Flex Layouts
|
|
392
392
|
|
|
393
|
-
|
|
393
|
+
You can easily build layouts using Flexbox.
|
|
394
394
|
|
|
395
395
|
```tsx
|
|
396
396
|
<div style={{
|
|
@@ -499,7 +499,7 @@ Flexbox를 사용한 레이아웃을 쉽게 만들 수 있습니다.
|
|
|
499
499
|
|
|
500
500
|
### Responsive Layout
|
|
501
501
|
|
|
502
|
-
|
|
502
|
+
You can create responsive layouts.
|
|
503
503
|
|
|
504
504
|
```tsx
|
|
505
505
|
<div style={{
|
|
@@ -551,7 +551,7 @@ Flexbox를 사용한 레이아웃을 쉽게 만들 수 있습니다.
|
|
|
551
551
|
|
|
552
552
|
### Polymorphic Components
|
|
553
553
|
|
|
554
|
-
|
|
554
|
+
You can render it as different HTML elements using the `component` prop.
|
|
555
555
|
|
|
556
556
|
```tsx
|
|
557
557
|
<div style={{
|
|
@@ -603,7 +603,7 @@ component prop을 사용하여 다양한 HTML 요소로 렌더링할 수 있습
|
|
|
603
603
|
|
|
604
604
|
### Motion Animations
|
|
605
605
|
|
|
606
|
-
|
|
606
|
+
Animation effects using built-in Framer Motion.
|
|
607
607
|
|
|
608
608
|
```tsx
|
|
609
609
|
<div style={{
|
|
@@ -655,7 +655,7 @@ component prop을 사용하여 다양한 HTML 요소로 렌더링할 수 있습
|
|
|
655
655
|
|
|
656
656
|
### Complex Layouts
|
|
657
657
|
|
|
658
|
-
Box
|
|
658
|
+
You can combine Box components to build complex layouts.
|
|
659
659
|
|
|
660
660
|
```tsx
|
|
661
661
|
<div style={{
|
|
@@ -790,17 +790,16 @@ Box를 조합하여 복잡한 레이아웃을 만들 수 있습니다.
|
|
|
790
790
|
|
|
791
791
|
### SX Prop
|
|
792
792
|
|
|
793
|
-
Box
|
|
793
|
+
The most powerful feature of Box is the `sx` prop. It allows you to apply CSS styles directly as an object.
|
|
794
794
|
|
|
795
795
|
```tsx
|
|
796
796
|
<Box
|
|
797
797
|
sx={{
|
|
798
|
-
p: 2,
|
|
799
|
-
m: { xs: 1, md: 2 },
|
|
800
|
-
bgcolor: 'primary.50',
|
|
801
|
-
borderRadius: 'md',
|
|
802
|
-
'&:hover': {
|
|
803
|
-
// hover 상태
|
|
798
|
+
p: 2, // padding: 16px
|
|
799
|
+
m: { xs: 1, md: 2 }, // responsive margin
|
|
800
|
+
bgcolor: 'primary.50', // theme color
|
|
801
|
+
borderRadius: 'md', // theme border-radius
|
|
802
|
+
'&:hover': { // hover state
|
|
804
803
|
bgcolor: 'primary.100',
|
|
805
804
|
},
|
|
806
805
|
}}
|
|
@@ -811,7 +810,7 @@ Box의 가장 강력한 기능은 `sx` prop입니다. 이를 통해 CSS 스타
|
|
|
811
810
|
|
|
812
811
|
### Responsive Design
|
|
813
812
|
|
|
814
|
-
|
|
813
|
+
You can define styles per breakpoint using object syntax.
|
|
815
814
|
|
|
816
815
|
```tsx
|
|
817
816
|
<Box
|
|
@@ -827,7 +826,7 @@ Box의 가장 강력한 기능은 `sx` prop입니다. 이를 통해 CSS 스타
|
|
|
827
826
|
|
|
828
827
|
### Theme Integration
|
|
829
828
|
|
|
830
|
-
|
|
829
|
+
You can use design system tokens directly.
|
|
831
830
|
|
|
832
831
|
```tsx
|
|
833
832
|
<Box
|
|
@@ -844,7 +843,7 @@ Box의 가장 강력한 기능은 `sx` prop입니다. 이를 통해 CSS 스타
|
|
|
844
843
|
|
|
845
844
|
### Framer Motion
|
|
846
845
|
|
|
847
|
-
|
|
846
|
+
You can use animation props directly.
|
|
848
847
|
|
|
849
848
|
```tsx
|
|
850
849
|
<Box
|
|
@@ -908,7 +907,7 @@ Box의 가장 강력한 기능은 `sx` prop입니다. 이를 통해 CSS 스타
|
|
|
908
907
|
gap: 2,
|
|
909
908
|
}}
|
|
910
909
|
>
|
|
911
|
-
{items.map(
|
|
910
|
+
{items.map(item => (
|
|
912
911
|
<Box key={item.id} sx={{ p: 2, bgcolor: 'background.surface' }}>
|
|
913
912
|
{item.content}
|
|
914
913
|
</Box>
|
|
@@ -948,34 +947,46 @@ Box의 가장 강력한 기능은 `sx` prop입니다. 이를 통해 CSS 스타
|
|
|
948
947
|
</Box>
|
|
949
948
|
```
|
|
950
949
|
|
|
950
|
+
## Props and Customization
|
|
951
|
+
|
|
952
|
+
### Key Props
|
|
953
|
+
|
|
954
|
+
| Prop | Type | Default | Description |
|
|
955
|
+
| ----------- | ------------- | ------- | ---------------------------------- |
|
|
956
|
+
| `children` | `ReactNode` | - | Content inside the box |
|
|
957
|
+
| `component` | `ElementType` | `'div'` | Root element type |
|
|
958
|
+
| `sx` | `SxProps` | - | Custom styles using the MUI system |
|
|
959
|
+
|
|
960
|
+
Box is a general-purpose container that renders as a `<div>` by default. It accepts all standard HTML attributes and Joy UI's `sx` prop for responsive styling.
|
|
961
|
+
|
|
951
962
|
## Best Practices
|
|
952
963
|
|
|
953
|
-
1.
|
|
964
|
+
1. **Use meaningful HTML elements**: Use the `component` prop to choose semantically appropriate HTML elements.
|
|
954
965
|
|
|
955
|
-
2.
|
|
966
|
+
2. **Use theme tokens**: Use theme spacing, color, border-radius, and similar values instead of hardcoded values.
|
|
956
967
|
|
|
957
|
-
3.
|
|
968
|
+
3. **Design responsively**: Use responsive values so the component works well across different screen sizes.
|
|
958
969
|
|
|
959
|
-
4.
|
|
960
|
-
-
|
|
961
|
-
-
|
|
970
|
+
4. **Optimize performance**:
|
|
971
|
+
- Avoid creating inline objects repeatedly, and memoize them when possible
|
|
972
|
+
- Use complex animations only when necessary
|
|
962
973
|
|
|
963
|
-
5.
|
|
964
|
-
-
|
|
965
|
-
-
|
|
966
|
-
-
|
|
974
|
+
5. **Consider accessibility**:
|
|
975
|
+
- Choose appropriate semantic HTML elements
|
|
976
|
+
- Add ARIA attributes when needed
|
|
977
|
+
- Maintain sufficient color contrast
|
|
967
978
|
|
|
968
|
-
6.
|
|
969
|
-
-
|
|
970
|
-
-
|
|
979
|
+
6. **Promote reusability**:
|
|
980
|
+
- Extract frequently used style combinations into separate components
|
|
981
|
+
- Define shared styles in the theme
|
|
971
982
|
|
|
972
|
-
7.
|
|
973
|
-
-
|
|
974
|
-
-
|
|
983
|
+
7. **Maintain consistency**:
|
|
984
|
+
- Use consistent spacing and naming conventions across the team
|
|
985
|
+
- Follow the design system guidelines
|
|
975
986
|
|
|
976
987
|
## Spacing Scale
|
|
977
988
|
|
|
978
|
-
|
|
989
|
+
Spacing values available in Box:
|
|
979
990
|
|
|
980
991
|
- `0.5` = 4px
|
|
981
992
|
- `1` = 8px
|
|
@@ -988,11 +999,11 @@ Box에서 사용할 수 있는 spacing 값들:
|
|
|
988
999
|
|
|
989
1000
|
## Color Tokens
|
|
990
1001
|
|
|
991
|
-
|
|
1002
|
+
Primary color tokens:
|
|
992
1003
|
|
|
993
1004
|
- **Background**: `background.body`, `background.surface`, `background.level1`
|
|
994
1005
|
- **Primary**: `primary.50`, `primary.100`, `primary.500`, `primary.main`
|
|
995
1006
|
- **Neutral**: `neutral.50`, `neutral.100`, `neutral.500`, `neutral.main`
|
|
996
1007
|
- **Text**: `text.primary`, `text.secondary`, `text.tertiary`
|
|
997
1008
|
|
|
998
|
-
Box
|
|
1009
|
+
Box is the foundational component for all layout and styling in ADS. Its powerful `sx` prop and built-in animation support make it flexible enough to satisfy a wide range of UI requirements.
|
|
@@ -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}>
|
|
@@ -57,7 +57,7 @@ function MyComponent() {
|
|
|
57
57
|
|
|
58
58
|
### Basic Usage
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
The basic usage of the 12-column grid system.
|
|
61
61
|
|
|
62
62
|
```tsx
|
|
63
63
|
<div style={{
|
|
@@ -89,7 +89,7 @@ function MyComponent() {
|
|
|
89
89
|
|
|
90
90
|
### Responsive Grid
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
A responsive grid that applies different layouts across different screen sizes.
|
|
93
93
|
|
|
94
94
|
```tsx
|
|
95
95
|
<div>
|
|
@@ -137,7 +137,7 @@ function MyComponent() {
|
|
|
137
137
|
|
|
138
138
|
### Different Spacing
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
Grid layouts with different spacing values.
|
|
141
141
|
|
|
142
142
|
```tsx
|
|
143
143
|
<div style={{
|
|
@@ -201,7 +201,7 @@ function MyComponent() {
|
|
|
201
201
|
|
|
202
202
|
### Nested Grid
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
You can nest one grid inside another.
|
|
205
205
|
|
|
206
206
|
```tsx
|
|
207
207
|
<div>
|
|
@@ -265,7 +265,7 @@ function MyComponent() {
|
|
|
265
265
|
|
|
266
266
|
### Auto Layout
|
|
267
267
|
|
|
268
|
-
|
|
268
|
+
A grid using auto layout.
|
|
269
269
|
|
|
270
270
|
```tsx
|
|
271
271
|
<div style={{
|
|
@@ -309,7 +309,7 @@ function MyComponent() {
|
|
|
309
309
|
|
|
310
310
|
### Complex Layouts
|
|
311
311
|
|
|
312
|
-
|
|
312
|
+
Complex layout examples based on real use cases.
|
|
313
313
|
|
|
314
314
|
```tsx
|
|
315
315
|
<div style={{
|
|
@@ -435,7 +435,7 @@ function MyComponent() {
|
|
|
435
435
|
|
|
436
436
|
### Breakpoint Demo
|
|
437
437
|
|
|
438
|
-
|
|
438
|
+
An example showing how Grid behaves at each breakpoint.
|
|
439
439
|
|
|
440
440
|
```tsx
|
|
441
441
|
<div>
|
|
@@ -491,61 +491,49 @@ function MyComponent() {
|
|
|
491
491
|
|
|
492
492
|
## Grid System
|
|
493
493
|
|
|
494
|
-
### 12
|
|
494
|
+
### 12-Column System
|
|
495
495
|
|
|
496
|
-
Grid
|
|
496
|
+
Grid is based on a 12-column system. Each item can span 1 to 12 columns.
|
|
497
497
|
|
|
498
498
|
```tsx
|
|
499
499
|
<Grid container spacing={2}>
|
|
500
|
-
<Grid item xs={12}>
|
|
501
|
-
|
|
502
|
-
</Grid>
|
|
503
|
-
<Grid item xs={
|
|
504
|
-
|
|
505
|
-
</Grid>
|
|
506
|
-
<Grid item xs={6}>
|
|
507
|
-
절반 너비 (6/12)
|
|
508
|
-
</Grid>
|
|
509
|
-
<Grid item xs={4}>
|
|
510
|
-
3분의 1 너비 (4/12)
|
|
511
|
-
</Grid>
|
|
512
|
-
<Grid item xs={4}>
|
|
513
|
-
3분의 1 너비 (4/12)
|
|
514
|
-
</Grid>
|
|
515
|
-
<Grid item xs={4}>
|
|
516
|
-
3분의 1 너비 (4/12)
|
|
517
|
-
</Grid>
|
|
500
|
+
<Grid item xs={12}>전체 너비 (12/12)</Grid>
|
|
501
|
+
<Grid item xs={6}>절반 너비 (6/12)</Grid>
|
|
502
|
+
<Grid item xs={6}>절반 너비 (6/12)</Grid>
|
|
503
|
+
<Grid item xs={4}>3분의 1 너비 (4/12)</Grid>
|
|
504
|
+
<Grid item xs={4}>3분의 1 너비 (4/12)</Grid>
|
|
505
|
+
<Grid item xs={4}>3분의 1 너비 (4/12)</Grid>
|
|
518
506
|
</Grid>
|
|
519
507
|
```
|
|
520
508
|
|
|
521
509
|
### Container & Item
|
|
522
510
|
|
|
523
|
-
- `container`:
|
|
524
|
-
- `item`:
|
|
525
|
-
-
|
|
511
|
+
- `container`: Used to create a Grid container
|
|
512
|
+
- `item`: Used to create a Grid item
|
|
513
|
+
- A single component can be both a `container` and an `item` at the same time (nested grid)
|
|
526
514
|
|
|
527
515
|
## Breakpoints
|
|
528
516
|
|
|
529
|
-
Grid
|
|
517
|
+
Grid supports the following breakpoints:
|
|
530
518
|
|
|
531
|
-
|
|
|
532
|
-
|
|
|
533
|
-
| `xs`
|
|
534
|
-
| `sm`
|
|
535
|
-
| `md`
|
|
536
|
-
| `lg`
|
|
537
|
-
| `xl`
|
|
519
|
+
| Breakpoint | Size | Description |
|
|
520
|
+
| ---------- | ------- | --------------------------------- |
|
|
521
|
+
| `xs` | 0px+ | Mobile (portrait) |
|
|
522
|
+
| `sm` | 600px+ | Mobile (landscape) / small tablet |
|
|
523
|
+
| `md` | 900px+ | Tablet |
|
|
524
|
+
| `lg` | 1200px+ | Desktop |
|
|
525
|
+
| `xl` | 1536px+ | Large desktop |
|
|
538
526
|
|
|
539
|
-
###
|
|
527
|
+
### Responsive Usage
|
|
540
528
|
|
|
541
529
|
```tsx
|
|
542
530
|
<Grid container spacing={2}>
|
|
543
531
|
<Grid item xs={12} sm={6} md={4} lg={3}>
|
|
544
532
|
{/*
|
|
545
|
-
xs: 100% (12/12) -
|
|
546
|
-
sm: 50% (6/12) -
|
|
547
|
-
md: 33% (4/12) -
|
|
548
|
-
lg: 25% (3/12) -
|
|
533
|
+
xs: 100% (12/12) - full width on mobile
|
|
534
|
+
sm: 50% (6/12) - half width on small screens
|
|
535
|
+
md: 33% (4/12) - one-third width on tablets
|
|
536
|
+
lg: 25% (3/12) - one-quarter width on desktop
|
|
549
537
|
*/}
|
|
550
538
|
반응형 아이템
|
|
551
539
|
</Grid>
|
|
@@ -554,21 +542,21 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
554
542
|
|
|
555
543
|
## Spacing
|
|
556
544
|
|
|
557
|
-
|
|
545
|
+
You can control the spacing between grid items using the `spacing` prop.
|
|
558
546
|
|
|
559
|
-
|
|
|
560
|
-
|
|
|
561
|
-
| `0`
|
|
562
|
-
| `1`
|
|
563
|
-
| `2`
|
|
564
|
-
| `3`
|
|
565
|
-
| `4`
|
|
566
|
-
| `5`
|
|
567
|
-
| `6`
|
|
547
|
+
| Value | Size | Description |
|
|
548
|
+
| ----- | ---- | ----------------------- |
|
|
549
|
+
| `0` | 0px | No spacing |
|
|
550
|
+
| `1` | 8px | Very small spacing |
|
|
551
|
+
| `2` | 16px | Small spacing (default) |
|
|
552
|
+
| `3` | 24px | Medium spacing |
|
|
553
|
+
| `4` | 32px | Large spacing |
|
|
554
|
+
| `5` | 40px | Very large spacing |
|
|
555
|
+
| `6` | 48px | Maximum spacing |
|
|
568
556
|
|
|
569
557
|
## Auto Layout
|
|
570
558
|
|
|
571
|
-
|
|
559
|
+
You can let items size and position automatically without explicitly defining the column count:
|
|
572
560
|
|
|
573
561
|
```tsx
|
|
574
562
|
<Grid container spacing={2}>
|
|
@@ -664,9 +652,7 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
664
652
|
</Grid>
|
|
665
653
|
|
|
666
654
|
<Grid item xs={12}>
|
|
667
|
-
<Button type="submit" fullWidth>
|
|
668
|
-
Submit
|
|
669
|
-
</Button>
|
|
655
|
+
<Button type="submit" fullWidth>Submit</Button>
|
|
670
656
|
</Grid>
|
|
671
657
|
</Grid>
|
|
672
658
|
```
|
|
@@ -680,7 +666,7 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
680
666
|
<Box
|
|
681
667
|
sx={{
|
|
682
668
|
position: 'relative',
|
|
683
|
-
paddingTop: '100%', // 1:1
|
|
669
|
+
paddingTop: '100%', // maintain a 1:1 ratio
|
|
684
670
|
overflow: 'hidden',
|
|
685
671
|
borderRadius: 'sm',
|
|
686
672
|
}}
|
|
@@ -705,38 +691,58 @@ Grid는 다음 브레이크포인트를 지원합니다:
|
|
|
705
691
|
|
|
706
692
|
## Best Practices
|
|
707
693
|
|
|
708
|
-
1.
|
|
694
|
+
1. **Use meaningful structure**: Choose appropriate elements while considering semantic HTML structure when using Grid.
|
|
695
|
+
|
|
696
|
+
2. **Design responsively first**: Start with mobile layouts and scale up to larger screens.
|
|
697
|
+
|
|
698
|
+
3. **Keep spacing consistent**: Use consistent spacing values across the project.
|
|
699
|
+
|
|
700
|
+
4. **Optimize performance**:
|
|
701
|
+
- Avoid unnecessarily deep nesting
|
|
702
|
+
- Consider virtualization when rendering many items
|
|
703
|
+
|
|
704
|
+
5. **Consider accessibility**:
|
|
705
|
+
- Use appropriate semantic tags
|
|
706
|
+
- Arrange content so keyboard navigation remains logical
|
|
709
707
|
|
|
710
|
-
|
|
708
|
+
6. **Prioritize content**: Let the grid adapt to the content instead of forcing content into the grid.
|
|
711
709
|
|
|
712
|
-
|
|
710
|
+
7. **Debug effectively**: Apply background colors to Grid items during development to inspect the layout more easily.
|
|
713
711
|
|
|
714
|
-
|
|
715
|
-
- 불필요하게 깊은 중첩은 피하세요
|
|
716
|
-
- 많은 아이템이 있을 때는 가상화를 고려하세요
|
|
712
|
+
## Props and Customization
|
|
717
713
|
|
|
718
|
-
|
|
719
|
-
- 적절한 시맨틱 태그를 사용하세요
|
|
720
|
-
- 키보드 탐색이 논리적으로 이뤄지도록 배치하세요
|
|
714
|
+
### Key Props
|
|
721
715
|
|
|
722
|
-
|
|
716
|
+
| Prop | Type | Default | Description |
|
|
717
|
+
| ----------- | -------------------------------------------------------- | ------- | ------------------------------------ |
|
|
718
|
+
| `children` | `ReactNode` | - | Grid children (items) |
|
|
719
|
+
| `container` | `boolean` | `false` | Sets the element as a grid container |
|
|
720
|
+
| `xs` | `number \| 'auto' \| boolean` | - | Column span at xs breakpoint |
|
|
721
|
+
| `sm` | `number \| 'auto' \| boolean` | - | Column span at sm breakpoint |
|
|
722
|
+
| `md` | `number \| 'auto' \| boolean` | - | Column span at md breakpoint |
|
|
723
|
+
| `lg` | `number \| 'auto' \| boolean` | - | Column span at lg breakpoint |
|
|
724
|
+
| `xl` | `number \| 'auto' \| boolean` | - | Column span at xl breakpoint |
|
|
725
|
+
| `spacing` | `number \| string` | `0` | Gap between grid items |
|
|
726
|
+
| `direction` | `'row' \| 'row-reverse' \| 'column' \| 'column-reverse'` | `'row'` | Flex direction |
|
|
727
|
+
| `columns` | `number` | `12` | Total number of columns |
|
|
728
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
723
729
|
|
|
724
|
-
|
|
730
|
+
> **Note**: Grid accepts all Joy UI Grid (MUI) props.
|
|
725
731
|
|
|
726
732
|
## Troubleshooting
|
|
727
733
|
|
|
728
|
-
###
|
|
734
|
+
### Common Issues
|
|
729
735
|
|
|
730
|
-
1.
|
|
731
|
-
-
|
|
732
|
-
- container
|
|
736
|
+
1. **Items are positioned differently than expected**
|
|
737
|
+
- Check that the total column count does not exceed 12
|
|
738
|
+
- Make sure the `container` and `item` props are set correctly
|
|
733
739
|
|
|
734
|
-
2.
|
|
735
|
-
-
|
|
736
|
-
-
|
|
740
|
+
2. **Spacing is not applied**
|
|
741
|
+
- Verify that the `spacing` prop is set on the container
|
|
742
|
+
- Verify that child elements are wrapped in Grid items
|
|
737
743
|
|
|
738
|
-
3.
|
|
739
|
-
-
|
|
740
|
-
-
|
|
744
|
+
3. **Responsive behavior is not working**
|
|
745
|
+
- Check that the breakpoint values are correct
|
|
746
|
+
- Make sure the intended total at each breakpoint is 12 or less
|
|
741
747
|
|
|
742
|
-
Grid
|
|
748
|
+
Grid is a powerful tool for building complex layouts. Responsive design and consistent spacing help improve the overall user experience.
|