Back to buttons

Live preview

Preview settings

Changes appear as you type. Use Tab to test keyboard focus.

⌘ / Ctrl + S saves locally

3d Rotate Right Button

HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.

By @0xabdulkhalid

Remix button

Button submission checks

Checks will appear after the preview updates.

Buttons only: no full pages, forms, cards or navigation. Put scripts in the JavaScript tab. Tailwind uses utilities from HTML and JavaScript; use complete class names. Custom CSS supports plain CSS, without @apply, imports or plugins.

Accessibility quick check

Waiting for the rendered preview…

Try Tab, Enter and Space in the preview. Check the focus ring, hover and disabled states, then enable Reduce motion. These checks are guidance, not an accessibility certification.

Explore freely here. Remix to publish your version with credit to the creator.

About 3d Rotate Right Button

3d Rotate Right Button is an animated CSS button by @0xabdulkhalid. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Hover effects, 3D
Using this example
Copy the HTML or download index.html, style.css and app.js. Test keyboard focus, motion and contrast in your own project.

Usage, Tailwind and licensing questions

Read the source files

HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>3d Rotate Right Button</title>
    <link rel="stylesheet" href="./style.css">
  </head>
  <body>
	<button class="btn">Button</button>
  </body>
</html>

CSS


body {
	min-height: 100vh;
	display: grid;
	place-items: center;
	background: #222;
}
.btn,
.btn *,
.btn :after,
.btn :before,
.btn:after,
.btn:before {
  border: 0 solid;
  box-sizing: border-box;
}
.btn {
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: button;
  background-color: #000;
  background-image: none;
  color: #fff;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif,
    Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
  font-size: 100%;
  line-height: 1.5;
  margin: 0;
  -webkit-mask-image: -webkit-radial-gradient(#000, #fff);
  padding: 0;
}
.btn:disabled {
  cursor: default;
}
.btn:-moz-focusring {
  outline: auto;
}
.btn svg {
  display: block;
  vertical-align: middle;
}
.btn [hidden] {
  display: none;
}
.btn {
  background: #fff;
  box-sizing: border-box;
  color: #000;
  display: block;
  font-weight: 900;
  -webkit-mask-image: none;
  padding: 1.2rem 3rem;
  perspective: 800px;
  position: relative;
  text-transform: uppercase;
  transform: rotateY(12deg);
  transform-style: preserve-3d;
  transition: transform 0.2s;
}
.btn:before {
  background: #eee;
  content: "";
  display: block;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  transform: rotateY(90deg);
  transform-origin: 0 0;
  width: 20%;
}
.btn:hover {
  transform: rotateY(20deg);
}