Use prefers-reduced-motion: reduce as the switch for a dialog’s visual motion. Let CSS disable or substantially shorten CSS-only transitions; subscribe to the media query in React only when JavaScript or an animation library must change its lifecycle. In every mode, keep the dialog’s modal semantics, focus management, open/closed state, and exit behavior intact.
What “reduced motion” means for a dialog
prefers-reduced-motion is a browser media feature that reflects a user’s operating-system or browser setting for minimizing non-essential motion. Its relevant values are reduce and no-preference. A reduce result is not an instruction that every visual change must vanish. It calls for a less motion-heavy treatment: remove movement, shorten it, or replace it with a less spatially disorienting effect.
As an Amazon Associate I earn from qualifying purchases.
A dialog is a good place to apply the preference because opening and closing are interaction-triggered animations. Scaling a panel from a small size, sliding it across the screen, or moving the page behind it can be uncomfortable for some users. The reduced-motion path should therefore cover both entrance and exit, not just the first frame of an opening transition.
One valid design is to make motion available only when the media query reports no-preference, leaving the reduced state static by default. Another is to keep a short opacity change while removing translation or scaling. Choose deliberately based on what the dialog communicates; do not describe opacity as a universal medical guarantee.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Decide what motion is essential
W3C’s technique C39 is associated with WCAG 2.3.3, “Animation from Interactions.” It describes ways to suppress interaction-triggered motion, but techniques are examples rather than the only route to satisfying a normative requirement. For a dialog, ask whether movement communicates information that cannot be conveyed another way. A brief change in visibility may communicate that the panel is present; a large zoom or slide is usually decorative and can be removed.
- Remove scaling and translation first when they make the panel appear to travel through space.
- If a visual cue is still useful, consider a substantially shorter or less spatial transition rather than assuming all animation must remain.
- Apply the decision to the backdrop as well as the panel. A fading or moving overlay is part of the same interaction.
- Document the chosen reduced treatment so future changes do not reintroduce motion in only one direction.
The inverse pattern is also valid: define the dialog as static by default and add motion only inside @media (prefers-reduced-motion: no-preference). This makes the least animated state the baseline and can be useful for a shared component used in many products.
Choose CSS or JavaScript first
The implementation boundary matters. If CSS controls the transition and React only toggles an open or data-state attribute, a media query is normally the simplest and most robust solution. React should subscribe to the preference when JavaScript must make a lifecycle decision, such as waiting for an exit animation before unmounting or configuring an animation library.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
| Question | CSS media query | React or animation-library subscription |
|---|---|---|
| Where does the animation run? | In CSS transitions or keyframes. | In JavaScript, a library, or JavaScript-controlled timing. |
| Does the component need the preference as data? | No. CSS applies it directly in the browser. | Yes. The component reads matchMedia('(prefers-reduced-motion: reduce)'). |
| Runtime preference changes | CSS updates automatically. | Subscribe to the media query’s change event and update behavior. |
| Server rendering | No browser value is read during render. | Use a stable server snapshot or synchronize after hydration; window is unavailable on the server. |
| Closing behavior | Ensure the reduced override covers exit styles as well as entry styles. | Do not wait for a duration or animation event that the reduced path has removed. |
Do not add a React state variable merely to duplicate a CSS decision. Extra state creates another synchronization point and can produce a server/client mismatch. Add JavaScript only when the animation lifecycle actually depends on the preference.
CSS-first implementation for a React dialog
Use a state attribute for the visual phase
React can keep the logical state while exposing a visual state such as opening, entered, or exiting. The exact choreography depends on the dialog component, but the principle is the same: ordinary motion belongs in the default rules, and the reduced override must win in the cascade.
.dialog-panel {
opacity: 1;
transform: translateY(0);
transition: opacity 160ms ease, transform 160ms ease;
}
.dialog-panel[data-state="opening"] {
opacity: 0;
transform: translateY(0.5rem);
}
.dialog-panel[data-state="exiting"] {
opacity: 0;
transform: translateY(0.5rem);
}
@media (prefers-reduced-motion: reduce) {
.dialog-panel {
transition: none;
transform: none;
}
.dialog-panel[data-state="opening"],
.dialog-panel[data-state="exiting"] {
opacity: 1;
transform: none;
}
}
This example removes translation and transition in the reduced mode. If you retain an opacity transition instead, set a much shorter duration and make the choice consistently for both directions. The override must match the specificity of your normal rules or be more specific; otherwise a component stylesheet can accidentally leave the transform active.
Make the reduced state cover entry and exit
An override that only affects opening can still leave a closing animation running. If the panel is unmounted after a close callback, that mismatch can make the interface feel inconsistent: opening is immediate but closing still slides away. Define reduced behavior for every visual phase that can be rendered, including an overlay if it fades or moves.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteRank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Keep CSS and unmount timing consistent
CSS can remove an animation while JavaScript continues to wait for the old 160 ms duration. That leaves an invisible panel mounted, traps focus longer than necessary, or delays the next interaction. For a CSS-only implementation, prefer an event-driven transition handler that also handles the no-transition case, or let the logical close remove the panel immediately when reduced motion is active. Never assume a hard-coded timeout is the same thing as animation completion.
Subscribe in React when JavaScript controls the lifecycle
When a library or custom JavaScript code owns the animation, read the media query and listen for changes. A small Effect is suitable for one component because React Effects synchronize with external systems such as browser events and animation APIs.
import { useEffect, useState } from 'react';
function getReducedMotion() {
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
}
export function useReducedMotion() {
const [reduced, setReduced] = useState(false);
useEffect(() => {
const query = window.matchMedia('(prefers-reduced-motion: reduce)');
const update = () => setReduced(query.matches);
update();
query.addEventListener('change', update);
return () => query.removeEventListener('change', update);
}, []);
return reduced;
}
The initial value above is deliberately stable for server rendering, then corrected after hydration. It means a browser may render one normal-motion frame before the Effect runs. If that flash is unacceptable, use CSS for the visual rule, or arrange a server-safe rendering strategy that does not read window during server render. The helper named getReducedMotion should not be called during render in an SSR component; it is shown only to make the browser query explicit and can be removed when unused.
Use the value to select an animation path
function Dialog({ open, onClose }) {
const reducedMotion = useReducedMotion();
const [phase, setPhase] = useState(open ? 'entered' : 'closed');
useEffect(() => {
if (open) {
setPhase(reducedMotion ? 'entered' : 'opening');
return;
}
setPhase(reducedMotion ? 'closed' : 'exiting');
}, [open, reducedMotion]);
const handleAnimationEnd = () => {
if (phase === 'opening') setPhase('entered');
if (phase === 'exiting') setPhase('closed');
};
if (phase === 'closed') return null;
return (
<div
data-state={phase}
onAnimationEnd={handleAnimationEnd}
role="dialog"
aria-modal="true"
>
{/* dialog content and close control */}
</div>
);
}
The example separates logical intent (open) from the visual phase. In reduced mode, the phase reaches entered or closed immediately, so unmounting does not depend on an event that will never fire. A production dialog still needs an accessible name, focus handling, and a real close action; those concerns are not supplied by the animation code.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Handle preference changes while the dialog is active
The operating-system setting can change while a dialog is open or closing. If the current transition is no longer appropriate, cancel it or finish it deterministically, then apply the new path. In particular, clear an exit timer when reduced motion becomes active and close immediately, or dispatch the same completion routine that an animation-end event would have dispatched. Do not leave the component waiting for an event from an animation that has just been disabled.
When to use useSyncExternalStore
For reusable infrastructure that exposes a browser value as an external store, React’s useSyncExternalStore can model the media query with a subscribe function and a snapshot reader. A server-rendered component also needs a server snapshot because the browser media-query API does not exist on the server. This approach is useful when many components share the same subscription; for a single dialog, an Effect-based hook is usually easier to audit.
Design a close sequence that cannot get stuck
- Record the logical intent first: the caller has requested
open=false. - Choose the visual phase from the current preference. Reduced mode can go directly to
closed; normal mode may enterexiting. - Remove the panel from the tab sequence and release any focus trap when logical closure begins, rather than waiting for pixels to finish moving.
- Complete through one function, whether completion comes from a transition event, an animation event, or the immediate reduced path.
- Restore focus to the invoking control when it still exists and is an appropriate target.
This separation prevents a common race: a close starts with motion enabled, the user changes the system preference, and the transition is removed before its completion event fires. The change listener should either finish the existing close or switch to a known immediate path. Whichever choice you make, use the same cleanup and focus-restoration routine.
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
Preserve dialog semantics in both motion modes
Reduced motion changes the visual transition, not the definition of a modal dialog. The dialog container needs aria-modal="true", an accessible name supplied by aria-labelledby or aria-label, and the required controls as descendants. A visible close button should be in the tab sequence.
- Move focus into the dialog when it opens, normally to the first meaningful control or a deliberate initial target.
- Keep Tab and Shift+Tab inside the modal while it is open; focus must not escape behind the backdrop.
- Close from the close button, the documented Escape behavior, and any other supported action without depending on an animation finishing.
- Restore focus to the invoking control after closure when that control still exists and is appropriate.
- Do not leave an invisible, logically closed panel keyboard reachable or focus-trappable while an exit effect runs.
These requirements apply whether the panel fades, slides, changes instantly, or has no animation. A static reduced-motion dialog is still a modal and must still have a name, contained tab sequence, usable close control, and predictable restoration behavior.
Native <dialog> considerations
With native HTML <dialog>, calling showModal() places the element in the top layer and implicitly gives it modal semantics, including aria-modal="true". Calling show(), or merely adding the open attribute, does not provide the same modal behavior. Use the native API intentionally and test the focus behavior in your target browsers.
Animating the native dialog’s display state has browser-dependent details. A CSS transition that includes the discrete display change may require transition-behavior: allow-discrete. Check support for the browsers you actually ship before making that technique a requirement. A reduced-motion rule should still bypass the display transition and close the element cleanly.
Testing checklist
Test the preference as a behavior matrix, not as a single screenshot.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →- Normal preference, opening: verify the intended transition runs, the dialog becomes usable immediately, and focus enters the modal.
- Normal preference, closing: verify the panel exits, then unmounts or closes without leaving focus behind the backdrop.
- Reduced preference, opening: enable reduced motion in the operating system or browser and confirm non-essential translation, scaling, and other movement are removed or substantially reduced.
- Reduced preference, closing: confirm the dialog closes immediately or through the deliberately shortened treatment; check that no stale timer or animation event is required.
- Keyboard behavior: test Tab, Shift+Tab, Escape where supported, the visible close control, and focus restoration in both preference states.
- Runtime change: with the dialog mounted, change the system preference. Confirm an active animation is cancelled or completed consistently and that the new preference controls the next transition.
- Cleanup: unmount the component and verify the
MediaQueryListlistener is removed. In development, watch for duplicate listeners or state updates after unmount. - Server rendering: render the component without a
windowobject and hydrate it in a browser. Confirm there is no server exception or hydration mismatch.
W3C’s C39 procedure is a useful framing: enable the reduced-motion setting, decide whether each interaction-triggered motion is essential, and check that non-essential motion is suppressed. Apply that procedure separately to entry and exit.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Common failures and precise fixes
Only the opening animation is disabled
Symptom: opening is static, but closing still slides or scales. Fix: put the reduced override on the base panel and every exit-state selector, including the backdrop.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
The component waits forever after motion is removed
Symptom: the panel looks gone but remains mounted, or the next trigger cannot open it. Fix: route reduced mode directly to the completion path, or handle the no-transition case before waiting for transitionend, animationend, or a timeout.
Reading window breaks server rendering
Symptom: a server render throws because matchMedia is unavailable, or hydration produces different markup. Fix: read the browser value inside an Effect, provide a server snapshot when using useSyncExternalStore, or keep the decision in CSS.
Recommended Free Tools
Preference changes are ignored
Symptom: changing the operating-system setting has no effect until a reload. Fix: register the media query’s change listener and remove it in cleanup. If a transition is already running, define how it is cancelled or completed.
Animation logic replaces accessibility logic
Symptom: the panel appears instantly but focus remains on the page behind it, or an invisible panel traps keyboard input. Fix: keep focus movement, containment, naming, close controls, and restoration in the dialog’s interaction model; let motion code handle visual timing only.
A practical implementation decision
For a React dialog whose panel and backdrop use ordinary CSS transitions, start with a @media (prefers-reduced-motion: reduce) override. Remove spatial transforms and either remove or shorten opacity transitions, covering both opening and closing. Keep React responsible for logical open state and focus, not for mirroring a style-only preference.
If JavaScript or an animation library controls when the dialog mounts and unmounts, expose the preference through a carefully cleaned-up media-query subscription. Treat reduced mode as an immediate or shortened visual phase, and make sure every code path reaches the same close completion logic. This preserves a predictable lifecycle without sacrificing the user’s preference.
Free tools Windows power users keep installed
One-click scans. No signup required.
Finally, verify both preference states, both directions, keyboard containment, focus restoration, native or ARIA modal semantics, runtime preference changes, and server rendering. Respecting reduced motion is complete only when the dialog remains understandable and operable after the movement has been removed.
Best Value
Frequently Asked Questions
How do I disable dialog animations when prefers-reduced-motion is set?
Add a @media (prefers-reduced-motion: reduce) rule that removes transforms and transitions, or substantially shortens them. Apply it to both opening and closing states, including any animated backdrop.
Do I need React state for prefers-reduced-motion?
Not for a CSS-only transition. Let the media query control CSS directly. Add a React subscription only when JavaScript or an animation library must choose a lifecycle, mount, unmount, or timing path.
What happens if the preference changes while the dialog is closing?
Handle the media query’s change event. Cancel or finish the current transition deterministically, clear any obsolete timer, and run the same completion and focus-restoration logic used by a normal animation end.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11How do I use reduced motion with server-rendered React?
Do not read window or matchMedia during server rendering. Use CSS when possible, or initialize a stable value and synchronize after hydration. With useSyncExternalStore, provide a server snapshot.
Does reduced motion remove the need for modal accessibility?
No. Keep the accessible name, aria-modal semantics, focus containment, visible close control, Escape behavior where supported, and focus restoration in either motion mode.
Is native <dialog> automatically modal?
Only when opened with showModal(). That method places it in the top layer and implicitly exposes modal semantics. show() and the open attribute alone do not provide the same modal behavior.
The Bottom Line
Use CSS for reduced-motion styling when CSS owns the animation. Subscribe to matchMedia only when JavaScript must control the animation lifecycle. Remove or reduce motion in both directions, finish close paths without stale timers or events, and preserve focus and modal semantics in every mode.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

