Interactive Hover Button
svelte-animations/interactive-hover-buttonFreeBlock
A button with an interactive hover effect featuring an expanding dot and sliding text animation with an arrow.
Install it
npx shadcn@latest add https://sv-animations.vercel.app/r/interactive-hover-button.jsonSource
1<script lang="ts">2 import { ArrowRight } from "@lucide/svelte";3 import { cn } from "$UTILS$";4 import type { Snippet } from "svelte";5 import type { HTMLButtonAttributes } from "svelte/elements";67 interface InteractiveHoverButtonProps extends HTMLButtonAttributes {8 children: Snippet;9 class?: string;10 }1112 let { children, class: className, ...props }: InteractiveHoverButtonProps = $props();13</script>1415<button16 class={cn(17 "group bg-background relative w-auto cursor-pointer overflow-hidden rounded-full border p-2 px-6 text-center font-semibold",18 className19 )}20 {...props}21>22 <div class="flex items-center gap-2">23 <div24 class="bg-primary h-2 w-2 rounded-full transition-all duration-300 group-hover:scale-[100.8]"25 ></div>26 <span27 class="inline-block transition-all duration-300 group-hover:translate-x-12 group-hover:opacity-0"28 >29 {@render children()}30 </span>31 </div>32 <div33 class="text-primary-foreground absolute top-0 z-10 flex h-full w-full translate-x-12 items-center justify-center gap-2 opacity-0 transition-all duration-300 group-hover:-translate-x-5 group-hover:opacity-100"34 >35 <span>{@render children()}</span>36 <ArrowRight />37 </div>38</button>
What it pulls in
npm packages
Files it writes
More from Svelte Animations
All 66 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Beamanimated-beam | Svelte Animations | Blocks | Free | 1 dep · 6 files | |
| Animated Circular Progress Baranimated-circular-progress-bar | Svelte Animations | Blocks | Free | no deps · 2 files | |
| Animated Gradient Textanimated-gradient-text | Svelte Animations | Blocks | Free | no deps · 2 files | |
| Animated Grid Patternanimated-grid-pattern | Svelte Animations | Blocks | Free | 1 dep · 2 files | |
| Animated Listanimated-list | Svelte Animations | Blocks | Free | 1 dep · 2 files | |
| Animated Shiny Textanimated-shiny-text | Svelte Animations | Blocks | Free | no deps | |
| Animated Theme Toggleranimated-theme-toggler | Svelte Animations | Blocks | Free | no deps · 2 files | |
| Arc Timelinearc-timeline | Svelte Animations | Blocks | Free | no deps · 3 files |
