On this page
usePreferredReducedMotion
Category | Browser |
---|---|
Export Size | 557 B |
Last Changed | 9 months ago |
Reactive prefers-reduced-motion media query.
Usage
import { usePreferredReducedMotion } from '@vueuse/core'
const preferredMotion = usePreferredReducedMotion()
Component Usage
This function also provides a renderless component version via the
@vueuse/components
package. Learn more about the usage.
<UsePreferredReducedMotion v-slot="{ motion }">
Preferred Reduced Motion: {{ motion }}
</UsePreferredReducedMotion>
Type Declarations
export type ReducedMotionType = "reduce" | "no-preference"
/**
* Reactive prefers-reduced-motion media query.
*
* @see https://vueuse.org/usePreferredReducedMotion
* @param [options]
*/
export declare function usePreferredReducedMotion(
options?: ConfigurableWindow
): ComputedRef<ReducedMotionType>
Source
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/core/usePreferredReducedMotion/