Skip to content

flex-basis

Utilities for controlling the initial main-axis size of a flex item before growing or shrinking.

Flexbox & GridTailwind v4 Spec
ISS preview
Iced + ISS preview demonstrating flex-basis
ISS preview for flex-basis
use iss::{flex_tw, box_tw, tw};
let split = flex_tw([
box_tw(nav, tw!("basis-64 shrink-0 bg-zinc-900 p-4")),
box_tw(main, tw!("flex-1 p-4")),
], tw!("w-full flex-row"));
Tailwind Class CSS Property / Effect iss::typed Builder
basis-<n> flex-basis: calc(var(--spacing) * <n>); .basis(64)
basis-1/2 / basis-1/3 / basis-2/3 flex-basis: 50% / 33.333% / 66.667%; .basis_frac(1, 2)
basis-full / basis-auto flex-basis: 100% / auto; .basis_full() / .basis_auto()
basis-3xs .. basis-7xl Container scale widths; .basis_sm()
basis-[240px] flex-basis: 240px; .basis_px(240)
  • Use inside flex_tw; resolves along the active main axis (width in flex-row, height in flex-col).

flex · flex-grow · flex-shrink · width