PatternFly

Flex

Examples

Basic

Display flex
Display inline flex

Direction

Flex row

Flex item 1
Flex item 2
Flex item 3

Flex row-reverse

Flex item 1
Flex item 2
Flex item 3

Flex column

Flex item 1
Flex item 2
Flex item 3

Flex column-reverse

Flex item 1
Flex item 2
Flex item 3

Justified content

Justify content flex-start

Flex item 1
Flex item 2
Flex item 3

Justify content flex-end

Flex item 1
Flex item 2
Flex item 3

Justify content center

Flex item 1
Flex item 2
Flex item 3

Justify content space-around

Flex item 1
Flex item 2
Flex item 3

Justify content space-between

Flex item 1
Flex item 2
Flex item 3

Aligned items

Align items flex-start

Flex item 1
Flex item 2
Flex item 3

Align items flex-end

Flex item 1
Flex item 2
Flex item 3

Align items center

Flex item 1
Flex item 2
Flex item 3

Align items baseline

Flex item 1
Flex item 2
Flex item 3

Align items stretch

Flex item 1
Flex item 2
Flex item 3

Aligned self

flex-start
center
flex end
baseline
stretch

Aligned content

Align content flex-start

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5

Align content flex-end

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5

Align content center

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5

Align content space-around

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5

Align content space-between

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5

Align content stretch

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5

Shrink

Flex shrink 0
Flex shrink 1

Grow

Flex grow 0
Flex grow 1

Basis and none

Flex basis 0
Flex basis auto
Flex basis none
Flex 1

Fill

Flex none
Flex fill

Wrap

Flex wrap

Flex item 1
Flex item 2
Flex item 3

Flex no wrap

Flex item 1
Flex item 2
Flex item 3

Flex wrap reverse

Flex item 1
Flex item 2
Flex item 3

Documentation

Overview

For these utilities to have effect, the parent element must be set to display: flex or display: inline-flex. Breakpoint is optional. Breakpoints: base (no breakpoint value), -on-sm, -on-md, -on-lg, and -on-xl. Example .pf-v5-u-flex-row-on-lg

Usage

Class
Applied to
Outcome
.pf-v5-u-flex-direction-row{-on-[breakpoint]}
*
Sets flex-direction: row
.pf-v5-u-flex-direction-row-reverse{-on-[breakpoint]}
*
Sets flex-direction: row-reverse
.pf-v5-u-flex-direction-column{-on-[breakpoint]}
*
Sets flex-direction: column
.pf-v5-u-flex-direction-column-reverse{-on-[breakpoint]}
*
Sets flex-direction: column-reverse
.pf-v5-u-justify-content-flex-start{-on-[breakpoint]}
*
Sets justify-content: flex-start
.pf-v5-u-justify-content-flex-end{-on-[breakpoint]}
*
Sets justify-content: flex-end
.pf-v5-u-justify-content-center{-on-[breakpoint]}
*
Sets justify-content: center
.pf-v5-u-justify-content-space-around{-on-[breakpoint]}
*
Sets justify-content: space-around
.pf-v5-u-justify-content-space-between{-on-[breakpoint]}
*
Sets justify-content: space-between
.pf-v5-u-align-items-flex-start{-on-[breakpoint]}
*
Sets align-items: flex-start
.pf-v5-u-align-items-flex-end{-on-[breakpoint]}
*
Sets align-items: flex-start
.pf-v5-u-align-items-center{-on-[breakpoint]}
*
Sets align-items: center
.pf-v5-u-align-items-baseline{-on-[breakpoint]}
*
Sets align-items: baseline
.pf-v5-u-align-items-stretch{-on-[breakpoint]}
*
Sets align-items: stretch
.pf-v5-u-align-self-flex-start{-on-[breakpoint]}
*
Sets align-self: flex-start
.pf-v5-u-align-self-flex-end{-on-[breakpoint]}
*
Sets align-self: flex-end
.pf-v5-u-align-self-center{-on-[breakpoint]}
*
Sets align-self: center
.pf-v5-u-align-self-baseline{-on-[breakpoint]}
*
Sets align-self: baseline
.pf-v5-u-align-self-stretch{-on-[breakpoint]}
*
Sets align-self: stretch
.pf-v5-u-align-content-flex-start{-on-[breakpoint]}
*
Sets align-content: flex-start
.pf-v5-u-align-content-flex-end{-on-[breakpoint]}
*
Sets align-content: flex-end
.pf-v5-u-align-content-center{-on-[breakpoint]}
*
Sets align-content: center
.pf-v5-u-align-content-space-between{-on-[breakpoint]}
*
Sets align-content: space-between
.pf-v5-u-align-content-space-around{-on-[breakpoint]}
*
Sets align-content: space-around
.pf-v5-u-align-content-stretch{-on-[breakpoint]}
*
Sets align-content: stretch
.pf-v5-u-flex-shrink{1 or 0}{-on-[breakpoint]}
*
Sets flex-shrink to 1 or 0
.pf-v5-u-flex-grow{1 or 0}{-on-[breakpoint]}
*
Sets flex-grow to 1 or 0
.pf-v5-u-flex-basis{0 or auto}{-on-[breakpoint]}
*
Sets flex-basis to 0 auto
.pf-v5-u-flex-fill{-on-[breakpoint]}
*
Sets flex to 1 1 auto
.pf-v5-u-flex-wrap{-on-[breakpoint]}
*
sets flex-wrap: wrap
.pf-v5-u-flex-nowrap{-on-[breakpoint]}
*
sets flex-wrap: nowrap
.pf-v5-u-flex-wrap-reverse{-on-[breakpoint]}
*
sets flex-wrap: wrap-reverse

View source on GitHub