DocsHover Transition

Hover Transition

A flexible hover wrapper with eight polished transitions, per-card direction and color controls, custom default and hover content, adjustable timing, and a built-in fallback card.

Installation

pnpm dlx shadcn@latest add @componentry/hover-transition

Usage

API Reference

PropertyTypeDefault
defaultComponent

Content shown before the pointer or keyboard focus enters.

React.ReactNodefallback card
hoverComponent

Content revealed by the selected hover effect.

React.ReactNodefallback hover card
effect

The transition style used to swap the two components.

"wipe" | "ripple" | "parallax" | "curtain" | "diagonal" | "morph" | "strips" | "slide""wipe"
direction

The origin or travel direction used by the active effect.

"top" | "right" | "bottom" | "left" | "top-left" | "top-right" | "bottom-right" | "bottom-left" | "center""right"
duration

Animation duration in seconds.

number0.72
easing

Any valid CSS easing value.

string"cubic-bezier(0.22, 1, 0.36, 1)"
label

Accessible label for the focusable transition wrapper.

string"Interactive hover transition"
className

Sizing, radius, and layout classes for the outer wrapper.

string—

View source

Click the icon in the preview panel to browse source for each variant.

Keep in mind

This component is inspired by various open-source projects and patterns. Please verify licenses and implementation details before using in production.

Need a custom component?

I build bespoke UI components & websites tailored to your brand.

DM me on X

Tom Mathews

CEO

morph
morph

Leading the agency's mission to blend Indonesian creativity with cutting-edge AI automation that helps businesses work smarter and scale faster.

Tom Mathews

CEO

Andrew Michel

COO

diagonal
diagonal

Turning ambitious ideas into focused systems, strong teams, and repeatable operations that keep every project moving forward.

Andrew Michel

COO

Andrew Michel

COO

diagonal

Andrew Michel

COO

diagonal

James Smith

CTO

strips
strips

Building reliable AI products that connect thoughtful engineering with simple, human-centered digital experiences.

James Smith

CTO

strips

Building reliable AI products that connect thoughtful engineering with simple, human-centered digital experiences.

James Smith

CTO

strips

Building reliable AI products that connect thoughtful engineering with simple, human-centered digital experiences.

James Smith

CTO

strips

Building reliable AI products that connect thoughtful engineering with simple, human-centered digital experiences.

James Smith

CTO

strips

Building reliable AI products that connect thoughtful engineering with simple, human-centered digital experiences.

James Smith

CTO

strips

Building reliable AI products that connect thoughtful engineering with simple, human-centered digital experiences.

James Smith

CTO

strips

Building reliable AI products that connect thoughtful engineering with simple, human-centered digital experiences.

James Smith

CTO

strips

Building reliable AI products that connect thoughtful engineering with simple, human-centered digital experiences.

James Smith

CTO

Marlen

CMO

ripple
ripple

Shaping clear brand stories and campaigns that turn attention into lasting relationships between people and products.

Marlen

CMO

Sophie Laura

Strategy Director

curtain
curtain

Finding the sharpest path through complex challenges and translating research into confident creative direction.

Sophie Laura

Strategy Director

Sophie Laura

Strategy Director

curtain

Sophie Laura

Strategy Director

curtain

Daniel Reed

Product Director

slide

Daniel Reed

Product Director

slide
slide

Guiding products from first sketch to launch with a practical balance of customer insight, craft, and commercial impact.

Daniel Reed

Product Director

Amina Yusuf

Creative Director

wipe
wipe

Creating expressive visual systems where culture, technology, and meticulous art direction meet with purpose.

Amina Yusuf

Creative Director

Liam Woods

Studio Partner

parallax

Liam Woods

Studio Partner

parallax
parallax

Helping clients turn bold goals into enduring collaborations, measurable growth, and work the whole team is proud to share.

Liam Woods

Studio Partner

"use client"

import { HoverTransition } from "@/components/ui/hover-transition"

function DefaultCard() {
  return (
    <article className="relative flex h-full flex-col justify-between overflow-hidden bg-[#ece9e1] p-6 text-[#151515]">
      <span className="text-xs font-medium uppercase tracking-[0.16em] text-black/50">
        Product Designer
      </span>
      <div aria-hidden="true" className="absolute inset-0 grid place-items-center text-[9rem] font-semibold tracking-[-0.08em] text-black/[0.06]">
        MC
      </div>
      <div className="relative">
        <h3 className="text-3xl font-medium tracking-[-0.05em]">Maya Chen</h3>
        <p className="mt-1 text-sm text-black/55">Designing thoughtful digital products.</p>
      </div>
    </article>
  )
}

function HoverCard() {
  return (
    <article className="flex h-full flex-col justify-between bg-[#dfff5f] p-6 text-[#111]">
      <p className="max-w-[24ch] text-xl font-medium leading-tight tracking-[-0.035em]">
        Turning complex product ideas into clear, expressive experiences that people enjoy using.
      </p>
      <div>
        <p className="font-semibold">Maya Chen</p>
        <p className="mt-1 text-xs uppercase tracking-[0.12em] text-black/55">
          Product Designer
        </p>
      </div>
    </article>
  )
}

export default function HoverTransitionDemo() {
  return (
    <HoverTransition
      effect="wipe"
      direction="right"
      duration={0.72}
      defaultComponent={<DefaultCard />}
      hoverComponent={<HoverCard />}
      className="aspect-[4/5] w-full max-w-sm rounded-3xl"
    />
  )
}