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/useLocalStorage.md
1---2category: State3---45# useLocalStorage67Reactive [LocalStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage).89## Usage1011Please refer to `useStorage`.1213## Type Declarations1415```ts16export declare function useLocalStorage(17key: MaybeRefOrGetter<string>,18initialValue: MaybeRefOrGetter<string>,19options?: UseStorageOptions<string>,20): RemovableRef<string>21export declare function useLocalStorage(22key: MaybeRefOrGetter<string>,23initialValue: MaybeRefOrGetter<boolean>,24options?: UseStorageOptions<boolean>,25): RemovableRef<boolean>26export declare function useLocalStorage(27key: MaybeRefOrGetter<string>,28initialValue: MaybeRefOrGetter<number>,29options?: UseStorageOptions<number>,30): RemovableRef<number>31export declare function useLocalStorage<T>(32key: MaybeRefOrGetter<string>,33initialValue: MaybeRefOrGetter<T>,34options?: UseStorageOptions<T>,35): RemovableRef<T>36export declare function useLocalStorage<T = unknown>(37key: MaybeRefOrGetter<string>,38initialValue: MaybeRefOrGetter<null>,39options?: UseStorageOptions<T>,40): RemovableRef<T>41```42