vue-composable is out-of-box ready to use composition-api generic components.
100% typescript based composable components and full type support out-of-box.
This library aim is to be one stop shop for many real-world composable functions, with aggressive tree-shaking to keep it light on your end code.
vue-composable is composed by two package @vue-composable/core and @vue-composable/web.
- @vue-composable/core: contains helpers composables, such as Promise and Pagination.
- @vue-composable/web: contains Web API implementations
Support for
vue@nexton vue3 branch
# install with yarn
yarn add @vue/composition-api vue-composable
# install with npm
npm install @vue/composition-api vue-composableCheck our documentation
- Event - Attach event listener to a DOM element
- Mouse Move - Attach
mousemovelistener to a DOM element - Resize - Attach
resizelistener to a DOM element - Scroll - Attach
scrolllistener to a DOM element
- useNow : Return reactive custom timer with specified refresh rate
- useDateNow : Returns reactive
Date.now()with custom refresh rate - usePerformanceNow : Returns reactive
performance.now()with custom refresh rate
- MatchMedia - reactive
MatchMedia - Breakpoint - reactive
breakpointsbased onwindow.innerWidth - Chrome - reactive chrome breakpoints
- TailwindCSS - reactive TailwindCSS breakpoints
- sharedRef - cross-tab reactive
ref
- WebStorage - Reactive access to
Storage API,useLocalStorageanduseSessionStorageuse this - storage - uses
localStorageor on safari private it usessessionStorage - localStorage - Reactive access to a
localStorage - sessionStorage - Reactive access to a
sessionStorage
- Pagination - Generic reactive pagination controls
- Array Pagination - Array pagination
- Validation - model based validation inspired by vuelidate
- Promise -
Promisereactive resolve and reject - promiseLazy - Sugar for usePromise
lazy:true - Cancellable Promise - Allow to cancel promises
- Retry - Provides functionality to retry
promise
- Fetch - reactive
fetchwrapper - WebSocket - reactive
WebSocketwrapper - IntersectionObserver - reactive
IntersectionObserver - NetworkInformation - reactive
NetworkInformationwrapper - Online - reactive
navigator.onLinewrapper - PageVisibility - reactive
Page Visibility API - Language - reactive
NavigatorLanguage - BroadcastChannel - reactive
BroadcastChannel API - Geolocation API
- CSS variables - reactive
CSS variables - Worker -
Web Worker API - WorkerFunction - Webworker Function, offload a function to webworker
New packages needed
- Axios - @vue-composable/axios reactive
axioswrapper client
This is a monorepo project, please check packages or check vue-composable
You can contribute raising issues and by helping out with code.
Tests and Documentation are the most important things for me, because good documentation is really useful!
I really appreciate some tweaks or changes on how the documentation is displayed and how to make it easier to read.
I really need an logo for this project, if you have a good idea for a logo, please enter in contact with me, you can find me on the
Vue discord : @pikax
- Fork it!
- Create your feature branch:
git checkout -b feat/new-composable - Commit your changes:
git commit -am 'feat(composable): add a new composable' - Push to the branch:
git push origin feat/new-composable - Submit a pull request