Officina UI
Components

MotionPreset

Wraps content in a named enter/exit animation preset like fadeIn or slideInRight.

MotionPreset is a thin Framer Motion wrapper that applies a named enter/animate/exit transition so you don't hand-write variants. Choose a preset (fadeIn default, fadeInUp, scaleIn, or slideInRight) and optionally set duration in seconds. It forwards motion.div props, so combine it with AnimatePresence for mount/unmount transitions. It respects reduced motion via the app-level MotionConfig reducedMotion="user".

Example

Preview
Motion preset wrapper
import { MotionPreset } from '@officina/ui';

<MotionPreset preset="fadeInUp" duration={0.3}>
  <Card>Revealed on mount</Card>
</MotionPreset>;

API

PropTypeDefaultDescription
durationnumber0.25Animation duration in seconds. Defaults to 0.25.
presetenumfadeInNamed animation preset (fadeIn, slideUp, …). Defaults to "fadeIn".

On this page