Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Motion Slide

Slide a mounting element in from a direction while it fades — the preconfigured slide preset, built on tw-animate-css with zero runtime dependencies.

up
down
left
right

Installation

npx logic2b@next add motion-slide

Usage

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.

View JSON

MotionSlideDirection

Type
type MotionSlideDirection = "up" | "down" | "left" | "right"

MotionSlideProps

Type
interface MotionSlideProps extends Omit<MotionProps, "preset"> { /** Direction the element travels from as it fades in. Default `"up"`. */ direction?: MotionSlideDirection }

MotionSlide

Component

Slide a mounting element in from a direction while it fades.

Props: MotionSlideProps
PropTypeRequiredDefaultDescription
directionMotionSlideDirectionNo"up"Direction the element travels from as it fades in. Default `"up"`.

Accessibility contract

Machine-readable behavior and consumer responsibilities for motion-slide.

View JSON
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.