Fork from @vueuse/vueuse
npm i @svelte-use/core
<script>
import { usePreferredDark, usePreferredDark } from '@svelte-use/core'
// is user prefers dark theme
const isDark = usePreferredDark()
// persist state in localStorage
const storage = useLocalStorage({
'my-storage',
{
name: 'Apple',
color: 'red'
}
})
</script>
Refer to functions list or documentations for more detauls.
This project is heavily inspired by the following awesome projects.
MIT license © 2021-PRESENT 2nthony