Skip to content

🎉 Qwik-Toast allows you to add notifications to your app with ease. No more nonsense!

Notifications You must be signed in to change notification settings

TFX0019/toast-qwik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toast-Qwik

🎉 Qwik-Toast allows you to add notifications to your app with ease. No more nonsense!

Installation

$ npm install --save toast-qwik
$ yarn add toast-qwik
$ bun install toast-qwik
$ npm install toast-qwik 

Preview

Simple Toast Title Toast Success Toast Action Toast

setting

src/routes/layout.tsx

import { component$, Slot } from "@builder.io/qwik";
import { ToastProvider } from "toast-qwik";

export default component$(() => {
  return (
    <ToastProvider>
        <Slot />
    </ToastProvider>
    );
});

use

src/routes/index.tsx

import { component$ } from "@builder.io/qwik";
import { useToast } from "toast-qwik";

export default component$(() => {
  const {toast} = useToast();
  return (
    <>
      <button onClick$={() => {
        toast({
          title: "Awesome toast",
          message: "Toast Qwik description",
          closeable: true,
        })
      }}>
        Test toast
      </button>
    </>
  );
});

Types

toast({
          title: "Awesome toast",
          message: "Toast Qwik description",
          type: "success", // "success" | "warning" | "default" | "danger" | "info"
        })

actions

toast({
  title: "Awesome toast",
  message: "Toast Qwik description",
  closeable: true,
  action: {
    content: 'SHOW',
    onAction: $(() => console.log('SHOW'))
  }
})

About

🎉 Qwik-Toast allows you to add notifications to your app with ease. No more nonsense!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published