Back to AIX Effects LibraryQA Verified · Synced
Interactive Components/<DirectionAwareHover />·Intermediate

Direction-Aware Hover

Produces cohesive sweeping focus feedback across dense media cards and portfolio thumbnails.

Next.js 16+React 19TypeScriptTailwind CSSFramer Motion
Hover or swipe edges from all 4 directions
01
Top / Bottom Entry
Cross top or bottom edge
01
Top / Bottom Entry

Vector atan2 slides glass panel along crossed edge.

02
Left / Right Entry
Cross left or right border
02
Left / Right Entry

Aspect-normalized quad detection stays true on wide cards.

duration: 0.28s

Enter card perimeter from top, right, bottom, or left edge.

Installation

npm install framer-motion
framer-motion^13.4.0

Smoothly drives directional x/y entrance and exit trajectories.

Usage

import { DirectionAwareHover } from '@/components/effects/library/interactive/DirectionAwareHover'

<DirectionAwareHover
  className="h-48"
  overlay={
    <div>
      <div className="font-bold">Design Tokens v3</div>
      <div className="text-xs text-white/75">Bấm xem thông số kỹ thuật</div>
    </div>
  }
>
  <div className="h-full p-5 bg-neutral-100 dark:bg-neutral-900">Base Card</div>
</DirectionAwareHover>

Props & API Reference

3 props
PropTypeDefaultDescriptionEffect
childrenReactNode(required)Resting foreground card surface.Acts as base visual target.
overlayReactNode(required)Glass overlay content revealed upon directional entry.Renders inside directional backdrop-blur overlay.
durationnumber0.28Slide travel duration in seconds.Tunes directional snap velocity.

More in Interactive Components

View All 36 →
R=145px · k=0.14Approach & Click

Magnetic Button

Spring-damped cursor pull pill button featuring decoupled inner text parallax and radial XOR glow.

View Details
Move pointer or tap cells to illuminate hairline grid
01
Pointer Tracking
02
Masked Grid
03
Touch Ready
04
Zero Packages
Beam 280px · Grid 28px

Cursor Spotlight

Radial light container uncovering masked hairline coordinates cleanly under pointer.

View Details
Select tabs across uneven label widths
active: overview · stiffness 400

Fluid Navigation Indicator

Dynamic width spring capsule gliding smoothly between navigation tabs via scoped layoutId.

View Details