viewmotion-svelte
v0.1.0
Published
Svelte adapter for viewmotion — use:motion action for reveal animations
Maintainers
Readme
viewmotion-svelte
Svelte adapter for viewmotion — a minimal reveal animation system for landing pages.
Install
npm install viewmotion viewmotion-svelteSetup
Import the stylesheet once at your app entry point:
import "viewmotion/styles.css";Usage
<script>
import { motion } from "viewmotion-svelte";
</script>
<div use:motion={{ preset: 'fade-up', delay: 100, once: true }}>
Hello
</div>use:motion action
| Field | Type | Default | Description |
| ---------- | --------- | ------- | -------------------------------- |
| preset | string | — | Animation preset name (required) |
| delay | number | 0 | Delay in ms |
| duration | number | 600 | Duration in ms |
| once | boolean | false | Animate only once |
The action supports reactive updates — changing the config object re-applies the animation.
Requirements
- Svelte ≥ 4
- viewmotion ≥ 0.1.0
License
MIT
