Currently, I am working on developing an animated spinner using SVG as a loader. After browsing online, I came across examples that utilize Styled Components for this purpose; however, it seems that approach is no longer supported.
Do any of you have alternative suggestions or solutions for achieving this animation effect? I attempted to incorporate the '@keyframes spin' property into my SX code, as shown below:
<Box
sx={{
animation: '$test 1s linear infinite',
'@keyframes spin': {
from: {
transform: 'rotate(0dg)'
},
to: {
transform: 'rotate(360dg)'
}
}
}}
>
Despite my efforts, I was unable to create a successful animation using the SX property in MUI v5, following a similar logic to Styled Components.
I am curious if there is a way to achieve this animation effect without relying on CSS files and classes...