Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/usePreferredDark.md
1---2category: Browser3---45# usePreferredDark67Reactive dark theme preference.89## Usage1011```ts12import { usePreferredDark } from '@vueuse/core'1314const isDark = usePreferredDark()15```1617## Component Usage1819```vue20<template>21<UsePreferredDark v-slot="{ prefersDark }">22Prefers Dark: {{ prefersDark }}23</UsePreferredDark>24</template>25```2627## Type Declarations2829```ts30/**31* Reactive dark theme preference.32*33* @see https://vueuse.org/usePreferredDark34* @param [options]35*36* @__NO_SIDE_EFFECTS__37*/38export declare function usePreferredDark(39options?: ConfigurableWindow,40): ComputedRef<boolean>41```42