Socket
Socket
Sign inDemoInstall

@takuma-ru/vue-swipe-modal

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@takuma-ru/vue-swipe-modal

Modal window that can be swiped to close.(Swipeable Bottom Sheet)


Version published
Weekly downloads
959
decreased by-12.98%
Maintainers
1
Weekly downloads
 
Created
Source

@takuma-ru/vue-swpie-modal

Description

Modal window that can be swiped to close.(Swipeable Bottom Sheet)

Warning!

When using this library, please install
vue3.x -> More than "3.2.0" and less than "4"
vue2.x -> More than "2.2.0" and less than "3"

Any version less than that may not work properly.

DEMO

vue2-demo-link

Getting Started

  1. Install
  • for Vue3

    yarn add @takuma-ru/vue-swipe-modal@^3.2.0
    
  • for Vue2

    yarn add @takuma-ru/vue-swipe-modal@^2.2.0
    
  1. Come on, let's use it.
<!-- for Vue3 -->
<template>
  <div>
    <button @click="modal = true">open</button>

    <swipe-modal
      v-model="modal"
      contents-height="50vh"
      border-top-radius="16px"
    >
      <h1>contents</h1>
    </swipe-modal>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { swipeModal } from '@takuma-ru/vue-swipe-modal'

const modal = ref(false)
</script>
<!-- for Vue2 -->
<template>
  <div>
    <button @click="modal = true">open</button>

    <swipe-modal
      v-model="modal"
      contents-height="50vh"
      border-top-radius="16px"
    >
      <h1>contents</h1>
    </swipe-modal>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref, reactive } from '@vue/composition-api';
import { swipeModal } from '@takuma-ru/vue-swipe-modal'

export default defineComponent({
  components: {
    swipeModal,
  },
  setup () {
    const modal = ref<boolean>(false)

    return {
      modal,
    }
  }
})
</script>

Props

Modal General
VariableTypedefaultDetails
v-modelBooleanfalseControl the opening and closing
darkBooleanfalseDark mode
Background
VariableTypedefaultDetails
persistentBooleanfalseDon't close it by pressing background (out of modal)
backgroundColorString#80808080Background (out of modal) color
Modal
VariableTypedefaultDetails
fullscreenBooleanfalseDisplay in full screen mode (height: 100%)
noTipBooleanfalseDon't show the chip at the top of the modal.
contents-widthString100%Width of the modal
contents-heightString30vhHeight of the modal
border-top-radiusStringnullRadius at the top of the modal(This value takes precedence)
border-top-left-radiusString0pxModal upper left radius
border-top-right-radiusString0pxModal upper right radius
contents-colorStringwhiteModal background color
tip-colorString#c8c8c8Tip chip color
dark-contents-colorStringblackModal background color in dark mode

Keywords

FAQs

Package last updated on 04 Jun 2022

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