2.3.0 • Published 2 years ago

vue-push-notification-preview v2.3.0

Weekly downloads
27
License
MIT
Repository
github
Last release
2 years ago

vue-push-notification-preview

A library for previewing push notification on devices.

🙋‍♂️ Features

  • ✅ No dependencies
  • Android Device Preview
  • iOS Device Preview
  • 🔥 Dark / Light mode notifications
  • Customizable with SCSS variables

🚀 Install

npm i vue-push-notification-preview

🚦 Quick Setup

Register globally

Make it available anywhere in your Vue application.

import { AndroidPreview, IphonePreview } from 'vue-push-notification-preview';
import 'vue-push-notification-preview/src/assets/devices.scss';

Vue.component('AndroidPreview', AndroidPreview);
Vue.component('IphonePreview', IphonePreview);

Register locally

Explicitly register it to a component you want to use it in.

<script>
  import { AndroidPreview, IphonePreview } from 'vue-push-notification-preview';
  import 'vue-push-notification-preview/src/assets/devices.scss';

  export default {
    components: {
      AndroidPreview,
      IphonePreview
    },
    ...
};
</script>

👨🏻‍🏫 Documentation

Visit: https://nenadjovanoski.github.io/vue-push-notification-preview/

Props

All props for AndroidPreview component:

NameTypeDefaultDescription
textApplicationNameString'App name'
textTimeString'1h ago'
textTitleString''
textBodyString''
imageString''URL for adding image to notification
appearanceModeString'light''light' and dark are possible options.
backgroundImageString''backgroundImage has lower priority over backgroundColor.
backgroundColorString'#c1c1c1'backgroundColor has higher priority over backgroundImage.
heightNumber644 and above (Recommended)Device height in pixels. The width gets calculated to keep device's ratio.
isVisibleTogglerBooleanfalseA prop for managing when arrow toggler is visible in notification.
NameTypeDefaultDescription
textApplicationNameString'App name'
textTimeString'1h ago'
textTitleString'Title notification'
textBodyString''
imageString''URL for adding image to notification
appearanceModeString'light''light' and dark are possible options.
backgroundImageString''backgroundImage has lower priority over backgroundColor.
backgroundColorString'#c1c1c1'backgroundColor has higher priority over backgroundImage.
heightNumber614 and above (Recommended)Device height in pixels. The width gets calculated to keep device's ratio.

Events

All custom events for AndroidPreview and IphonePreview components:

NameTriggerDescription
toggle-notification (Android)ClickClick on top right arrow of notification
toggle-notification (Iphone)ClickClick on application icon of notification

Slots

All named slots for AndroidPreview and IphonePreview components:

NameTriggerDescription
headerClickClick on top right arrow of notification

Styling

Both AndroidPreview and IphonePreview components can be customized through SCSS variables, by importing the following files:

ComponentFile path
AndroidPreviewvue-push-notification-preview/src/assets/devices/pixel_4.scss
IphonePreviewvue-push-notification-preview/src/assets/devices/iphone_x.scss
2.3.0

2 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

0.0.1

3 years ago