1.0.1 • Published 1 year ago

@phyzerbert/vue-bottom-sheet v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Example

Vue Bottom Sheet

Size Downloads Version

A nice clean and touch-friendly bottom sheet component based on Vue.js and Hammer.js

Installation

NPM

npm install --save @phyzerbert/vue-bottom-sheet

Yarn

yarn add @phyzerbert/vue-bottom-sheet

Usage

<template>
  <vue-bottom-sheet ref="myBottomSheet">
    <h1>Lorem Ipsum</h1>
    <h2>What is Lorem Ipsum?</h2>
    <p>
      <strong>Lorem Ipsum</strong> is simply dummy text
    </p>
  </vue-bottom-sheet>
</template>

<script>
import  VueBottomSheet from "@phyzerbert/vue-bottom-sheet";

export default {
  components: {
    VueBottomSheet
  },
  methods: {
    open() {
      this.$refs.myBottomSheet.open();
    },
    close() {
      this.$refs.myBottomSheet.close();
    }
  }
}
</script>

Or add to main.js for use throughout the project

import VueBottomSheet from "@phyzerbert/vue-bottom-sheet";
import Vue from "vue";

Vue.use(VueBottomSheet);

Props

PropTypeDescriptionExample
max-widthStringSet max-width of component cardmax-width="640px"
max-heightStringSet max-height of component cardmax-height="90%"
min-heightNumberSet min-height of component card when closed:min-height="50"
effectStringSet effect for component cardeffect="fx-fadein-scale"
roundedBooleanRound the top two corners of the sheet:rounded="false"
is-full-screenBooleanEnable or disable full-screen mode:is-full-screen="true"
swipe-ableBooleanEnable or disable swipe to close:swipe-able="false"
background-scrollableBooleanEnable scroll:background-scrollable="true"
swipe-limitNumberSet swipe end limit pixels:swipe-limit="50"

Events

EventDescriptionExample
openedFire when card component is opened@opened=""
closedFire when card component is closed@closed=""

List of effects

  • fx-default
  • fx-fadein-scale
  • fx-slide-from-right
  • fx-slide-from-left

You can see all the effects on the demo page