Skip to content

Clear on Swipe

Overview

Notivue has built-in support for clearing notifications on swipe. This is done by importing NotivueSwipe component and wrapping the notification with it.

It works out-of-the-box with both built-in and custom components.

Usage

App.vue

vue
<script setup>
import { Notivue, Notification, NotivueSwipe } from 'notivue'
</script>

<template>
  <Notivue v-slot="item">
    <NotivueSwipe :item="item">
      <Notification :item="item" />
    </NotivueSwipe>
  </Notivue>

  <!-- RouterView, etc. -->
</template>

Customization - Props

PropDescriptionTypeDefault
disabledWhether to disable functionalities or not.booleanfalse
touchOnlyWhether to enable clear on swipe only on touch devices.booleanfalse
thresholdFraction of notification's width needed to be swiped for clearing. For instance, a threshold of 0.5 indicates that the 50% of the notification's width must be swiped in order for the notification to be cleared.number0.5
excludeA querySelectorAll string that specifies elements to be exempted from the swipe action.stringa, button