Pular para o conteúdo

Flexbox

Gerencie rapidamente o leiaute, o alinhamento e o dimensionamento de colunas de grade, navegação, componentes e muito mais com um conjunto completo de utilitários flexbox responsivos.

Se você é novo ou não está familiarizado com o flexbox, nós recomendamos você a ler este guia do Flexbox CSS-Tricks.

Propriedades para o pai

display

I'm a flexbox container that uses flex!
I'm a flexbox container that uses inline-flex!
<Box sx={{ display: 'flex' }}><Box sx={{ display: 'flex' }}><Box sx={{ display: 'inline-flex' }}>

flex-direction

For more information please see flex-direction on MDN.

Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
<Box sx={{ flexDirection: 'row' }}><Box sx={{ flexDirection: 'row-reverse' }}><Box flexDirection="row"><Box flexDirection="row"><Box sx={{ flexDirection: 'row' }}><Box flexDirection="row"><Box flexDirection="row"><Box sx={{ flexDirection: 'row-reverse' }}><Box flexDirection="row"><Box flexDirection="row"><Box sx={{ flexDirection: 'row-reverse' }}><Box flexDirection="row"><Box flexDirection="row"><Box sx={{ flexDirection: 'row-reverse' }}><Box flexDirection="row"><Box flexDirection="row"><Box sx={{ flexDirection: 'row-reverse' }}><Box flexDirection="row"><Box flexDirection="row"><Box sx={{ flexDirection: 'column' }}><Box flexDirection="row"><Box flexDirection="row"><Box sx={{ flexDirection: 'column-reverse' }}><Box sx={{ flexDirection: 'column-reverse' }}>

flex-wrap

For more information please see flex-wrap on MDN.

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
<Box sx={{ flexWrap: 'nowrap' }}><Box sx={{ flexWrap: 'nowrap' }}><Box sx={{ flexWrap: 'nowrap' }}><Box flexWrap="nowrap"><Box flexWrap="nowrap"><Box sx={{ flexWrap: 'wrap' }}><Box sx={{ flexWrap: 'nowrap' }}><Box sx={{ flexWrap: 'nowrap' }}><Box flexWrap="nowrap"><Box flexWrap="nowrap"><Box sx={{ flexWrap: 'wrap' }}><Box sx={{ flexWrap: 'nowrap' }}><Box flexWrap="nowrap"><Box flexWrap="nowrap"><Box sx={{ flexWrap: 'wrap' }}><Box flexWrap="nowrap"><Box flexWrap="nowrap"><Box sx={{ flexWrap: 'wrap-reverse' }}><Box sx={{ flexWrap: 'wrap-reverse' }}>

justify-content

For more information please see justify-content on MDN.

Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
<Box sx={{ justifyContent: 'flex-start' }}><Box sx={{ justifyContent: 'flex-end' }}><Box sx={{ display: 'flex' }}><Box justifyContent="flex-end"><Box justifyContent="center"><Box justifyContent="flex-end"><Box justifyContent="center"><Box sx={{ display: 'inline-flex' }}><Box justifyContent="flex-end"><Box justifyContent="center"><Box justifyContent="flex-end"><Box justifyContent="center"><Box sx={{ justifyContent: 'space-between' }}><Box sx={{ justifyContent: 'space-around' }}><Box sx={{ justifyContent: 'space-evenly' }}>

align-items

For more information please see align-items on MDN.

Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
Item 1
Item 2
Item 3
<Box sx={{ alignItems: 'flex-start' }}><Box sx={{ alignItems: 'flex-end' }}><Box sx={{ alignItems: 'center' }}><Box sx={{ alignItems: 'stretch' }}><Box sx={{ alignItems: 'baseline' }}><Box sx={{ alignItems: 'flex-end' }}><Box sx={{ alignItems: 'center' }}><Box sx={{ alignItems: 'stretch' }}><Box sx={{ alignItems: 'baseline' }}>

align-content

For more information please see align-content on MDN.

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
<Box sx={{ alignContent: 'flex-start' }}><Box alignContent="flex-end"><Box alignContent="flex-end"><Box sx={{ alignContent: 'flex-end' }}><Box sx={{ alignContent: 'flex-end' }}><Box sx={{ alignContent: 'flex-end' }}><Box sx={{ alignContent: 'flex-end' }}><Box sx={{ alignContent: 'center' }}><Box alignContent="flex-end"><Box alignContent="flex-end"><Box sx={{ alignContent: 'space-between' }}><Box alignContent="flex-end"><Box alignContent="flex-end"><Box sx={{ alignContent: 'space-around' }}><Box alignContent="flex-end"><Box alignContent="flex-end"><Box sx={{ alignContent: 'stretch' }}><Box alignContent="flex-end"><Box alignContent="flex-end"><Box sx={{ alignContent: 'flex-end' }}><Box sx={{ alignContent: 'center' }}><Box sx={{ alignContent: 'space-between' }}><Box sx={{ alignContent: 'space-around' }}><Box sx={{ alignContent: 'stretch' }}>

Propriedades para os Filhos

order

For more information please see order on MDN.

Item 1
Item 2
Item 3
<Box sx={{ order: 2 }}>Item 1</Box>
<Box sx={{ order: 3 }}>Item 2</Box>
<Box sx={{ order: 1 }}>Item 3</Box>

flex-grow

For more information please see flex-grow on MDN.

Item 1
Item 2
Item 3
<Box sx={{ flexGrow: 1 }}>Item 1</Box>
<Box>Item 2</Box>
<Box>Item 3</Box>

flex-shrink

For more information please see flex-shrink on MDN.

Item 1
Item 2
Item 3
<Box sx={{ width: '100%' }}>Item 1</Box>
<Box sx={{ flexShrink: 1 }}>Item 2</Box>
<Box sx={{ flexShrink: 0 }}>Item 3</Box>

align-self

For more information please see align-self on MDN.

Item 1
Item 2
Item 3
<Box>Item 1</Box>
<Box sx={{ alignSelf: 'flex-end' }}>Item 2</Box>
<Box>Item 3</Box>

API

import { flexbox } from '@material-ui/system';
Nome da importação Propriedade Propriedade CSS Chave do tema
flexDirection flexDirection flex-direction none
flexWrap flexWrap flex-wrap none
justifyContent justifyContent justify-content none
alignItems alignItems align-items none
alignContent alignContent align-content none
order order order none
flex flex flex none
flexGrow flexGrow flex-grow none
flexShrink flexShrink flex-shrink none
alignSelf alignSelf align-self none