Skip to main content

translate, scale, rotate, and origin

Change painted geometry without changing its allocated layout size.

Quick reference​

SyntaxBehavior
translate-x-N / translate-y-NPhysical axes; four-unit spacing scale, default 0.
translate-inline-NLogical inline axis; follows direction.
-translate-x-N / -translate-y-N / -translate-inline-NNegative translations.
translate-x-full / translate-y-full / translate-inline-fullOwn measured dimension; negative forms supported.
scale-N / scale-x-N / scale-y-N0–200 percent; default 100.
rotate-N / -rotate-NDegrees; -360–360; default 0.
origin-center / top / bottom / left / rightPivot, using origin- prefix; default center.

Example​

<View class="w-12 h-12 bg-accent transition-transform origin-left rotate-45" />

Rules and validation​

Translation uses the supported spacing grammar; scale/rotation use bounded numeric suffixes. Rotation follows the numeric path, not shortest-angle wrapping. Full-size translation retargets when measured size changes. Transforms do not change layout allocation or minimum accessible touch targets. Hit testing follows presentation. Use transition-transform to animate target changes.

Transform lessons · All reference