Dev Helpers
← Back

Ease a transition with a custom curve

Ease a transition with a custom curve with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo {
    transition: translate 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .demo:hover {
    translate: 0.5rem 0;
  }
</style>
<button class="demo" type="button">Try this button</button>