Grid

The Grid component helps in building responsive grid systems. It provides a flexible and efficient way to lay out, align, and distribute space among items in a container, even when their sizes are unknown or dynamic.

Usage

Use the Grid components (Row, Col) in combination to create a flexible and responsive grid layout.

Basic Usage

<Row gutter={['4', '4']}>
<Col xs={24} sm={12} md={8}>
<Card>
<Card.Header title={'Item 1'} />
</Card>
</Col>
<Col xs={24} sm={12} md={8}>
<Card>
<Card.Header title={'Item 2'} />
</Card>
</Col>
<Col xs={24} sm={12} md={8}>
<Card>
<Card.Header title={'Item 3'} />
</Card>
</Col>
</Row>

Centering Content

You can center the items in a row by adjusting the justify prop on the Row component.

<Row justify="center">
<Col md={12}>
<Card>
<Card.Header title={'Item 1'} />
</Card>
</Col>
</Row>

API

Props

Row

PropTypeDefaultRequired
classNamestring--
styleCSSProperties--
childrenReactNode--
gutter[number, number][0, 0]-
align 'start' | 'center' | 'end' | 'stretch' | 'baseline''start'-
justify'start' | 'center' | 'end' | 'space-between' | 'around' | 'space-evenly''start'-
MarginPropsToken<MarginProps>--
PaddingPropsToken<PaddingProps>--
LayoutPropsToken<LayoutProps>--

Col

PropTypeDefaultRequired
classNamestring--
styleCSSProperties--
childrenReactNode--
align 'start' | 'center' | 'end' | 'stretch' | 'baseline''start'-
justify'start' | 'center' | 'end' | 'space-between' | 'around' | 'space-evenly''start'-
xsnumber--
smnumber--
mdnumber--
lgnumber--
xlnumber--
xxlnumber--
MarginPropsToken<MarginProps>--
PaddingPropsToken<PaddingProps>--
LayoutPropsToken<LayoutProps>--
Flex
Previous
Layout
Next