Skip to content
react-cards-opening

Reduced motion

Someone who asked their system for less motion still gets to open every card. What changes is how: the things that move the page are taken out, the things that are only light stay, and nothing takes longer than it has to.

What changes

PartWith reduced motion
The scan's sweepSkipped. The grid shows at once and the reticle locks on.
Flight and flipInstant.
The humThe glow stays, the hop and the shake go.
The legendary showOff: no flash, shockwaves, foil, shine or sparkles.
LandingA short fade where the card is.
Idle twitch and sparksOff.
The found pulseOff.
Burst, rays, the lock, the crackStay. They are light, not movement of the page.
Shortest holdOne second instead of 1.75.

Ask yourself

tsx
import { prefersReducedMotion, usePrefersReducedMotion, showFor } from "@react-cards-opening/core";

prefersReducedMotion(); // right now, as a boolean. False on a server.

function Reveal() {
  const reduced = usePrefersReducedMotion(); // as state, kept current
  const plan = showFor("legendary", reduced);
}

The keyboard

  • The card is a button. Enter or Space turns it, and again sends it home.
  • A card being looked at again takes focus. Escape, Enter or Space puts it back, and focus returns to what was pressed.
  • Found cells and badges are buttons with the card's name as their label.
  • The overlay is a live region, so a screen reader hears the card when it turns.

Last updated . Read this page as Markdown.