Grid (그리드)
Grid는 페이지의 일관성과 논리 구조를 효과적으로 지켜 주고, 팀 단위 협업에서 디자인의 통일성을 강화해 줘요. 화면을 칸으로 나눠 배치하는 레이아웃의 기본 도구입니다.
출처: 문서
본문
API
Row
| 속성 |
설명 |
타입 |
기본값 |
버전 |
| div |
true로 설정하면 <Row>와 <Col>이 그리드 관련 클래스와 스타일 없이 div로 취급돼요 |
boolean |
- |
- |
| align |
세로 정렬. css의 align-items와 같아요 |
'start' | 'center' | 'end' | 'stretch' |
start |
- |
| justify |
가로 정렬. css의 justify-content와 같아요 |
'start' | 'center' | 'end' | 'space-around' | 'space-between' |
start |
- |
| className |
추가 css 클래스 |
string | string[] |
- |
- |
| gutter |
그리드 사이 간격. 숫자 하나나 { xs: 8, sm: 16, md: 24} 같은 객체로 지정할 수 있어요. 배열을 쓰면 가로 간격과 세로 간격을 동시에 설정할 수도 있습니다 [가로, 세로] |
GridRowGutter | Array<GridRowGutter> |
0 |
vertical gutter in 2.5.0 |
| style |
추가 스타일 |
CSSProperties |
- |
- |
Col
| 속성 |
설명 |
타입 |
기본값 |
버전 |
| offset |
Col을 왼쪽에서 밀어낼 칸 수 |
number |
- |
- |
| order |
래스터 순서 |
number |
- |
- |
| pull |
래스터 순서 |
number |
- |
2.20.0 |
| push |
래스터 순서 |
number |
- |
2.20.0 |
| span |
차지할 래스터 칸 수 |
number |
24 |
- |
| className |
추가 css 클래스 |
string | string[] |
- |
- |
| flex |
flex 레이아웃 속성을 설정해요 |
FlexType |
- |
2.26.0 |
| lg |
screen >= 992px |
number | { [key: string]: any } |
- |
- |
| md |
screen >= 768px |
number | { [key: string]: any } |
- |
- |
| sm |
screen >= 576px |
number | { [key: string]: any } |
- |
- |
| style |
추가 스타일 |
CSSProperties |
- |
- |
| xl |
screen >= 1200px |
number | { [key: string]: any } |
- |
- |
| xs |
screen < 576px |
number | { [key: string]: any } |
- |
- |
| xxl |
screen >= 1600px |
number | { [key: string]: any } |
- |
- |
| xxxl |
screen >= 2000px |
number | { [key: string]: any } |
- |
2.40.0 |
Grid
| 속성 |
설명 |
타입 |
기본값 |
| collapsed |
접힌 상태로 둘지 여부 |
boolean |
false |
| collapsedRows |
접혔을 때 표시할 행 수 |
number |
1 |
| className |
추가 css 클래스 |
string | string[] |
- |
| colGap |
열과 열 사이의 간격 |
number | ResponsiveValue |
0 |
| cols |
한 행에 표시할 열 수 |
number | ResponsiveValue |
24 |
| rowGap |
행과 행 사이의 간격 |
number | ResponsiveValue |
0 |
| style |
추가 스타일 |
CSSProperties |
- |
GridItem
| 속성 |
설명 |
타입 |
기본값 |
| suffix |
접미사(suffix) 요소인지 여부 |
boolean |
false |
| className |
추가 css 클래스 |
string | string[] |
- |
| offset |
왼쪽에 둘 그리드 수 |
number | ResponsiveValue |
0 |
| span |
차지하는 그리드 수 |
number | ResponsiveValue |
1 |
| style |
추가 스타일 |
CSSProperties |
- |
ResponsiveValue
| 속성 |
설명 |
타입 |
기본값 |
| lg |
>= 992px 반응형 설정 |
number |
- |
| md |
>= 768px 반응형 설정 |
number |
- |
| sm |
>= 576px 반응형 설정 |
number |
- |
| xl |
>= 1200px 반응형 설정 |
number |
- |
| xs |
< 576px 반응형 설정 |
number |
- |
| xxl |
>= 1600px 반응형 설정 |
number |
- |
| xxxl |
screen >= 2000px |
number |
- |
GridRowGutter
export type GridRowGutter =
| number
| Partial<Record<GridResponsiveBreakpoint, number>>;
FlexType
export type FlexType = string | number | "auto" | "none";
더 알아보기
Grid 컴포넌트의 더 자세한 내용은 Arco Design 공식 문서에서 확인해 보세요.