Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/2nthony/svelte-use
- Owner: 2nthony
- License: mit
- Created: 2021-09-03T05:54:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T01:46:18.000Z (8 months ago)
- Last Synced: 2024-05-20T22:15:40.606Z (8 months ago)
- Topics: svelte, svelte-use, utility-library
- Language: TypeScript
- Homepage: svelte-use.vercel.app
- Size: 425 KB
- Stars: 20
- Watchers: 2
- Forks: 1
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
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)