iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use the browser’s prefers-reduced-motion preference to remove or substantially reduce non-essential movement when a React dialog opens or closes. For a CSS-only transition, a media-query override is usually all you need. If JavaScript or an animation library controls timing, subscribe to the media query and take an immediate or reduced-motion path. In both cases, keep the dialog’s modal semantics, focus management, and logical open/closed state intact.
What prefers-reduced-motion means
prefers-reduced-motion is a CSS media feature with the values reduce and no-preference. The reduce value indicates that the user has enabled an operating-system or browser setting to minimize non-essential motion. It is not an instruction that every visual change must disappear. You can remove motion, shorten it, or replace a spatial animation with a less movement-heavy treatment.
For a dialog, the important decision is whether movement triggered by opening and closing is essential. Scaling a panel from 95% to 100%, sliding it from the edge, or using a large backdrop effect is generally decorative. Under reduced motion, make that treatment static or substantially less spatially active. W3C technique C39, associated with WCAG 2.3.3, also describes the inverse strategy: keep motion available only under prefers-reduced-motion: no-preference, leaving the reduced-motion state static by default. Techniques are examples rather than additional normative requirements, so choose a consistent implementation that satisfies the applicable accessibility requirements.
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 matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallThe preference applies to the whole interaction, not just the panel’s first frame. Consider the backdrop fade, a scale or slide on the panel, animated validation content, and any delayed removal after the close button is pressed. If several elements move together, the reduced treatment should cover them as a coordinated state. A user who requested less motion should not see the panel become static while a backdrop or nested notification continues to travel across the screen.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
Choose CSS or JavaScript based on who controls the animation
| Implementation | Use it when | Reduced-motion mechanism | Important lifecycle concern |
|---|---|---|---|
| CSS media query | Classes, attributes, transitions, and keyframes control all visual motion | @media (prefers-reduced-motion: reduce) changes or removes the transition |
The override must cover both entry and exit; closing code must not wait for a transition that no longer runs |
| React or animation-library subscription | JavaScript chooses animation variants, waits before unmounting, or listens for completion | window.matchMedia('(prefers-reduced-motion: reduce)') and its change event |
Update behavior if the preference changes while the dialog is mounted, and clean up the listener |
Do not add React state merely to duplicate a preference that CSS can already apply. Add a subscription when JavaScript must make a lifecycle decision, such as skipping an exit animation before unmounting. This division also keeps the component easier to reason about: CSS owns presentation, while React owns whether the dialog is open and whether an exit phase is still needed.
A useful diagnostic question is, “What would break if the transition duration changed in the stylesheet?” If only the visual effect changes, CSS is the right place for the preference. If unmounting, focus restoration, or an animation-library callback depends on that duration, JavaScript needs an explicit reduced-motion branch and a reliable completion path.
CSS-first implementation for a React dialog
Keep the preference in CSS when the component only needs a visual change. The React component can continue to set a state attribute while the stylesheet decides whether movement is allowed.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →.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="closing"] {
opacity: 0;
transform: translateY(0.5rem);
}
@media (prefers-reduced-motion: reduce) {
.dialog-panel {
transition: none;
transform: none;
}
}
This example keeps a short opacity transition for users with no reduction preference and removes both the transform and transition for users who request reduced motion. Opacity is not a universal medical guarantee; it is simply less spatially moving than sliding or scaling the whole panel. You can instead use a very short opacity transition if that better fits your interface.
The exact state choreography depends on your dialog implementation. Make sure the media-query rule has enough specificity, or appears late enough in the stylesheet, to win over the normal transition rules. Cover the opening and closing states. An override that only affects entry can leave an exit animation running, which is still motion triggered by the interaction.
Audit every animated property, not only transform. A keyframe on the backdrop, an animated height, or a nested panel transition can continue even after the main panel is static. Put the reduced rule where it can reach those elements, or give each animated element its own reduced-motion declaration. If your normal rule uses a keyframe rather than a transition, disable the animation as well as the transition:
@media (prefers-reduced-motion: reduce) {
.dialog-panel,
.dialog-backdrop,
.dialog-panel * {
animation: none;
transition: none;
transform: none;
}
}
Use a broad descendant selector only when it is safe for the dialog’s contents; form controls may have their own purposeful focus styles. The goal is to remove interaction-triggered movement, not to erase every visual indication. Test the cascade in developer tools so the reduced rule actually wins over component-library styles and inline animation declarations.
Free tools Windows power users keep installed
One-click scans. No signup required.
Separate logical state from visual phase
A dialog that animates out commonly needs two concepts: a logical state saying whether it is open, and a visual phase such as entering, entered, or exiting. Keep the dialog mounted during an ordinary exit phase only when the animation requires it. In reduced-motion mode, the visual phase can complete immediately while the logical state still changes through the same close path.
Do not leave a logically closed dialog keyboard reachable while it is visually disappearing. Once closure is complete, remove it from the tab sequence and restore focus to the invoking control according to the dialog interaction pattern. If an exit phase is mounted for a brief period, ensure the focus trap and Escape handler are coordinated with that phase rather than allowing users to tab into an inert-looking surface.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
Subscribe when JavaScript controls timing
JavaScript is appropriate when an animation library needs a reduced-motion variant, when you delay unmounting until an exit completes, or when code reacts to animation completion events. Read the media query with matchMedia and subscribe to its change event.
import { useEffect, useState } from 'react';
function usePrefersReducedMotion() {
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 Effect synchronizes React with an external browser event. It initializes from the current preference, updates when the user changes that preference, and removes the listener during cleanup. Older browser targets may require the legacy addListener/removeListener API; use the API supported by your target browsers rather than registering both indiscriminately.
Recommended Free Tools
The initial false value is a conservative example for a client component: the Effect immediately corrects it after mount. If your initial render chooses an animated variant, the first frame can briefly differ from the eventual preference. A CSS media query avoids that mismatch because the browser applies the rule directly. For a library hook, use a stable server snapshot and document when the browser value becomes available.
Use an immediate close path
function Dialog({ open, onClose }) {
const reducedMotion = usePrefersReducedMotion();
const [phase, setPhase] = useState(open ? 'entered' : 'closed');
useEffect(() => {
if (open) {
setPhase(reducedMotion ? 'entered' : 'entering');
return;
}
if (reducedMotion) {
setPhase('closed');
return;
}
setPhase('exiting');
}, [open, reducedMotion]);
const onAnimationFinished = () => {
setPhase('closed');
};
if (phase === 'closed') return null;
return (
<div
className="dialog-panel"
data-state={phase}
onTransitionEnd={onAnimationFinished}
>
{/* dialog content */}
</div>
);
}
The example illustrates the decision, not a complete modal implementation. In production, guard completion events so a transition from a child element cannot close the dialog accidentally, and handle canceled or interrupted transitions. In React, also make sure a new open action invalidates any pending close callback. Otherwise a stale completion from the previous exit can set the phase to closed after the dialog has already reopened.
If reduced motion becomes active while an exit is in progress, finish that exit consistently instead of waiting for an event from an animation you have just disabled. Likewise, if the preference changes during entry, switch to the static entered state rather than leaving the panel at an intermediate opacity. The exact implementation can vary, but every branch needs a reachable end state.
Never rely on a hard-coded timeout as if it were the animation’s completion event. A CSS duration can change, a transition can be canceled, and reduced-motion CSS can remove it altogether. If the reduced path removes animation, code that still waits 160 milliseconds (or any old duration) can leave stale content mounted or make a close action appear unresponsive. Prefer the animation system’s completion and cancellation callbacks, and explicitly complete the phase when motion is disabled.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteServer rendering and hydration
window and matchMedia do not exist during server rendering. Do not read them while rendering a server component or during the initial server render of a client component. Start with a stable value and synchronize after hydration, as the Effect hook does above, or keep the preference entirely in CSS so the browser applies it without changing the server-rendered markup.
For reusable code that exposes the media query as an external store, React’s useSyncExternalStore is designed for subscriptions to browser APIs. It takes a subscribe function and a snapshot reader; server-rendered code also needs a server snapshot because the browser API is unavailable there.
import { useSyncExternalStore } from 'react';
const query = '(prefers-reduced-motion: reduce)';
function subscribe(callback) {
const media = window.matchMedia(query);
media.addEventListener('change', callback);
return () => media.removeEventListener('change', callback);
}
function getSnapshot() {
return window.matchMedia(query).matches;
}
function getServerSnapshot() {
return false;
}
export function useReducedMotion() {
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
}
This pattern is useful when several components share one browser preference or when a component library exposes a formal external-store hook. For a single application dialog, a small Effect-based hook is often easier to understand. Whichever approach you choose, keep the server snapshot deterministic and expect the browser value to synchronize after hydration.
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
Do not render different dialog markup on the server based on a guessed preference. The server cannot know the user’s operating-system setting, and a guessed value can create hydration differences. Render the same semantic dialog structure, then let CSS or the client subscription select the visual behavior. This also keeps the accessible name, close control, and focus targets present in both modes.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Keep modal semantics unchanged
Motion reduction changes presentation, not the requirements for an accessible dialog. A modal container needs aria-modal="true", an accessible name supplied by aria-labelledby or aria-label, and its required controls as descendants. Keyboard focus must remain within the modal while it is open: Tab and Shift+Tab should not move focus outside without closing it. A visible close button in the tab sequence is strongly recommended.
<div
role="dialog"
aria-modal="true"
aria-labelledby="settings-title"
>
<h2 id="settings-title">Settings</h2>
<button type="button" onClick={onClose}>Close</button>
{/* dialog controls */}
</div>
When the dialog opens, move focus to a sensible element inside it, commonly the heading, first form control, or close button. When it closes, restore focus to the control that invoked it unless that control no longer exists. Apply these rules in both motion modes. A reduced-motion branch must not skip focus trapping, Escape handling, the close control, or restoration.
Keep the semantic open state aligned with what assistive technology can reach. Hiding a panel visually while leaving it exposed to the accessibility tree, or removing it from the tree before focus is restored, can produce a confusing announcement. The visual phase may be brief, but the logical close operation should be explicit and testable.
Native HTML dialog details
For a native <dialog>, call showModal() for modal behavior. It places the element in the top layer and implicitly exposes aria-modal="true". Calling show(), or merely setting the open attribute, does not provide the same modal semantics.
Animating a native dialog’s display state has browser-dependent details. CSS transitions that include the discrete display change need transition-behavior: allow-discrete. Check support in every browser you target before making this technique part of your dialog lifecycle. If support is incomplete, use a simpler supported class transition and explicit open/close handling.
Regardless of whether the dialog is native or a custom element with role="dialog", reduced motion does not change how it is opened, closed, named, or focused. Treat the animation as an optional layer around the same interaction contract.
What to do when the preference changes mid-animation
- Opening: switch to the reduced visual state and consider the entrance complete immediately.
- Exiting: cancel or finish the existing motion, then unmount without waiting for an event that the new CSS can no longer emit.
- Reopening: clear any stale exit timer or completion callback before starting the new phase.
- Unmounting: remove the media-query listener and any animation listeners in cleanup.
- Focus: preserve the same focus containment and restoration rules while the visual phase changes.
These cases matter because a preference can change while a dialog is open, not only before the first render. Test the transition from one preference to the other rather than assuming the setting is static for the lifetime of the page. A listener should update the current instance once, not create a second subscription each time the dialog opens.
Test both preferences and both directions
W3C’s practical procedure is to enable the system reduced-motion setting, decide whether each interaction-triggered motion is essential, and verify that non-essential motion is suppressed when appropriate. Apply that procedure to opening and closing.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
- With no reduced-motion preference, open the dialog and confirm the intended transition runs without blocking the first focus placement.
- Close it and verify that the exit path completes, focus returns to the invoking control, and the dialog is no longer keyboard reachable.
- Enable reduced motion in the operating system or browser, then repeat opening and closing. Confirm that the transform, slide, or scale is removed or reduced as designed.
- Inspect the reduced-motion close path for stale timers, missing transition events, content that remains mounted, or a focus trap that survives after closure.
- While the dialog is mounted, change the preference and verify that the subscription updates the animation decision without duplicating listeners.
- Unmount the component and check that the media-query listener and animation callbacks are cleaned up.
- Test keyboard behavior in both modes: Tab and Shift+Tab containment, Escape behavior, activation of the visible close button, accessible naming, and focus restoration.
Automated checks can confirm attributes and focus targets, but they will not prove that a visual transition is absent or that a CSS event cannot strand your exit state. Use browser developer tools and an actual reduced-motion setting for the final interaction check. Test a dialog opened repeatedly, a rapid open-close-open sequence, and a close initiated while content is still entering; these cases expose stale callbacks that a single click-through often misses.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Common implementation mistakes
Adding React state for a CSS-only transition
If CSS alone can remove the transform, a second React state variable creates another source of truth and can introduce hydration differences. Prefer the media query unless JavaScript must alter lifecycle behavior.
Disabling only the entrance
Users experience closing as motion too. Apply the reduced rule to exit styles and to any backdrop, nested panel, or delayed unmount path.
Waiting for a removed animation
When reduced CSS sets transition: none, a transition-end event may never arrive. Complete the visual phase immediately or use a lifecycle API that reports cancellation and completion explicitly.
Removing focus handling in the reduced branch
Reduced motion is not reduced accessibility. Keep the modal name, focus containment, close behavior, and focus restoration identical.
Reading window during SSR
Guard browser APIs behind an Effect or use useSyncExternalStore with a server snapshot. A CSS-first solution avoids changing server markup for a preference the server cannot know.
Assuming opacity is always sufficient
Opacity can reduce spatial movement, but it is still a design choice rather than a guarantee for every user. If the interface’s fade is distracting, remove it as well. Conversely, do not claim that a short fade meets every person’s needs; honor the preference consistently and provide a static path.
Letting child events finish the dialog
A transition event can bubble from a nested element. Check the event target and the property being transitioned, or use the animation library’s completion callback, before marking the whole dialog closed.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Recommended decision path
- List every animated property involved in opening, closing, the backdrop, and nested content.
- Mark which movement is decorative and remove or substantially reduce it under
prefers-reduced-motion: reduce. - If CSS controls all of it, implement and test a media-query override covering both directions.
- If JavaScript controls timing or unmounting, subscribe to
matchMedia, clean up the listener, and provide an immediate reduced-motion completion path. - Keep logical open/closed state, visual phase, focus management, and modal semantics independent of the animation preference.
- Test no preference, reduced preference, a mid-animation preference change, keyboard interaction, and server-rendered hydration.
Frequently asked questions
How do I disable dialog animations when reduced motion is enabled?
Add an @media (prefers-reduced-motion: reduce) rule that removes or substantially reduces the panel, backdrop, and nested transitions. Make sure the rule covers both opening and closing. If JavaScript waits for an exit animation, also complete that path immediately instead of waiting for a removed transition.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Do I need a React hook for prefers-reduced-motion?
Not when CSS controls the entire animation. Use a React subscription only when JavaScript or an animation library must choose a variant, respond to a runtime preference change, or decide when to unmount after closing.
What should happen if the user changes the setting while the dialog is open?
Update the media-query subscription, stop or finish the current motion, and move to a definite visual phase. An exit must not wait for an event from an animation that the new reduced-motion rule has disabled. Preserve the same focus and modal behavior.
Can reduced motion remove the focus trap or close button?
No. The preference changes non-essential movement, not dialog semantics. Keep the accessible name, aria-modal, keyboard containment, Escape handling, visible close control, and focus restoration in both modes.
Is showModal() required for a native dialog?
Use showModal() when the native element should behave as a modal. show() and merely setting open do not provide the same modal semantics. Animation choices do not change that distinction.
Why did my close callback never run after enabling reduced motion?
Your reduced CSS may have removed the transition, so no transition-end event was emitted. Detect the reduced path and mark the visual phase complete immediately, or use an animation API that reports cancellation as well as completion.
Frequently Asked Questions
Should I use a zero-duration transition or remove the transition entirely?
Either can be valid. Removing the transition is simplest, but a very short opacity-only treatment may fit the design. Whichever you choose, ensure JavaScript does not wait for an event that the reduced path will not emit.
Does the preference apply only to users with a disability?
It reflects an operating-system or browser request to minimize non-essential motion. Treat it as a user preference and honor it consistently without requiring the user to explain why it is enabled.
How can I test the JavaScript subscription?
Enable reduced motion, mount the dialog, change the system or browser setting while it is mounted, and verify the current animation path changes. Then unmount the component and confirm the media-query listener is removed.
The Bottom Line
Let CSS handle reduced motion for CSS-only dialog transitions. When JavaScript controls animation timing or unmounting, subscribe to matchMedia and finish reduced-motion paths immediately. Test opening, closing, preference changes, SSR, and keyboard focus so less motion never means less modal accessibility.
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.

