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}.
| Class | Value |
|---|---|
.origin-top | top |
.origin-right | right |
.origin-bottom | bottom |
.origin-left | left |
.origin-top-right | top right |
.origin-top-left | top left |
.origin-bottom-right | bottom right |
.origin-bottom-left | bottom left |
.origin-center | center |
Rotate
Rotate elements with .rotate-{deg}. Add -reverse for negative rotation. Axis-specific variants use .rotate-{x|y|z}-{deg}.
Preview
0°
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>
| Class | Angle |
|---|---|
.rotate-0 | 0deg |
.rotate-45 | 45deg |
.rotate-90 | 90deg |
.rotate-180 | 180deg |
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>
| Class | Scale factor |
|---|---|
.scale-30 | 0.3 |
.scale-50 | 0.5 |
.scale-70 | 0.7 |
.scale-100 | 1.0 |
.scale-120 | 1.2 |
.scale-150 | 1.5 |
.scale-200 | 2.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>
| Class | Angle |
|---|---|
.skew-0 | 0deg |
.skew-1 | 1deg |
.skew-2 | 2deg |
.skew-3 | 3deg |
.skew-4 | 4deg |
.skew-5 | 5deg |
.skew-6 | 6deg |
Translate
Move elements with directional presets or percentage-based values.
Directional presets
| Class | Description |
|---|---|
.translate-top | Position above parent with shadow |
.translate-right | Position to the right of parent |
.translate-bottom | Position below parent |
.translate-left | Position to the left of parent |
.translate-middle | Center both axes (top:50% left:50% translate:-50%,-50%) |
.translate-middle-x | Center horizontally |
.translate-middle-y | Center 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>
| Value | Percentage |
|---|---|
| 0 | 0 |
| 25 | 25% |
| 50 | 50% |
| 75 | 75% |
| 100 | 100% |
| -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>
| Class | Property |
|---|---|
.transition-all | transition-property: all |
.transition-background | transition-property: background |
.transition-color | transition-property: color |
.transition-height | transition-property: height |
.transition-width | transition-property: width |
.transition-transform | transition-property: transform |
.transition-none | transition-property: none |
Duration
| Class | Duration |
|---|---|
.transition-100 | 100ms |
.transition-200 | 200ms |
.transition-300 | 300ms |
.transition-400 | 400ms |
.transition-500 | 500ms |
Timing function
| Class | Function |
|---|---|
.ease-in | ease-in |
.ease-out | ease-out |
.ease-in-out | ease-in-out |
.linear | linear |
.step-start | step-start |
.step-end | step-end |
Pseudo-state support. All transform and transition utilities supporthover:,focus:, andactive:prefixes - combine them for interactive effects likehover:rotate-45orhover:scale-110.