Animations
SlideIn
Slide an element in from any direction (up, down, left, right).
Quick Preview
Slides in from below
Installation
npm install framer-motion
// Copy fromsrc/components/animations/SlideIn.tsx
Examples
All 4 directions
From right
From left
From top
From bottom
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children* | React.ReactNode | - | Content to animate |
direction | 'up' | 'down' | 'left' | 'right' | 'up' | Slide-in direction |
distance | number | 40 | Distance to slide from (px) |
delay | number | 0 | Delay before animation starts (seconds) |
duration | number | 0.6 | Animation duration (seconds) |
whenInView | boolean | false | Trigger when element enters viewport |
once | boolean | true | Only animate once |
className | string | - | Additional CSS classes |