Skip to main content

Overview

flex-basis is the size a flex item starts from on the main axis before flex-grow and flex-shrink adjust it. Use basis-* classes on children inside a .flex or .inline-flex parent when you want explicit starting widths (or heights in a column) instead of relying only on content or width utilities.

Keywords and reset

Fractional basis

These mirror the fractional width scale (Width) but apply as flex-basis on flex items.

Fractional basis preview

Example

Responsive variants

Each basis-* utility ships with structural breakpoint suffixes:
  • .basis-auto--on-xs.basis-full--on-xxl
  • .basis-0--on-*, .basis-px--on-*
  • .basis-1-2--on-* through .basis-3-4--on-*
See Breakpoints for the --on-* map.

Best Practices

  • Add .flex (or .inline-flex) on the parent first; basis-* applies to items, not the container.
  • Pair .basis-0 with .flex-grow when you want equal columns that ignore intrinsic content width.
  • Prefer basis-* when the value should participate in the flex algorithm; use width-* when you need width regardless of flex context.
  • Combine basis-* with flex-shrink when some lanes should collapse before others in tight viewports.

Flex

Block and inline flex containers

Flex Grow

Absorb leftover space along the main axis