Skip to content

Boston343/motion-on-scroll

Repository files navigation

Motion On Scroll (MOS)

NPM version NPM downloads License Twitter Follow

Looking for the main package? Go to motion-on-scroll.

Effortless, AOS-compatible scroll animations powered by Motion.

Framework-agnostic, MOS lets you add scroll-triggered animations with nothing but data-mos attributes. Under the hood it uses Motion’s powerful animate API, giving you:

  • 27 preset effects out of the box
  • Support for custom keyframes, easings, and fully bespoke timelines
  • AOS-compatible features for painless migration
  • First-class TypeScript types

📚 Full docs → motion-on-scroll.pages.dev


Quick start

npm i motion-on-scroll
<!-- Styles -->
<link href="https://cdn.jsdelivr.net/npm/motion-on-scroll@latest/dist/mos.css" rel="stylesheet" />

<!-- Script & init -->
<script type="module">
  import { MOS } from "motion-on-scroll";
  MOS.init();
</script>

<!-- Element to animate -->
<div data-mos="fade-up">Hello world</div>

Migrating from AOS? Check the guide → https://motion-on-scroll.pages.dev/getting-started/migrate-from-aos


Basic usage

All you have to do is to add data-mos attribute to html element, like so:

<div data-mos="animation_name"></div>

Script will trigger "animation_name" animation on this element, if you scroll to it.

About

Effortless, AOS-compatible scroll animations powered by the Motion library.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •