
Security News
Packagist Urges Immediate Composer Update After GitHub Actions Token Leak
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.
animated-svelte
Advanced tools
A motion-like CSS animation library for Svelte 5, providing declarative animations with a simple and intuitive API. This all happens using the in and out directives provided by Svelte.
[!WARNING] This strictly an internal package for now and not intended for public use eventually I may get around the making this public.
pnpm add animated-svelte
pnpm add animated-svelte
[!WARNING] The rest of this documentation was written by AI and my not be completely accurate.
<script>
import { animated } from 'animated-svelte';
</script>
<animated.div
initial={{ opacity: 0, scale: 0 }}
animate={{ opacity: 1, scale: 1 }}
transition={{ duration: 300 }}
>
Hello, animated-svelte!
</animated.div>
animated.div and animated.spanAnimated versions of standard HTML elements with motion capabilities.
| Prop | Type | Description |
|---|---|---|
initial | Partial<AnimationConfig> | false | Initial animation state (before entering) |
animate | Partial<AnimationConfig> | Target animation state |
exit | Partial<AnimationConfig> | Exit animation state (when leaving) |
transition | Partial<TransitionConfig> | Transition configuration |
ref | HTMLElement | null | Reference to the DOM element |
The AnimationConfig type supports the following properties:
opacity - number (0-1)scale - numberrotate - number (degrees)x - number \| string (px or percentage)y - number \| string (px or percentage)width - number \| string (px or percentage)height - number \| string (px or percentage)filter - string (CSS filter value)type TransitionConfig = {
duration: number | `${number}s` | `${number}ms`; // Default: 0
timingFunction: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out'; // Default: 'ease-out'
delay: number | `${number}s` | `${number}ms`; // Default: 0
};
<animated.div animate={{ rotate: 90 }} transition={{ duration: 0.5, timingFunction: 'ease-out' }}>
Rotating element
</animated.div>
<script>
import { animated } from 'animated-svelte';
let isVisible = $state(false);
</script>
<button onclick={() => (isVisible = !isVisible)}> Toggle </button>
{#if isVisible}
<animated.div
initial={{ opacity: 0, scale: 0 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0 }}
transition={{ duration: 0.2 }}
>
Fade in and scale up
</animated.div>
{/if}
<animated.div initial={{ x: 0 }} animate={{ x: 100 }} transition={{ duration: 0.5 }}>
Moving element
</animated.div>
{#each Array.from({ length: 5 }) as _, i (i)}
<animated.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{
duration: 0.3,
delay: i * 0.1
}}
>
Item {i + 1}
</animated.div>
{/each}
<animated.div
initial={{ width: 50, height: 50 }}
animate={{ width: 100, height: 100 }}
transition={{ duration: 0.5 }}
>
Resizing element
</animated.div>
<animated.div
initial={{ rotate: 90, opacity: 0, scale: 0 }}
animate={{ rotate: 0, opacity: 1, scale: 1 }}
transition={{ duration: 0.5, timingFunction: 'ease-out' }}
>
Multiple properties animated together
</animated.div>
useAnimation HookFor custom components or more control, you can use the useAnimation hook directly:
<script>
import { useAnimation } from 'animated-svelte';
let elementRef = $state(null);
const { enter, exit } = useAnimation({
ref: () => elementRef,
initial: () => ({ opacity: 0 }),
animate: () => ({ opacity: 1 }),
exit: () => ({ opacity: 0 }),
transition: () => ({ duration: 0.3 })
});
</script>
<div bind:this={elementRef} in:enter out:exit>Custom animated element</div>
FAQs
A motion-like CSS animation library for Svelte.
We found that animated-svelte demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.

Research
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.

Company News
Socket was named to the Rising in Cyber 2026 list, recognizing 30 private cybersecurity startups selected by CISOs and security executives.