svelte-use Svelte Themes

Svelte Use

[WIP] Collection of essential Svelte Utilities

Svelte Use

Fork from @vueuse/vueuse

Install

npm i @svelte-use/core

Usage

<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.

Thanks

This project is heavily inspired by the following awesome projects.

License

MIT license © 2021-PRESENT 2nthony

Top categories

Loading Svelte Themes