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

@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

Swipeable Bottom Sheet library for vue2 and vue3

  • 4.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
505
decreased by-63.64%
Maintainers
1
Weekly downloads
 
Created
Source

@takuma-ru/vue-swpie-modal

featureGraphic

Description

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

DEMO

demo-link

Getting Started

1. Install
yarn add @takuma-ru/vue-swipe-modal@^4.0.0
2. Come on, let's use it.
Vue 3.x / Vue 2.7
<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>
Vue 2.6 or lower (Composition API)
<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>
Nuxt 2.x
<!-- 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

General
VariableTypedefaultDetails
v-modelBooleanfalseControl the opening and closing
darkBooleanfalseDark mode
Emit
FunctionTypeDetails
@openVoidFunction to execute when a modal is opened
@closeVoidFunction to execute when the modal closes
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 07 Aug 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