Interactive hover button
A call-to-action button with a spinning edge and a fill that swells on hover.
Installation
pnpm add @heyramzi/uiUsage
import { InteractiveHoverButton } from "@heyramzi/ui/effects/interactive-hover-button";Keyboard and accessibility
| Key | Does |
|---|---|
| Space Enter | Presses the button. With href it's a link, and only Enter follows it. |
- The duplicate label and arrow that slide in on hover are hidden from screen readers.
- With reduced motion on, the spinning edge stops.
API reference
hrefstringtype"button" | "submit"- Default
"button" - `submit` posts the form the button sits in.
disabledboolean- Default
false size"default" | "sm"- Default
"default" - `sm` is 40px for a condensed bar; under a thumb both are 44px.
tone"ink" | "coral"- Default
"ink" beamboolean- Default
true dotboolean- Default
true classstringonclick(event: MouseEvent) => voidchildrenrequiredimport("svelte").Snippet
| Prop | Type | Default |
|---|---|---|
href | string | |
type `submit` posts the form the button sits in. | "button" | "submit" | "button" |
disabled | boolean | false |
size `sm` is 40px for a condensed bar; under a thumb both are 44px. | "default" | "sm" | "default" |
tone | "ink" | "coral" | "ink" |
beam | boolean | true |
dot | boolean | true |
class | string | |
onclick | (event: MouseEvent) => void | |
children required | import("svelte").Snippet |