Skip to content
WingoUI
ComponentsTemplatesDocsPricingAI agentsBlogChangelogContact
Components
Buttons & Actions
ButtonButton GroupCopy ButtonDelete ButtonTheme ToggleToggleToggle Group
Inputs
Avatar UploadCalendarCheckboxColor PickerComboboxCountry SelectCron PickerCurrency InputDate PickerDate Range PickerDate Time PickerDuration PickerEmail InputEmoji PickerFile UploadFilter BuilderInputInput GroupListboxMasked InputMention InputMonth PickerMulti SelectNumber InputOTP InputPassword InputPhone InputRadio GroupRatingSearch InputSegmented ControlSelectSignature PadSliderSwitchTag InputTextareaTime PickerTimezone SelectTree Select
Forms
Address InputBooking WidgetCSV ImportFieldForm WizardInline EditInvoice line itemsRich Text EditorSchema Builder
Navigation
Back To TopBounce SidebarBreadcrumbCommand MenuGlobal SearchGooey NavHook SidebarNav MenuNav TabsPaginationProximity SidebarScroll ProgressSidebarStepsTable Of ContentsTabsTopbarUser MenuWorkspace Switcher
Overlays
Alert DialogContext MenuDialogDrawerDropdown MenuFamily DrawerHover CardPopoverShare DialogSheetShortcuts DialogTooltipTour
Feedback
AlertBannerCookie ConsentEmoji ReactionEmpty StateNotification BellNotification CenterProgressRoute ProgressSetup ChecklistSkeletonSpinnerToast
Data Display
Approval FlowAvatarBadgeCalendar ViewCode BlockComment ThreadContact cardCountdownDescription ListDiff ViewerFile ListFile managerFolderGanttJSON ViewerKbdLog ViewerMarkdownPresenceSchedulerTagTimelineTree View
Tables & Lists
Audit LogData TableDeal PipelineEditable GridKanbanListMembers tablePermissions MatrixTableTask ListVirtual List
Charts & Stats
Animated CounterArea chartBar chartDonut chartFunnel chartGaugeGitHub ActivityHeatmap calendarLeaderboardLine chartRadar chartRadial barSparklineStat CardTrackerTrend badge
Layout
AccordionApp ShellCardCollapsibleDetail LayoutEntity HeaderPage HeaderScroll AreaSeparatorSettings LayoutSplit ViewToolbar
Media
Audio PlayerCarouselCSV ViewerDOCX EditorDOCX ViewerExcel ViewerFile SystemImage compareImage CropperImage GalleryImage LightboxLocation MapPDF ViewerPowerPoint ViewerQR CodeStep PlayerVideo Player
AI Kit
Agent Status CardChat MessageChat ThreadChat WidgetConversation ListFluid OrbGrid RevealMatrix OrbModel PickerPrompt InputReasoning IndicatorRule BuilderSuggestion ChipsTool Call TimelineUsage MeterVoice InputWorkflow Canvas
Text & Effects
Background PatternGravity LettersMarqueeTerminalText AnimateText Rotate
Mobile
Action SheetBottom Tab BarFABHaptic ButtonHero HeaderInstall PromptLarge Title HeaderNotification BannerOnboarding CarouselPicker WheelPull To RefreshSlide To ConfirmSticky CTA BarSwipe DeckSwipeable Tabs
Commerce
Cart drawerCategory pickerCheckout stepsCoupon inputFavorite buttonFilter panelListing cardListing gridOrder trackerPricePrice rangePricing tableProduct galleryQuantity stepperReviewsSeller card
Marketing Sections
App Download SectionBlog Cards SectionCTA SectionFAQ SectionFeature GridFeature ShowcaseHero SectionIntegrations SectionLogo CloudMarketing FooterMarketing HeaderMarketing SectionNewsletter SectionPricing SectionStats SectionSteps SectionTeam SectionTestimonials SectionTimeline SectionVideo Section
Blocks
Admin Dashboard PageAdmin ShellAI Chat PageAPI Keys PageAutomation Builder PageCheckout PageCRM Contact PageCRM Pipeline PageError PagesInbox PageInvoice PageKPI DashboardListing Detail PageLogin PageMarketplace Home PageMarketplace Search PageMarketplace ShellMobile App HomeOnboarding FlowOrder History PagePost Listing WizardPricing PageProfile PageRegister PageSettings PageUsers Admin Page
Templates
About PageAcademy PageAccessibility PageAffiliate PageAgency PageAI Product PageAppointment Booking PageBlog PageBlog Post PageBug Bounty PageCareers PageChangelog PageCommunity PageCompare PageContact PageCustomer Story PageCustomers PageDemo Booking PageDevelopers PageDocs Home PageDownload PageEnterprise PageEvents PageExperts PageFAQ PageFeature PageGlossary PageHelp Article PageHelp Center PageHome Services PageImpact PageIntegration Detail PageIntegrations PageJob Detail PageLanding PageLaunch PageLegal PageManifesto PagePortfolio PagePress PageProduct Tour PagePromo PageReal Estate PageReferral PageResearch Report PageRestaurant PageRoadmap PageROI Calculator PageSecurity PageSolutions PageStartups PageStatus PageStorefront PageSwitch PageTemplate Gallery PageTravel PageWaitlist PageYear in Review Page
Hooks & Utilities
AI ChatChart kitCommerceDate utilsFile exportFile typesFiltersForm validationHapticsInvoicingMotion presetsNavigationNumber formatRelative timeRomanian locationsSpreadsheetText matchTonesUIProvideruseClipboarduseConsentuseControllableStateuseCooldownuseDebounceuseKeyboardInsetuseLocaleuseLongPressuseMediaControlsuseMediaQueryuseOverflowItemsusePersistedStateuseScrollEdgesuseScrollStateuseSelectionuseShortcutuseStickToBottom
GalleryTheme

Hooks & Utilities

Motion presets

Hooks & Utilities

Motion presets TypeScript helper for React

InvoicingNavigation
Live props
Options
spring
stagger0.04s
  1. Home
  2. Components
  3. Hooks & Utilities
  4. Motion presets
Free

Motion presets TypeScript helper for React

v1.0.0·Added in 1.0.0

The shared springs, enter and exit presets, stagger helpers and reduced-motion hooks every animated component uses.

Four balls run the four springs side by side, so you can feel the difference. Pick a spring and a stagger step, then replay the list to see them drive real content. Everything turns into a short fade when the system asks for reduced motion.

Motion presets is a free React helper in the React hooks and utilities category, written in TypeScript for React 19. It installs as source with npx wingo-ui@latest add motion, together with useMediaQuery and the npm package motion.

Add to a project

Requirements: React 19, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup

npx wingo-ui@latest add motion

Usage

Import springs from @/lib/motion.

import { AnimatePresence, motion } from "motion/react"
import { press, springs, useMotionPreset, useMotionTransition } from "@/lib/motion"

export function SaveMenu({ open, saved }: { open: boolean; saved: boolean }) {
  const popover = useMotionPreset("popover")
  const layout = useMotionTransition(springs.smooth)

  return (
    <motion.div layout transition={{ layout }} className="flex items-center gap-2">
      <motion.button {...press}>{saved ? "Saved" : "Save"}</motion.button>
      <AnimatePresence>
        {open && <motion.div {...popover} className="rounded-2xl bg-popover p-4 shadow-floating" />}
      </AnimatePresence>
    </motion.div>
  )
}

API

  • springdefault "smooth"
    "snappy" | "smooth" | "bouncy" | "gentle"

    springs[name]: snappy (500 / 32) answers a finger, smooth (300 / 30) is the default for overlays and layout, bouncy (400 / 18) is for playful accents, gentle (120 / 20) for large surfaces.

  • staggerdefault 0.04
    number

    staggerChildren(step, delay?): seconds between siblings. 0.03 to 0.05 feels quick; above 0.08 reads as slow.

Parts

  • presets

    constant

    initial / animate / exit / transition bundles to spread onto a motion element inside AnimatePresence. collapse animates height to auto for accordions and collapsibles, the one sanctioned height animation. Type: Record<"overlay" | "popover" | "tooltip" | "dialog" | "sheet" | "fade" | "listItem" | "toast" | "collapse", MotionPreset>.

  • sheetFrom

    function

    The sheet preset for any edge. Signature: (side: "top" | "right" | "bottom" | "left") => MotionPreset.

  • press

    constant

    The shared press feedback: scale 0.97 on a snappy spring. Type: { whileTap, transition }.

  • gestures

    constant

    Shared thresholds for drags, swipes and long presses, matched to vaul: a drag completes past a quarter of the surface or on a 400px/s flick. longPress is in ms, slop in px. Type: { completeFraction: 0.25, completeVelocity: 400, elastic: 0.2, longPress: 450, slop: 8 }.

  • shouldComplete

    function

    Whether a drag should complete (dismiss, commit a swipe action) or spring back. Pass the offset and velocity along the drag axis, positive toward completion. Signature: (offset: number, velocity: number, size: number) => boolean.

  • rubberband

    function

    iOS-style resistance past an edge: maps how far the finger is past a limit to how far the surface moves. Signature: (overflow: number, dimension: number, constant?: number) => number.

  • easings

    constant

    Tween curves and durations in seconds, matching the --motion-* CSS tokens. Type: { out, inOut, sheet }.

  • durations

    constant

    Tween curves and durations in seconds, matching the --motion-* CSS tokens. Type: { fast: 0.15, normal: 0.24, slow: 0.4 }.

  • staggerItem

    constant

    Child variants for staggerChildren, and a capped per-index delay for items that animate on their own. Type: Variants.

  • staggerDelay

    function

    Child variants for staggerChildren, and a capped per-index delay for items that animate on their own. Signature: (index: number, step?: number, max?: number) => number.

  • usePrefersReducedMotion

    hook

    The reduced-motion preference, false on the server and during hydration so markup matches. Signature: () => boolean.

  • useMotionPreset

    hook

    A preset that turns into a short opacity fade under reduced motion. reducePreset(preset, reduced) is the same without the hook. Signature: (preset: PresetName | MotionPreset) => MotionPreset.

  • useMotionTransition

    hook

    The transition you pass, or an instant one under reduced motion. For layout animations and indicators. Signature: (transition?: Transition) => Transition.

Examples

Cart rows

useMotionPreset("listItem") with layout: new rows slide in, removed rows leave and the rest close the gap.

Dependencies

motionuse-media-query

Files

  • lib/motion.ts

FAQ

Is the Motion presets helper free?

Yes. The source is free and needs no account: copy it from the Code tab or install it with the CLI.

How do I install Motion presets?

Run npx wingo-ui@latest add motion. It also adds the Wingo UI item it builds on (useMediaQuery) and the npm package motion. With shadcn, run npx shadcn@latest add https://wingo-ui.com/r/motion.json.

See also

useMediaQueryhookButtonuseControllableStatehook

Used in

QR CodeBadgeGaugeCarouselAvatar UploadPowerPoint ViewerHero HeaderColor PickerBottom Tab BarOnboarding FlowProduct galleryCalendar

and 284 more.

More React hooks and utilities

NavigationlibNumber formatlibRelative timelibRomanian locationslibSpreadsheetlibText matchlib
All 36 React hooks and utilities

Articles using this component

  • Framer Motion Spring Presets: Stiffness and Damping

    Component guides · Oct 13, 2026 · 9 min read

  • Prefers Reduced Motion React: Calm Motion, No Mismatch

    Next.js and Tailwind CSS · Oct 13, 2026 · 8 min read

PreviousInvoicingNext Navigation

Springs

Same distance, four feels

snappy

500 / 32

smooth

300 / 30

bouncy

400 / 18

gentle

120 / 20

Stagger

staggerChildren(0.04)

  • Payment received$1,240.00 from Emma Carternow
  • New order #48213 items, Brooklyn, NY2m
  • Review postedFast delivery, great packaging8m
  • Stock running lowEspresso beans, 4 left1h