Skip to content

🍞 preact-toast | toast in preact. (~801b gzip)

License

Notifications You must be signed in to change notification settings

FelipeIzolan/preact-toast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍞 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

About

🍞 preact-toast | toast in preact. (~801b gzip)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published