Installation
npx logic2b@next add motion-slideUsage
import { MotionSlide } from "@/components/ui/motion-slide"
<MotionSlide direction="up" delay={80}>
<Card>…</Card>
</MotionSlide>
MotionSlide maps direction onto the matching fade-* preset of
Motion (up → fade-up, and so on), so it shares
the same duration, delay, hover and asChild props.
Live playground
Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.
Generated JSX
<MotionSlide
direction="up"
duration={500}
delay={0}
>Slide reveal</MotionSlide>API reference
Generated from the public TypeScript exports in src/ui/motion-slide.tsx.
MotionSlideDirection
Typetype MotionSlideDirection = "up" | "down" | "left" | "right"MotionSlideProps
Typeinterface MotionSlideProps extends Omit<MotionProps, "preset"> { /** Direction the element travels from as it fades in. Default `"up"`. */ direction?: MotionSlideDirection }MotionSlide
ComponentSlide a mounting element in from a direction while it fades.
Props: MotionSlideProps| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
direction | MotionSlideDirection | No | "up" | Direction the element travels from as it fades in. Default `"up"`. |
Accessibility contract
Machine-readable behavior and consumer responsibilities for motion-slide.
- Support
- Composition contract
- Pattern
- slide animation
- Motion for React
Built-in semantics
- Preserves child semantics and accepts reduced-motion behavior from the motion foundation.
Consumer responsibilities
- Use a reduced or instant alternative and do not use position changes to imply a different reading order.
Known limitations
- • Large translations can be uncomfortable unless reduced-motion preferences are honored.