Browse documentation

Reference / Interactivity

Will change

Hint that a particular property or scroll position is likely to change soon.

Working example

Use this hint selectively after measuring an expensive transition. A state variant can limit the time the browser spends preparing a layer.

HTML
<details class="group border p-3">
  <summary class="cursor-pointer">Inspect the seal</summary>
  <span class="mt-3 inline-block bg-black px-3 py-1 text-white motion-safe:group-hover:will-change-transform motion-safe:group-open:animate-pop">Approved</span>
</details>

Class reference

ClassCSS declarations
will-change-autowill-change: auto;
will-change-transformwill-change: transform;
will-change-scroll-positionwill-change: scroll-position;
will-change-contentswill-change: contents;
will-change-[opacity]will-change: opacity;
View full generated CSS
Compiled CSS
.will-change-\[opacity\] {
  will-change: opacity;
}
.will-change-auto {
  will-change: auto;
}
.will-change-contents {
  will-change: contents;
}
.will-change-scroll-position {
  will-change: scroll-position;
}
.will-change-transform {
  will-change: transform;
}