Transforms

Tailwind CSS rotate-180 Class

The rotate-180 utility class generates the following CSS when applied to an element.

CSS Output

CSS
.rotate-180 {
  transform: rotate(180deg);
}

Variants

Use these variant prefixes to apply rotate-180 conditionally:

responsive:rotate-180hover:rotate-180focus:rotate-180active:rotate-180group-hover:rotate-180

Use It

HTML
<button class="flex items-center gap-2">
  Accordion
  <svg class="w-4 h-4 rotate-180 transition-transform">...</svg>
</button>

Understanding rotate-180

The Tailwind CSS rotate-180 utility applies transform: rotate(180deg); to an element when added to its class attribute. It rotates the element 180 degrees (flips upside down). Used for accordion chevrons, expand/collapse indicators, and flip animations.

This utility is part of Tailwind's Transforms module, designed for applying geometric transformations like scale, rotate, translate, and skew to elements. In Tailwind's utility-first workflow, you add rotate-180 directly to your HTML elements rather than writing custom CSS. This approach accelerates development and keeps styles co-located with your markup, making it easy to see exactly how each element is styled at a glance.

Common responsive variants include sm:rotate-180, md:rotate-180, lg:rotate-180, and xl:rotate-180, allowing different behavior at each breakpoint. State variants like hover:rotate-180 and focus:rotate-180 enable interactive styling without any JavaScript. You can also combine multiple variants for fine-grained control over when the utility applies.

This class works well alongside `rotate-0`, `rotate-90`, `rotate-45`, `transition-transform` to build complete, production-ready interfaces. Tailwind's tree-shaking ensures only utilities you actually use appear in your final CSS bundle, keeping file sizes minimal. Browser support for the underlying CSS is excellent across Chrome, Firefox, Safari, and Edge.

Related Classes

Explore More Tailwind Classes

Browse our complete reference of 321 Tailwind CSS utility classes with CSS output, variants, and examples.