1.0.8 โ€ข Published 1 year ago

@sensethenlove/toast v1.0.8

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

๐Ÿ•‰ @sensethenlove/toast

๐Ÿ™ Description

Show a closeable success and/or info toast notification

Toast example

๐Ÿ’Ž Prerequisites

Requires @sensethenlove/global-style or add this css to your site

@keyframes fade-in-from-above {
  0% {
    opacity: 0;
    transform: translateY(-9rem);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-out-and-slide-up {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-9rem);
  }
}

html { /* Helps w/ rem, can still look good w/o just set rem/px as desired: https://stackoverflow.com/questions/59920538  */
  font-size: 62.5%;
}

โ˜ฏ๏ธ Install

pnpm add @sensethenlove/toast
pnpm add @sensethenlove/global-style # Only necessary if prerequisite css above is not present

๐Ÿงก Add wrapper to DOM

<div id="stl--toast-wrapper"></div>

โค๏ธ Add css for wrapper to be your desired z-index

#stl--toast-wrapper {
  z-index: 90;
}

๐Ÿ’› Add imports

import showToast from '@sensethenlove/toast'
import '@sensethenlove/toast/lib/index.css'
import '@sensethenlove/global-style/lib/index.css' // Only necessary if prerequisite css above is not present

๐Ÿ’™ Example: Show info toast

showToast({ type: 'info', items: [ 'Foo' ] })

๐Ÿ’š Example: Show success toast w/ 2 items & link

showToast({ type: 'success', items: [ 'Foo', '<a href="/">Bar</a>' ] })

๐Ÿ’– Our helpful packages!

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago