Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/Carrene/vue-loading-checkbox

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Carrene/vue-loading-checkbox

  • v0.2.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

vue-loading-checkbox

vue-loading-checkbox

npm version

A vue UI component for loading checkbox

How to install

npm install vue-loading-checkbox --save

How to use

Inside your .vue files

<template>
  <div id="your-component">
    <!-- Using Component -->
    <loading-checkbox
      :checked="checked"
      :loading="loading"
      label="Title of checkbox"
      @click.native="toggleStatus"
    />
  </div>
</template>
<script>
// Importing Component and style
import LoadingCheckbox from 'vue-loading-checkbox'
import 'vue-loading-checkbox/dist/LoadingCheckbox.css'

export default {
  name: 'YourComponentName',
  data() {
    return {
      checked: false,
      loading: false
    }
  },
  methods: {
    toggleStatus() {
      this.loading = true
      setTimeout(() => {
        this.loading = false
        this.checked = !this.checked
      }, 2000)
    }
  },
  components: {
    LoadingCheckbox // Registering Component
  }
}
</script>

Component props

propdescriptiondefault
borderColorColor of checkbox borderblack
borderRadiusBorder radius of checkbox0
borderStyleStyle of checkbox border, (solid, dashed, dotted, ...)solid
borderWidthwidth of checkbox border. You have to insert unit (px,em...)1px
checkColorColor of check markwhite
checkedStatus of component. can be true(checked) or false(unchecked)false
checkedBackgroundColorBackground color of checkbox when status is checkedgray
checkedBorderColorBorder color of checkbox when status is checkednull (same as borderColor)
checkedBorderRadiusBorder radius of checkbox when status is checkednull (same as borderRadius)
checkedBorderStyleBorder style of checkbox when status is checkednull (same as borderStyle)
checkedBorderWidthBorder width of checkbox when status is checkednull (same as borderWidth)
checkIconCustom check mark image (.svg, png, etc). you have to pass it with require functionnull A default pure css check
checkIconPaddingPadding of the given custom check mark image (This will not affect the size)null
fontColorText color of labelblack
fontSizeFont size of labelnull (calculated based on size)
gapGap size between checkbox and its label in px.null (calculated based on size)
labelLabel of checkboxnull (no label)
loadingIf true component is in loading state. it has a higher priority than checkedfalse
loadingBackgroundColorBackground color of checkbox when status is loadingwhite
loadingBorderColorBorder color of checkbox when status is loadingnull (same as borderColor)
loadingBorderRadiusBorder radius of checkbox when status is loadingnull (same as borderRadius)
loadingBorderStyleBorder style of checkbox when status is loadingnull (same as borderStyle)
loadingBorderWidthBorder width of checkbox when status is loadingnull (same as borderWidth)
sizeSize of component in px.30
spinnerColorColor of spinnerblack
spinnerRingColorColor of loading ringlightgray
uncheckedBackgroundColorBackground color of checkbox when status is uncheckedwhite
uncheckedBorderColorBorder color of checkbox when status is uncheckednull (same as borderColor)
uncheckedBorderRadiusBorder radius of checkbox when status is uncheckednull (same as borderRadius)
uncheckedBorderStyleBorder style of checkbox when status is uncheckednull (same as borderStyle)
uncheckedBorderWidthBorder width of checkbox when status is uncheckednull (same as borderWidth)

:warning: Warning: You have to v-bind custom icon path with require function:

v-bind:checkIcon="require(@/assets/path/to/icon.svg)" :heavy_check_mark:

:checkIcon="require(@/assets/path/to/icon.svg)" :heavy_check_mark:

checkIcon="@/assets/path/to/icon.svg" :x:

checkIcon="require(@/assets/path/to/icon.svg)" :x:

Contributing

Visit CONTRIBUTING Page

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build-bundle

Lints and fixes files

npm run lint

License

MIT

FAQs

Package last updated on 11 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc