Skip to main content
VelinStyle v1.3.0
⌂ Home

Motion & attributes 1.2.2

Unified scroll animations via core/motion/ and declarative velin-* attributes via core/attributes/. Deutsch: Motion & attributes Leitfaden

Maturity: Documented as stable in VelinStyle 1.2.0. Design Intelligence (plan / review / agent meta) is separate and beta / foundation where noted.

When to use

When not

Motion runtime

import { initMotion, velinMotion } from '@birdapi/velinstyle/motion';

const teardown = initMotion({ root: document });
// Respects prefers-reduced-motion and data-velin-motion="off"

Uses one shared IntersectionObserver, batches updates with requestAnimationFrame, toggles .velin-in-view on elements.

initReveal() in velin-reveal.js now delegates here (backward compatible).

Effects

AttributeBehavior
velin-revealScroll into view (base)
velin-fadeFade in on scroll
velin-slide="up"Slide direction
velin-scaleScale in
velin-parallaxParallax (CSS scroll-timeline where supported)
velin-stagger="60"Stagger list children (ms)
velin-scrollSmooth anchor on href="#id"
velin-hoverHover lift/glow utilities

CSS fallback when animation-timeline: view() is unavailable: see scroll-animation.css .velin-in-view rules.

Attribute boot

import { bootFromDOM } from '@birdapi/velinstyle';

await bootFromDOM(document, { attributes: true });
// Runs bootAttributes() + motion + optional velin-search bindings

Bridge attributes (e.g. velin-modal) set data-velin-component and call lazyDefine() — see full attribute list.

Attribute vs Web Component vs boot: use HTML attributes like velin-reveal / data-velin-reveal-auto when the motion runtime should enhance markup after bootFromDOM(..., { attributes: true }) (or the full components bundle). Use custom elements like <velin-tooltip> when you need the component’s own Shadow DOM API. Attributes alone do nothing without a boot path; WCs register themselves when the components bundle (or a lazy chunk) loads.

Examples

<html data-velin-reveal-auto>
<section velin-reveal velin-fade>…</section>
<ul velin-stagger="80" velin-reveal>
  <li velin-fade>One</li>
  <li velin-fade>Two</li>
</ul>
<a href="#faq" velin-scroll>FAQ</a>

Framework sample: samples/velin-attributes.html in the GitHub repo.

Performance & reduced motion

Tokens: Motion tokens. Chart-specific keyframes: Chart animation.