Gathering detailed insights and metrics for @nosadev/vue-bottom-sheet
Gathering detailed insights and metrics for @nosadev/vue-bottom-sheet
A Vue bottom sheet npm package built with Vue3 and Typescript
npm install @nosadev/vue-bottom-sheet
Typescript
Module System
Node Version
NPM Version
53.6
Supply Chain
98.8
Quality
82.2
Maintenance
100
Vulnerability
100
License
Vue (81.39%)
TypeScript (13.87%)
JavaScript (2.38%)
HTML (2.36%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
967
Last Day
2
Last Week
15
Last Month
130
Last Year
967
MIT License
12 Stars
28 Commits
1 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Feb 06, 2025
Minified
Minified + Gzipped
Latest Version
1.0.11
Package Id
@nosadev/vue-bottom-sheet@1.0.11
Unpacked Size
37.42 kB
Size
9.91 kB
File Count
9
NPM Version
10.5.2
Node Version
20.13.1
Published on
Jun 16, 2024
Cumulative downloads
Total Downloads
Last Day
0%
2
Compared to previous day
Last Week
-55.9%
15
Compared to previous week
Last Month
54.8%
130
Compared to previous month
Last Year
0%
967
Compared to previous year
Preview
A nice clean and touch-friendly bottom sheet component based on Vue.js and Typescript for Vue 3
npm install @nosadev/vue-bottom-sheet
yarn add @nosadev/vue-bottom-sheet
setup
+ TS1<script setup> 2import { BottomSheet } from '@nosadev/vue-bottom-sheet' 3import { ref } from 'vue' 4 5const showSheet = ref<boolean>(false) 6 7const closeSheet = () => { 8 showSheet.value = false 9} 10const showSheetFn = () => { 11 showSheet.value = true 12} 13</script> 14 15<template> 16 <button @click="showSheetFn"> Show Sheet</button> 17 <bottom-sheet :showSheet="showSheet" :onClose="closeSheet"> 18 <div> 19 <h1>Hello World</h1> 20 <span>Vue 3<span> 21 </div> 22 </bottom-sheet> 23</template> 24
Options API
+ TS1<script lang="ts"> 2import { defineComponent } from 'vue' 3import { BottomSheet } from '@nosadev/vue-bottom-sheet' 4 5export default defineComponent({ 6 components: { 7 BottomSheet 8 }, 9 data: () => ({ 10 showSheet: false 11 }), 12 13 methods: { 14 hideSheet() { 15 this.showSheet = false 16 } 17 } 18}) 19</script> 20 21<template> 22 <main> 23 <button @click="showSheet = true">Show sheet</button> 24 <BottomSheet :showSheet="showSheet" :onClose="hideSheet" /> 25 </main> 26</template>
For Nuxt 3, wrap component in <client-only>
1<template> 2 <client-only> 3 <button @click="showSheet = true">Show sheet</button> 4 <bottom-sheet :showSheet="showSheet" :onClose="hideSheet"> 5 <h1>Hello World</h1> 6 <span>Vue 3<span> 7 </bottom-sheet> 8 </client-only> 9</template>
Prop | Type | Description | Example | Defaults |
---|---|---|---|---|
showSheet | Boolean | Set to true or flase to show or hide the bottom sheet | :showSheet="()=> showSheet = true" | false |
id | String | Sets custom data-id property to customize styles on all layers of the bottom sheet - overide in global style e.g [data-id='nosa-content'] {background: #f9dde0 !important;} | :id="nosa" | - |
maxHeight | Number | Sets the maximum height in percentage of the component card with a maximum value of 100 and a minimum value of 10 | :max-width="80" | 80 |
maxWidth | Number | Sets the maximum width of the component card in pixels | :max-height="90" | 576 |
onClose | Function | A Fuction that runs when a supposed close action is triggered (like swapping down or clicking the overlay) close | :onClose="()=> showSheet = false" | ()=>{} |
useDragEffect | Boolean | Enables drag / swap effet | :useDragEffect="false" | true |
useOnlyHeaderForDrag | Boolean | Enables drag / swap effet only when user drags the header of the component card | :useOnlyHeaderForDrag="true" | false |
dragSpeed | Number | Sets the Transition animation duartion with a maximum value of 10 and a minimum value of 1 | dragSpeed="5" | 3 |
background | String | Sets component card background | :background="#f9dde0" | 'white' |
overlayBackground | String | Sets overlay background | :overlayBackground="transparent" | 'rgba(0, 0, 0, 0.5)' |
topRadius | Number | Sets component card top radius value in pixels | :topRadius="0" | '20' |
headerPadding | Number | Sets padding for header of component card in pixels | :headerPadding="16" | 32 |
onSwipeDown | Function | A Function that runs after Swipe down of component card is complete | :onSwipeDown="()=> console.log('siwped down')" | ()=> {} |
closeWithOverlay | Boolean | Allows close of bottom sheet with overlay or not | :closeWithOverlay="false" | true |
Event | Description | Example | Returns |
---|---|---|---|
dragging | Fire when card component is been dragged | @dragging="" | {event: MouseEvent or TouchEvent, contentHeight: number} |
release-drag | Fire when card component is release after drag event | @release-drag="" | {event: MouseEvent or TouchEvent, contentHeight: number} |
opened | Fire while card component is opened | @opened="" | true |
closed | Fire while card component is closed | @closed="" | true |
You can use this named slots:
1<template> 2 <bottom-sheet> 3 <template #header> 4 <span> vue3---vue3 </span> 5 </template> 6 <template> 7 <h2>Vue3 Bottom Sheet 🚀</h2> 8 </template> 9 </bottom-sheet> 10</template>
No vulnerabilities found.
No security vulnerabilities found.