Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vueuse/vueuse
Collection of essential Vue Composition Utilities for Vue 2 and 3
https://github.com/vueuse/vueuse
composable utility-library vue vue-composition-api vue-next vue-use vue3
Last synced: 3 days ago
JSON representation
Collection of essential Vue Composition Utilities for Vue 2 and 3
- Host: GitHub
- URL: https://github.com/vueuse/vueuse
- Owner: vueuse
- License: mit
- Created: 2019-12-14T06:44:59.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T03:42:06.000Z (about 2 months ago)
- Last Synced: 2024-10-30T00:35:47.518Z (about 1 month ago)
- Topics: composable, utility-library, vue, vue-composition-api, vue-next, vue-use, vue3
- Language: TypeScript
- Homepage: https://vueuse.org
- Size: 12.7 MB
- Stars: 19,997
- Watchers: 127
- Forks: 2,526
- Open Issues: 295
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- stars - vueuse/vueuse
- awesome - vueuse/vueuse - Collection of essential Vue Composition Utilities for Vue 2 and 3 (TypeScript)
- awesomeLibrary - vueuse - Collection of essential Vue Composition Utilities for Vue 2 and 3 (语言资源库 / typescript)
- awesome-coding-startup - VueUse
- awesome - VueUse
- awesome - VueUse - Collection of Vue Composition utilities. (Other)
- awesome - vueuse/vueuse - Collection of essential Vue Composition Utilities for Vue 2 and 3 (TypeScript)
- awesome - vueuse/vueuse - Collection of essential Vue Composition Utilities for Vue 2 and 3 (TypeScript)
- awesome-element-plus - vueuse - Collection of essential Vue Composition Utilities. [🌐](https://vueuse.org/) - [中文](https://vueuse.pages.dev/) (Recommended With / Blog Posts)
- awesome-element-plus - vueuse - Collection of essential Vue Composition Utilities. [🌐](https://vueuse.org/) - [中文](https://vueuse.pages.dev/) (Recommended With / Blog Posts)
README
Collection of essential Vue Composition Utilities## 🚀 Features
- 🎪 [**Interactive docs & demos**](https://vueuse.org)
- ⚡ **Fully tree shakeable**: Only take what you want, [bundle size](https://vueuse.org/export-size)
- 🦾 **Type Strong**: Written in [TypeScript](https://www.typescriptlang.org/), with [TS Docs](https://github.com/microsoft/tsdoc)
- 🔋 **SSR Friendly**
- 🌎 **No bundler required**: Usable via CDN
- 🔩 **Flexible**: Configurable event filters and targets
- 🔌 **Optional [Add-ons](https://vueuse.org/add-ons)**: Router, Firebase, RxJS, etc.## 🦄 Usage
```ts
import { useLocalStorage, useMouse, usePreferredDark } from '@vueuse/core'export default {
setup() {
// tracks mouse position
const { x, y } = useMouse()// if user prefers dark theme
const isDark = usePreferredDark()// persist state in localStorage
const store = useLocalStorage(
'my-storage',
{
name: 'Apple',
color: 'red',
},
)return { x, y, isDark, store }
},
}
```Refer to [functions list](https://vueuse.org/functions) or [documentations](https://vueuse.org/) for more details.
## 📦 Install
> From v12.0, VueUse no longer supports Vue 2. Please use v11.x for Vue 2 support.
```bash
npm i @vueuse/core
```[Add ons](https://vueuse.org/add-ons.html) | [Nuxt Module](https://vueuse.org/guide/index.html#nuxt)
###### Demos
- [Vite + Vue 3](https://github.com/vueuse/vueuse-vite-starter)
- [Nuxt 3 + Vue 3](https://github.com/antfu/vitesse-nuxt3)
- [Webpack + Vue 3](https://github.com/vueuse/vueuse-vue3-example)### CDN
```vue
```
It will be exposed to global as `window.VueUse`
## 🪴 Project Activity
![Alt](https://repobeats.axiom.co/api/embed/a406ba7461a6a087dbdb14d4395046c948d44c51.svg 'Repobeats analytics image')
## 🧱 Contribute
See the [**Contributing Guide**](https://vueuse.org/contributing)
## 🌸 Thanks
This project is heavily inspired by the following awesome projects.
- [streamich/react-use](https://github.com/streamich/react-use)
- [u3u/vue-hooks](https://github.com/u3u/vue-hooks)
- [logaretm/vue-use-web](https://github.com/logaretm/vue-use-web)
- [kripod/react-hooks](https://github.com/kripod/react-hooks)And thanks to [all the contributors on GitHub](https://github.com/vueuse/vueuse/graphs/contributors)!
## 👨🚀 Contributors
### Financial Contributors on Open Collective
## 📄 License
[MIT License](https://github.com/vueuse/vueuse/blob/main/LICENSE) © 2019-PRESENT [Anthony Fu](https://github.com/antfu)