SolutionsPackagesComponentsCLI — Coming soonResourcesDocumentationStorybookChangelogBlogAboutSign up freeGet early access

Documentation

Lit

Scope motion to a Lit host with MotionController from @ds-gn/motion/lit, including viewport triggers and cleanup on disconnect.

MotionController from @ds-gn/motion/lit scopes motion to a Lit host: selectors resolve against the host’s render root, and every animation and observer is cleaned up when the host disconnects.

import { LitElement, html } from 'lit';
import { MotionController } from '@ds-gn/motion/lit';

class FeatureGrid extends LitElement {
  motion = new MotionController(this);

  firstUpdated() {
    this.motion.inViewSequence('.card', { preset: 'slideUp', stagger: 40 });
  }

  render() {
    return html`<div class="card">…</div>
      <div class="card">…</div>`;
  }
}
MethodDescription
timeline(steps)As timeline, cancelled on disconnect
sequence(targets, options)As sequence, cancelled on disconnect
enter(el, preset)As enter
exit(el, preset)As exit
inView(el, callback, options)As inView, while the host is connected
inViewTimeline(steps, options)Play a timeline when trigger (default: the host) enters the view
inViewSequence(targets, options)Play a sequence when trigger (default: the host) enters the view

steps and targets may be functions, evaluated when the trigger fires, for elements that only exist after the host renders. A trigger that has not fired yet re-arms if the host is moved in the DOM.

© 2026 LightLeap Labs LLC. All rights reserved. · Terms of Service · Privacy Policy · Cookies · Contact · Support