npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vanilla-tilt-svelte

v1.0.4

Published

A Svelte plugin that implements Vanilla Tilt JS Library features with Svelte/SvelteKit.

Readme

📦 Vanilla Tilt for Svelte

MIT License Linkedin Discord Contributors Forks

GitHub license GitHub issues GitHub stars


✱ Table of Contents 📖


🎤 Introduction

Vanilla Tilt Svelte is a Svelte plugin that allows you to easily incorporate the interactive tilt effect from the Vanilla Tilt JS library into your Svelte applications. With this plugin, you can add a subtle and engaging tilt effect to any element on your page, enhancing the user experience and adding a touch of interactivity.

The plugin is built upon the popular Vanilla Tilt JS library, which provides a simple and lightweight solution for adding tilt effects to elements. By integrating Vanilla Tilt JS with Svelte, Vanilla Tilt Svelte makes it effortless to utilize the library's features within your Svelte or SvelteKit projects.


⚒️ Installation

To install Vanilla Tilt Svelte, you can use your preferred package manager. Here are a few examples:

NPM

npm install vanilla-tilt-svelte

Yarn

yarn add vanilla-tilt-svelte

🤚 Usage

To use Vanilla Tilt Svelte, follow these steps:

  1. Import the svelteTilt function from the vanilla-tilt-svelte package in your Svelte component.
<script>
   import svelteTilt from 'vanilla-tilt-svelte';
</script>
  1. Apply the svelteTilt function as a Svelte directive to the element you want to apply the tilt effect to, passing the desired options as an object.
<div use:svelteTilt={{
   // Options object
}} />

⚙️ Options

The svelteTilt function accepts an options object that allows you to customize the behavior and appearance of the tilt effect. Here are the available options:

  • reverse (boolean): Reverse the tilt direction.
  • max (number): Maximum tilt rotation in degrees.
  • startX (number): Starting tilt on the X-axis in degrees.
  • startY (number): Starting tilt on the Y-axis in degrees.
  • perspective (number): Transform perspective; lower values create a more extreme tilt effect.
  • scale (number): Scaling factor for the element.
  • speed (number): Speed of the enter/exit transition.
  • transition (boolean): Enable or disable the transition on enter/exit.
  • axis (string|null): Enable tilting on a specific axis ("x" or "y").
  • reset (boolean): Reset the tilt effect on exit.
  • reset-to-start (boolean): Choose whether the exit reset goes to [0,0] (default) or [startX, startY].
  • easing (string): Easing function for the enter/exit transition.
  • glare (boolean): Enable or disable the "glare" effect.
  • max-glare (number): Maximum opacity of the "glare" effect (1 = 100%, 0.5 = 50%).
  • glare-prerender (boolean): Whether to create the glare elements automatically or manually.
  • mouse-event-element (string|null): CSS selector or link to the HTML element to listen for mouse events.
  • gyroscope (boolean): Enable or disable device orientation detection using the gyroscope.
  • gyroscopeMinAngleX (number): The minimum angle on the X-axis that triggers tilt based on gyroscope input.
  • gyroscopeMaxAngleX (number): The maximum angle on the X-axis that triggers tilt based on gyroscope input.
  • gyroscopeMinAngleY (number): The minimum angle on the Y-axis that triggers tilt based on gyroscope input.
  • gyroscopeMaxAngleY (number): The maximum angle on the Y-axis that triggers tilt based on gyroscope input.

✱ Example of full usage ✱

<div use:svelteTilt={{
   reverse: false,
   max: 35,
   startX: 0,
   startY: 0,
   perspective: 1000,
   scale: 1,
   speed: 300,
   transition: true,
   axis: null,
   reset: true,
   "reset-to-start": true,
   easing: "cubic-bezier(.03,.98,.52,.99)",
   glare: false,
   "max-glare": 1,
   "glare-prerender": false,
   "mouse-event-element": null,
   gyroscope: true,
   gyroscopeMinAngleX: -45,
   gyroscopeMaxAngleX: 45,
   gyroscopeMinAngleY: -45,
   gyroscopeMaxAngleY: 45
}} />

🫂 Contributing

Contributions are welcome! If you would like to contribute to Vanilla Tilt Svelte, please follow these guidelines:

  1. Fork the repository and clone it locally.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and ensure that the project builds successfully.
  4. Write tests to cover any new functionality or changes.
  5. Commit your changes and push them to your fork.
  6. Submit a pull request with a detailed description of your changes.

📜 License

Vanilla Tilt Svelte is released under the ISC License. See the LICENSE file for more information.


ℹ️ Project Information:

Written by @rhpo with ❤️.