This component uses multiple nested components to achieve this type of interactivity. It's also optimized for mobile with a mobile variant.
It's super easy to create such an animation in Framer. Just create multiple variants and connect them with interactions - Framer does the rest.
You can also customize the component through the properties found on the right panel.