Layout
Options for structuring your pages with Bootstrap, including global styles, required scaffolding, grid system, and more.
Options for structuring your pages with Bootstrap, including global styles, required scaffolding, grid system, and more.
<Col xs={12} md={8} />;
<Col xs={6} md={4} />
<Col xs={6} md={4} />
<Col xs={6} md={4} />
<Col xs={6} xsOffset={6} />
<Col md={6} mdPush={6} />
<Col md={6} mdPull={6} />
<Grid> <Row className="show-grid"> <Col xs={12} md={8}> <code>{'<Col xs={12} md={8} />'};</code> </Col> <Col xs={6} md={4}> <code>{'<Col xs={6} md={4} />'}</code> </Col> </Row> <Row className="show-grid"> <Col xs={6} md={4}> <code>{'<Col xs={6} md={4} />'}</code> </Col> <Col xs={6} md={4}> <code>{'<Col xs={6} md={4} />'}</code> </Col> <Col xsHidden md={4}> <code>{'<Col xsHidden md={4} />'}</code> </Col> </Row> <Row className="show-grid"> <Col xs={6} xsOffset={6}> <code>{'<Col xs={6} xsOffset={6} />'}</code> </Col> </Row> <Row className="show-grid"> <Col md={6} mdPush={6}> <code>{'<Col md={6} mdPush={6} />'}</code> </Col> <Col md={6} mdPull={6}> <code>{'<Col md={6} mdPull={6} />'}</code> </Col> </Row> </Grid>;
Below, the columns won't clear correctly in viewport sm
(768px ≤ width < 992px).
< Col sm={6} md={3} />
< Col sm={6} md={3} />
< Col sm={6} md={3} />
< Col sm={6} md={3} />
const dummySentences = [ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.', 'Donec hendrerit tempor tellus.', 'Donec pretium posuere tellus.', 'Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.', 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', 'Nulla posuere.', 'Donec vitae dolor.', 'Nullam tristique diam non turpis.', 'Cras placerat accumsan nulla.', 'Nullam rutrum.', 'Nam vestibulum accumsan nisl.' ]; const gridInstance = ( <Grid> <Row className="show-grid"> <Col sm={6} md={3}> <code> < {'Col sm={6} md={3}'} /> </code> <br /> {dummySentences.slice(0, 6).join(' ')} </Col> <Col sm={6} md={3}> <code> < {'Col sm={6} md={3}'} /> </code> <br /> {dummySentences.slice(0, 4).join(' ')} </Col> <Col sm={6} md={3}> <code> < {'Col sm={6} md={3}'} /> </code> <br /> {dummySentences.slice(0, 6).join(' ')} </Col> <Col sm={6} md={3}> <code> < {'Col sm={6} md={3}'} /> </code> <br /> {dummySentences.slice(0, 2).join(' ')} </Col> </Row> </Grid> ); render(gridInstance);
Introduce Clearfix
, set to visible for the viewports with issue, so that columns clear correctly.
< Col sm={6} md={3} />
< Col sm={6} md={3} />
< Clearfix visibleSmBlock />
< Col sm={6} md={3} />
< Col sm={6} md={3} />
const dummySentences = [ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.', 'Donec hendrerit tempor tellus.', 'Donec pretium posuere tellus.', 'Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.', 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', 'Nulla posuere.', 'Donec vitae dolor.', 'Nullam tristique diam non turpis.', 'Cras placerat accumsan nulla.', 'Nullam rutrum.', 'Nam vestibulum accumsan nisl.' ]; const gridInstance = ( <Grid> <Row className="show-grid"> <Col sm={6} md={3}> <code> < {'Col sm={6} md={3}'} /> </code> <br /> {dummySentences.slice(0, 6).join(' ')} </Col> <Col sm={6} md={3}> <code> < {'Col sm={6} md={3}'} /> </code> <br /> {dummySentences.slice(0, 4).join(' ')} </Col> <Clearfix visibleSmBlock> <code> < {'Clearfix visibleSmBlock'} /> </code> </Clearfix> <Col sm={6} md={3}> <code> < {'Col sm={6} md={3}'} /> </code> <br /> {dummySentences.slice(0, 6).join(' ')} </Col> <Col sm={6} md={3}> <code> < {'Col sm={6} md={3}'} /> </code> <br /> {dummySentences.slice(0, 2).join(' ')} </Col> </Row> </Grid> ); render(gridInstance);
Name | Type | Default | Description |
---|---|---|---|
fluid | boolean | false | Turn any fixed-width grid layout into a full-width layout by this property. Adds |
componentClass | elementType | 'div' | You can use a custom element for this component |
bsClass | string | 'container' | Base CSS class and prefix for the component. Generally one should only change |
Name | Type | Default | Description |
---|---|---|---|
componentClass | elementType | 'div' | You can use a custom element type for this component. |
bsClass | string | 'row' | Base CSS class and prefix for the component. Generally one should only change |
Name | Type | Default | Description |
---|---|---|---|
componentClass | elementType | 'div' | You can use a custom element type for this component. |
xs | number | The number of columns you wish to span for Extra small devices Phones (<768px) class-prefix | |
sm | number | The number of columns you wish to span for Small devices Tablets (≥768px) class-prefix | |
md | number | The number of columns you wish to span for Medium devices Desktops (≥992px) class-prefix | |
lg | number | The number of columns you wish to span for Large devices Desktops (≥1200px) class-prefix | |
xsHidden | boolean | Hide column on Extra small devices Phones adds class | |
smHidden | boolean | Hide column on Small devices Tablets adds class | |
mdHidden | boolean | Hide column on Medium devices Desktops adds class | |
lgHidden | boolean | Hide column on Large devices Desktops adds class | |
xsOffset | number | Move columns to the right for Extra small devices Phones class-prefix | |
smOffset | number | Move columns to the right for Small devices Tablets class-prefix | |
mdOffset | number | Move columns to the right for Medium devices Desktops class-prefix | |
lgOffset | number | Move columns to the right for Large devices Desktops class-prefix | |
xsPush | number | Change the order of grid columns to the right for Extra small devices Phones class-prefix | |
smPush | number | Change the order of grid columns to the right for Small devices Tablets class-prefix | |
mdPush | number | Change the order of grid columns to the right for Medium devices Desktops class-prefix | |
lgPush | number | Change the order of grid columns to the right for Large devices Desktops class-prefix | |
xsPull | number | Change the order of grid columns to the left for Extra small devices Phones class-prefix | |
smPull | number | Change the order of grid columns to the left for Small devices Tablets class-prefix | |
mdPull | number | Change the order of grid columns to the left for Medium devices Desktops class-prefix | |
lgPull | number | Change the order of grid columns to the left for Large devices Desktops class-prefix | |
bsClass | string | 'col' | Base CSS class and prefix for the component. Generally one should only change |
Name | Type | Default | Description |
---|---|---|---|
componentClass | elementType | 'div' | You can use a custom element type for this component. |
visibleXsBlock | boolean | Apply clearfix on Extra small devices Phones adds class | |
visibleSmBlock | boolean | Apply clearfix on Small devices Tablets adds class | |
visibleMdBlock | boolean | Apply clearfix on Medium devices Desktops adds class | |
visibleLgBlock | boolean | Apply clearfix on Large devices Desktops adds class | |
bsClass | string | 'clearfix' | Base CSS class and prefix for the component. Generally one should only change |