# Flipping Square

> A square that flips in 3D on both axes. A tiny, eye-catching loader.

- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: 3d, flip, square, loading, perspective
- Live preview: https://copy-css.com/snippets/square-flip-loader
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="flip-loader" role="status" aria-label="Loading"></div>
```

## CSS

```css
.flip-loader {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #ec4899;
  animation: square-flip 1.2s ease-in-out infinite;
}

@keyframes square-flip {
  0% { transform: perspective(120px) rotateX(0) rotateY(0); }
  50% { transform: perspective(120px) rotateX(-180deg) rotateY(0); }
  100% { transform: perspective(120px) rotateX(-180deg) rotateY(-180deg); }
}

@media (prefers-reduced-motion: reduce) {
  .flip-loader {
    animation-duration: 2.4s;
  }
}
```

## Notes

- This CSS Flipping Square is 19 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, 3D transforms, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
