Home/Utilities/Transforms

Transforms

Transform utilities for rotate, scale, skew, translate, transform-origin, and CSS transitions - all with pseudo-state variant support.

Transform origin

Set the origin point for transforms with .origin-{position}.

ClassValue
.origin-toptop
.origin-rightright
.origin-bottombottom
.origin-leftleft
.origin-top-righttop right
.origin-top-lefttop left
.origin-bottom-rightbottom right
.origin-bottom-leftbottom left
.origin-centercenter

Rotate

Rotate elements with .rotate-{deg}. Add -reverse for negative rotation. Axis-specific variants use .rotate-{x|y|z}-{deg}.

Preview

45°
90°
180°
<div class="rotate-45">Rotated 45°</div>
<div class="rotate-90">Rotated 90°</div>
<div class="rotate-45-reverse">Rotated -45°</div>

<!-- Axis-specific -->
<div class="rotate-x-45">X-axis 45°</div>
<div class="rotate-y-90">Y-axis 90°</div>
ClassAngle
.rotate-00deg
.rotate-4545deg
.rotate-9090deg
.rotate-180180deg

Scale

Scale elements with .scale-{value}. Axis-specific variants: .scale-x-{value}, .scale-y-{value}, .scale-z-{value}.

<div class="scale-50">50% size</div>
<div class="scale-100">Normal size</div>
<div class="scale-150">150% size</div>
<div class="hover:scale-110">Scale on hover</div>
ClassScale factor
.scale-300.3
.scale-500.5
.scale-700.7
.scale-1001.0
.scale-1201.2
.scale-1501.5
.scale-2002.0

Skew

Skew elements with .skew-{deg}. Axis-specific: .skew-x-{deg}, .skew-y-{deg}.

<div class="skew-3">Skewed 3°</div>
<div class="skew-x-6">X-axis skew 6°</div>
ClassAngle
.skew-00deg
.skew-11deg
.skew-22deg
.skew-33deg
.skew-44deg
.skew-55deg
.skew-66deg

Translate

Move elements with directional presets or percentage-based values.

Directional presets

ClassDescription
.translate-topPosition above parent with shadow
.translate-rightPosition to the right of parent
.translate-bottomPosition below parent
.translate-leftPosition to the left of parent
.translate-middleCenter both axes (top:50% left:50% translate:-50%,-50%)
.translate-middle-xCenter horizontally
.translate-middle-yCenter vertically

Percentage values

<div class="translate-x-25">Move right 25%</div>
<div class="translate-y-50">Move down 50%</div>
<div class="translate-x--50">Move left 50%</div>
ValuePercentage
00
2525%
5050%
7575%
100100%
-25-25%
-50-50%
-75-75%
-100-100%

Transitions

Control CSS transition properties, durations, and timing functions with utility classes.

Transition property

<div class="transition-all transition-300 ease-in-out hover:scale-110">
  Smooth scale on hover
</div>
ClassProperty
.transition-alltransition-property: all
.transition-backgroundtransition-property: background
.transition-colortransition-property: color
.transition-heighttransition-property: height
.transition-widthtransition-property: width
.transition-transformtransition-property: transform
.transition-nonetransition-property: none

Duration

ClassDuration
.transition-100100ms
.transition-200200ms
.transition-300300ms
.transition-400400ms
.transition-500500ms

Timing function

ClassFunction
.ease-inease-in
.ease-outease-out
.ease-in-outease-in-out
.linearlinear
.step-startstep-start
.step-endstep-end
Pseudo-state support. All transform and transition utilities support hover:, focus:, and active: prefixes - combine them for interactive effects like hover:rotate-45 or hover:scale-110.