TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/davesnx/styled-ppx/llms.txt
Use this file to discover all available pages before exploring further.
%keyframe / [%keyframe] extension lets you define CSS keyframe animations inline with your component styles. It parses the keyframe body at compile time, generates a unique hashed animation name, and returns an opaque value you can interpolate directly into animation-name or the animation shorthand.
Basic usage
Define percentage steps inside the extension string, then interpolate the result into a styled component using$(...):
Notes
- Outer braces are optional. Both
%keyframe("{ 0% { ... } 100% { ... } }")and%keyframe("0% { ... } 100% { ... }")are equivalent — the enclosing{ }around the whole block may be omitted. - The return type is opaque. The value returned by
%keyframehas an opaque type whose internal representation is astring. You cannot pattern-match on it or concatenate it manually; use$(...)interpolation inside a CSS string to reference it. - The name is a hash. The animation name inserted into the generated CSS is a short hash derived from the keyframe content — the same mechanism used for generated class names in
%cxand%styled.*.