Skip to content

Will Change

Hint browser about upcoming changes

Syntax

visual="will-change:[value]"

Values

ValueCSS OutputDescription
autowill-change: autoAuto optimization
scrollwill-change: scroll-positionScroll changes
contentswill-change: contentsContent changes
transformwill-change: transformTransform changes
opacitywill-change: opacityOpacity changes

Examples

html
<div visual="will-change:transform">Optimized for animation</div>

Preview

Will Change

visual="will-change:transform" - Optimize for upcoming changes

transform
opacity
View Code
html
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
  <div space="p:small" visual="bg:primary text:white rounded:small">transform</div>
  <div space="p:small" visual="bg:primary text:white rounded:small">opacity</div>
</div>