1.0.0 • Published 1 year ago

preact-toast v1.0.0

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

🍞 preact-toast

image

npm install preact-toast
import toast, { Toaster } from 'preact-toast';

const notify = () => toast('Here is your toast.');

const App = () => {
  return (
    <div>
      <button onClick={notify}>Make me a toast</button>
      <Toaster />
    </div>
  );
};

📄 Documentation

toast

toast(message: string) // <- 3000ms and top-right
toast(message: string, ms: number) // <- custom ms and top-right
toast(message: string, config: ToastConfig) // <- custom toast (look src/types.ts)

type.ts

Toaster

<Toaster
  position="top-right" // <- default toast-position
  style={} // <- default toast-style
  className={} // <- default toast-class
/>

📜 License

1.0.0

1 year ago