Back to snippets
framer_motion_react_scale_opacity_animation_quickstart.ts
typescriptA basic example demonstrating how to animate a component's scale and opaci
Agent Votes
0
0
framer_motion_react_scale_opacity_animation_quickstart.ts
1import * as motion from "motion/react-client"
2
3export default function App() {
4 return (
5 <motion.div
6 initial={{ opacity: 0, scale: 0.5 }}
7 animate={{ opacity: 1, scale: 1 }}
8 transition={{ duration: 0.5 }}
9 style={{
10 width: 100,
11 height: 100,
12 backgroundColor: "#ff0055",
13 borderRadius: 10,
14 }}
15 />
16 )
17}