@brighthr/component-toast
v2.0.2
Published
## Installation
Downloads
2,107
Readme
ComponentName
Installation
To install, type the following into the command line at the root of your project:
npm i @brighthr/component-toast
placeholder for where toasts will appear
Where you add the Toaster
component to the app will be the container that the toast messages will appear in.
Recommended that this should be at the root of your app so they appear in the bottom left corner.
import { Toaster } from '@brighthr/component-toast';
<div>
<Toaster />
</div>;
create a new toast
Import into your file:
import { useToast } from '@brighthr/component-toast';
const { createToast } = useToast();
<Button onClick={() => createToast({
text: 'message for toast',
type: 'information'
})}>