StealThis .dev

Interactive Hover Button

A button with creative multi-layered hover effects including background fill, text color inversion, and border animation.

Open in Lab
css javascript vue svelte
Targets: TS JS HTML React Vue Svelte

Code

Interactive Hover Button

A button with multi-layered hover effects that combine a background fill sliding up from the bottom, text color inversion, and a subtle border animation for maximum visual impact.

How it works

  1. A ::before pseudo-element sits at bottom: 0 with height: 0
  2. On :hover, the pseudo-element’s height transitions to 100%, filling from bottom to top
  3. The text color transitions from light to dark (or vice versa) for contrast inversion
  4. The border color animates to complement the filled background

Variants

  • Default: White fill with dark text on hover
  • Colored: Colored fills (blue, purple, emerald) with white text on hover
  • Outline-to-fill: Starts as an outline button and fills solid on hover

When to use it

  • Navigation links styled as buttons
  • Secondary CTAs that should feel interactive
  • Any button where a satisfying hover state improves the experience