Socket
Socket
Sign inDemoInstall

vue3-swipe-button

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue3-swipe-button

Swipe Button for Vue3


Version published
Weekly downloads
9
decreased by-30.77%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

vue3-swipe-button

This component simulates the iOS animation of swipe a button from left to right to confirm an action. Currently, supports only mobile devices (touch screens).

Demo

Install

npm install vue3-swipe-button

yarn add vue3-swipe-button

Import JS and Styles

import swipeButton from 'vue3-swipe-button'
import 'vue3-swipe-button/dist/swipeButton.css'

Basic usage

<swipeButton text="Submit Form"
             @submit="actionMethod" />
Props
NameTypeRequiredDefault
titlestringnoSwipe me :)
colorstringno#0271C2
shake-animationbooleannofalse
Events
NameTrigger
submitFull swipe to right
Example
<template>
    <swipeButton text="Confirm Payment"
                 shake-animation="true"
                 :color="getButtonColor"
                 @submit="actionMethod" />
</template>

<script>
import { ref, computed } from 'vue';
import swipeButton from 'vue3-swipe-button';
import 'vue3-swipe-button/dist/swipeButton.css';

export default {
  components: { swipeButton },

  setup() {
    const show = ref(false);
    
    const getButtonColor = computed(() => show.value ? 'purple' : 'green');
    
    const actionMethod = () => show.value = !show.value;

    return { actionMethod, getButtonColor };
  },
}
</script>                 

Customizations

#swipe-button for button style
#swiper for swipe bar style
#swiper-selector for swipe trigger style

FAQs

Last updated on 24 Sep 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc