Skip to main content

Width, height, and constraints

Supported width, height, and constraints utilities.

Quick reference​

SyntaxBehavior
w-N / h-NExplicit dimensions in the four-unit spacing scale.
min-w-N / min-h-N / max-w-N / max-h-NConstraints.
w-full / h-full100% of a finite containing allocation.
w-auto / h-autoIntrinsic sizing.
w-1/2 / w-1/3 / w-2/3 / w-1/4 / w-3/4Supported fractions; h/min/max/basis share the grammar.
max-w-none / max-h-noneClear maximum constraint.
fillFill available bounded space.
aspect-square / aspect-video1:1 / 16:9 aspect ratio.

Example​

<View class="w-24 h-12 min-w-0 max-w-full bg-accent" />

Rules and validation​

Numeric suffixes are 0–999 with optional .5, multiplied by four logical units. Percentage/flex sizing cannot create finite bounds on an unbounded scroll axis. Minimum/maximum constraints apply immediately during motion.

Style lesson · Style index · Themes