Skip to main content
The Flex component extends Box with display: flex by default, making it easy to create flexbox layouts.

Import

Usage

Props

Flex accepts all Box props with display: flex applied by default.
React.ElementType
Render as a different HTML element. Defaults to 'div'.
ThemeUIStyleObject
Theme-aware styles. The display: flex is automatically applied, but can be overridden.
string
Apply a variant style from the theme.

Spacing Props

Flex inherits all spacing props from Box (m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py).

Color Props

Flex inherits all color props from Box (color, bg, backgroundColor, opacity).

Examples

Horizontal Layout

Centered Content

Column Layout

Space Between

Responsive Direction