How to use the hover effects library
- Browse the gallery. Filter by cards, images, links, menus or icons. Each thumbnail shows the effect’s hovered state. Select Customize to load one.
- Try it. Hover the preview, or press Tab to focus it. The small “Hovered” preview next to it shows the end state for comparison.
- Tune the timing. Set the duration (150–400 ms feels responsive), the easing and the intensity, which scales distances, angles and glow sizes.
- Match your brand. Set the accent, second color, surface, text color and corner radius, then type your own label.
- Review the checks: keyboard parity, reduced motion, touch fallback, timing and contrast.
- Export CSS, CSS variables, SCSS, Tailwind, HTML or a React component.
How it works
Every effect follows the same pattern:
.hover-fx { transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1); }
.hover-fx:hover,
.hover-fx:focus-visible { transform: translateY(-6px); }
- Resting styles set the starting point, such as an underline scaled to zero.
- Hover and focus styles set the end point.
- The transition moves between them, listing only the properties that change.
Effects such as wobble, bounce and marching dashes use keyframes that play while the element is hovered. Effects that draw lines, fills and overlays use ::before and ::after pseudo-elements, so you don’t need extra markup.
Performance
transform and opacity are the cheapest properties to animate, because the browser can move already-painted layers. Most effects here use them. Shadows, filters and clip-paths cost a little more per frame. That’s fine for single elements, but avoid them on hundreds of items at once.
Worked examples
Example 1: a product card
Choose Card · Lift, set the duration to 250 ms and the intensity to 0.75 for a subtle rise. Pair it with Title color on a second class if you also want the heading to change color.
Example 2: article links
Choose Link · Underline slide-through. The underline grows from the left on hover and leaves to the right when the pointer moves away, a small detail that makes links feel responsive.
Example 3: a portfolio grid
Choose Image · Caption slides up. On desktop the caption appears on hover or focus; on touch screens it stays visible, so visitors can always read it.
Common mistakes
- Hover-only feedback. Always style
:focus-visibletoo, and never remove the focus outline without replacing it. - Hiding essential information behind hover. If content matters, make sure touch and keyboard users can reach it.
- Slow transitions. Anything over 500 ms makes the interface feel sluggish.
- Layout-shifting effects. Changing
width,marginorfont-sizeon hover pushes neighbouring content around. Usetransforminstead.