Flex
Control the layout of flex containers with alignment, justification and more with responsive flexbox utilities.
Flex classes
You can also customize flex utilities to apply based upon various breakpoints.
d-flexd-inline-flexd-sm-flexd-sm-inline-flexd-md-flexd-md-inline-flexd-lg-flexd-lg-inline-flexd-xl-flexd-xl-inline-flex
d-flex
d-inline-flex
Flex direction
By default, d-flex applies flex-direction: row and can generally be omitted. However, there may be situations where you need to explicitly define it.
flex-rowflex-row-reverseflex-columnflex-column-reverseflex-sm-rowflex-sm-row-reverseflex-sm-columnflex-sm-column-reverseflex-md-rowflex-md-row-reverseflex-md-columnflex-md-column-reverseflex-lg-rowflex-lg-row-reverseflex-lg-columnflex-lg-column-reverseflex-xl-rowflex-xl-row-reverseflex-xl-columnflex-xl-column-reverse
Flex row
flex-row and flex-row-reverse
Flex column
flex-column and flex-column-reverse
Flex justify
The justify content flex setting can be changed using the flex justify classes. This by default will modify the flexbox items on the x-axis but is reversed when using flex direction column, modifying the y-axis.
justify-startjustify-endjustify-centerjustify-space-betweenjustify-space-aroundjustify-sm-startjustify-sm-endjustify-sm-centerjustify-sm-space-betweenjustify-sm-space-aroundjustify-md-startjustify-md-endjustify-md-centerjustify-md-space-betweenjustify-md-space-aroundjustify-lg-startjustify-lg-endjustify-lg-centerjustify-lg-space-betweenjustify-lg-space-aroundjustify-xl-startjustify-xl-endjustify-xl-centerjustify-xl-space-betweenjustify-xl-space-around
Justify start
justify-start
Justify center
justify-center
Justify end
justify-end
Justify space between
justify-space-between
Justify space around
justify-space-around
Flex Align
The align-items flex setting can be changed using the flex align classes. This by default will modify the flexbox items on the y-axis but is reversed when using flex direction column, modifying the x-axis.
align-startalign-endalign-centeralign-stretchalign-sm-startalign-sm-endalign-sm-centeralign-sm-stretchalign-md-startalign-md-endalign-md-centeralign-md-stretchalign-lg-startalign-lg-endalign-lg-centeralign-lg-stretchalign-xl-startalign-xl-endalign-xl-centeralign-xl-stretchAlign start
align-start
Align center
align-center
Align end
align-end
Align stretch
align-stretch
Flex align self
The align self flex setting can be changed using the flex align-self classes. This by default will modify the flexbox items on the x-axis but is reversed when using flex direction column, modifying the y-axis.
align-self-startalign-self-endalign-self-centeralign-self-autoalign-self-stretchalign-self-sm-startalign-self-sm-endalign-self-sm-centeralign-self-sm-autoalign-self-sm-stretchalign-self-md-startalign-self-md-endalign-self-md-centeralign-self-md-autoalign-self-md-stretchalign-self-lg-startalign-self-lg-endalign-self-lg-centeralign-self-lg-autoalign-self-lg-stretchalign-self-xl-startalign-self-xl-endalign-self-xl-centeralign-self-xl-autoalign-self-xl-stretchAlign self start
align-self-start
Align self center
align-self-center
Align self end
align-self-end
Align self stretch
align-self-stretch
Align self auto
align-self-auto
Flex wrap
By default .d-flex does not provide any wrapping (behaves similarly to flex-wrap: nowrap). This can be modified by applying flex-wrap helper classes in the format flex(-{breakpoint})-{condition} where condition can be nowrap, wrap, or wrap-reverse.
flex-nowrapflex-wrapflex-wrap-reverseflex-sm-nowrapflex-sm-wrapflex-sm-wrap-reverseflex-md-nowrapflex-md-wrapflex-md-wrap-reverseflex-lg-nowrapflex-lg-wrapflex-lg-wrap-reverseflex-xl-nowrapflex-xl-wrapflex-xl-wrap-reverseFlex nowrap
flex-nowrap
Flex wrap
flex-wrap
Flex wrap reverse
flex-wrap-reverse
Flex order
You can change the visual order of flex items with the order utilities.
order-firstorder-0order-1order-2order-3order-4order-5order-6order-7order-8order-9order-10order-11order-12order-lastorder-sm-firstorder-sm-0order-sm-1order-sm-2order-sm-3order-sm-4order-sm-5order-sm-6order-sm-7order-sm-8order-sm-9order-sm-10order-sm-11order-sm-12order-sm-lastorder-md-firstorder-md-0order-md-1order-md-2order-md-3order-md-4order-md-5order-md-6order-md-7order-md-8order-md-9order-md-10order-md-11order-md-12order-md-lastorder-lg-firstorder-lg-0order-lg-1order-lg-2order-lg-3order-lg-4order-lg-5order-lg-6order-lg-7order-lg-8order-lg-9order-lg-10order-lg-11order-lg-12order-lg-lastorder-lg-firstorder-xl-0order-xl-1order-xl-2order-xl-3order-xl-4order-xl-5order-xl-6order-xl-7order-xl-8order-xl-9order-xl-10order-xl-11order-xl-12order-xl-lastFlex order
order-first
Flex shrink and grou
These can be applied by adding the helper class in the format flex-{condition}-{value}, where condition can be either grow or shrink and value can be either 0 or 1. The condition grow will permit an element to grow to fill available space, whereas shrink will permit an element to shrink down to only the space needs for its contents. However, this will only happen if the element must shrink to fit their container such as a container resize or being effected by a flex-grow-1. The value 0 will prevent the condition from occurring whereas 1 will permit the condition.
flex-grow-0flex-grow-1flex-shrink-0flex-shrink-1flex-sm-grow-0flex-sm-grow-1flex-sm-shrink-0flex-sm-shrink-1flex-md-grow-0flex-md-grow-1flex-md-shrink-0flex-md-shrink-1flex-lg-grow-0flex-lg-grow-1flex-lg-shrink-0flex-lg-shrink-1flex-xl-grow-0flex-xl-grow-1flex-xl-shrink-0flex-xl-shrink-1Spacer
spacer