preact-toast
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

🍞 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

Package Sidebar

Install

npm i preact-toast

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

5.03 kB

Total Files

5

Last publish

Collaborators

  • felipeizolan