Thanks to visit codestin.com
Credit goes to github.com

Skip to content

simeydotme/hover-tilt

Repository files navigation

Svelte Hover Tilt Logo

Hover Tilt

Code Version NPM version NPM Downloads / Month

A simple, flexible tilt & glare component for Svelte 5.
Available as both a Svelte Component and Web Component.
Works with any framework or vanilla JavaScript via the Web Component.

Svelte Icon HTML Icon JS Icon Vue Icon React Icon Angular Icon Astro Icon jQuery Icon



Hover Tilt Demo

Documentation

Installation

npm install hover-tilt
# or
pnpm add hover-tilt
# or
yarn add hover-tilt
# or
bun add hover-tilt

Quick Start

Svelte Component

<script>
  import { HoverTilt } from 'hover-tilt';
</script>

<HoverTilt tiltFactor={1.5} scaleFactor={1.1}>
  <div class="card">Your content here</div>
</HoverTilt>

Web Component

Works in any framework or vanilla HTML:

<script type="module" src="node_modules/hover-tilt/dist/hover-tilt.js"></script>

<hover-tilt tilt-factor="1.5" scale-factor="1.1">
  <div class="card">Your content here</div>
</hover-tilt>

With Vue

<script setup>
import 'hover-tilt/web-component';
</script>

<template>
  <hover-tilt tilt-factor="1.5" scale-factor="1.1">
    <div class="card">Your content here</div>
  </hover-tilt>
</template>

With React

import 'hover-tilt/web-component';

function MyComponent() {
  return (
    <hover-tilt tilt-factor="1.5" scale-factor="1.1">
      <div className="card">Your content here</div>
    </hover-tilt>
  );
}

With jQuery

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script type="module" src="node_modules/hover-tilt/dist/hover-tilt.js"></script>

<hover-tilt tilt-factor="1.5" scale-factor="1.1">
  <div class="card">Your content here</div>
</hover-tilt>

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

MPL-2.0

Author

Simon Goellner (@simeydotme)

About

A Svelte & Web Component for a hoverable tilting card with optional glare / mask

Topics

Resources

Contributing

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published