Skip to main content

Flex

Utilities for controlling how flex items both grow and shrink.

CSS Property:flex
Classes:4

Flex Classes

ClassCSS
flex-1flex: 1 1 0%;
flex-autoflex: 1 1 auto;
flex-initialflex: 0 1 auto;
flex-noneflex: none;

Arbitrary Values

You can use arbitrary values with square bracket notation when you need a specific value not included in the default scale.

flex-[2_2_0%]flex-[1_1_100px]

Responsive Variants

Apply flex utilities at specific breakpoints using responsive prefixes.

BreakpointPrefixExample
640px+sm:sm:flex-1
768px+md:md:flex-1
1024px+lg:lg:flex-1
1280px+xl:xl:flex-1
1536px+2xl:2xl:flex-1