Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/2nthony/svelte-use

[WIP] Collection of essential Svelte Utilities
https://github.com/2nthony/svelte-use

svelte svelte-use utility-library

Last synced: 2 months ago
JSON representation

[WIP] Collection of essential Svelte Utilities

Awesome Lists containing this project

README

        

# Svelte Use

> Fork from [@vueuse/vueuse](https://github.com/vueuse/vueuse)

## Install

```bash
npm i @svelte-use/core
```

## Usage

```html

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'
}
})

```

Refer to [functions list](http://svelte-use.vercel.app/functions) or [documentations](http://svelte-use.vercel.app/) for more detauls.

## Thanks

This project is heavily inspired by the following awesome projects.

- [vueuse/vueuse](https://github.com/vueuse/vueuse)

## License

[MIT license](./LICENSE) © 2021-PRESENT [2nthony](https://github.com/evillt)