Skip to content

Vue composition-api composable components. i18n, validation, pagination, fetch, etc. +50 different composables

License

pikax/vue-composable

Repository files navigation

vue-composable

vue-composable logo

CircleCI Coverage Status npm version bundle size

Introduction

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.

Built for vue-next and composition-api

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 3

Vue3 aka vue-next is fully supported.

Installing

# @vue/composition-api # install with yarn yarn add @vue/composition-api vue-composable # install with npm npm install @vue/composition-api vue-composable # vue 3 # install with yarn yarn add vue-composable # install with npm npm install vue-composable

Documentation

Check our documentation

Composable

Event

  • Event - Attach event listener to a DOM element
  • Mouse Move - Attach mousemove listener to a DOM element
  • Resize - Attach resize listener to a DOM element
  • Scroll - Attach scroll listener to a DOM element
  • onOutsidePress - Execute callback when click is outside of element

Date

  • 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

Format

  • format - Reactive string format
  • path - Retrieve object value based on string path

Breakpoint

MISC

Storage

  • WebStorage - Reactive access to Storage API, useLocalStorage and useSessionStorage use this
  • storage - uses localStorage or on safari private it uses sessionStorage
  • localStorage - Reactive access to a localStorage
  • sessionStorage - Reactive access to a sessionStorage

Pagination

Validation

i18n

  • i18n - Simple i18n implementation with API inspired by vue-i18n

Intl

Promise

Meta

  • Title - reactive document.title

State

  • Timeline - Tracks variable history
  • Undo - Tracks variable history, to allow undo and redo
  • valueSync - syncs variables value, across multiple refs

Web

External

New packages needed

Information

This is a monorepo project, please check packages

Contributing

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.

Twitter: @pikax_dev

Build

# install packages yarn # build and test for v2 yarn build --version=2 yarn test:vue2 # build and test for v3 yarn build yarn test

New composable

  1. Fork it!
  2. Create your feature branch: git checkout -b feat/new-composable
  3. Commit your changes: git commit -am 'feat(composable): add a new composable'
  4. Push to the branch: git push origin feat/new-composable
  5. Submit a pull request

License

MIT

About

Vue composition-api composable components. i18n, validation, pagination, fetch, etc. +50 different composables

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 17