1.1.1 • Published 2 months ago

@synerise/ds-toaster v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

id: toaster

title: Toaster

Toaster UI Component

Installation

npm i @synerise/ds-toaster
or
yarn add @synerise/ds-toaster

Usage

Toaster is by default rendered inside DSProvider. There should only be a single rendered in your application. If you wish to opt out of rendering the default Toaster then pass false as toasterProps to DSProvider and render the Toaster wherever in your app is suitable.

import Toaster from '@synerise/ds-toaster'

const MyCustomisedToaster = () => {

    return <Toaster containerStyle={{ position: 'static'}} />
}

<DSProvider toasterProps={false}>
    {children}
    <MyCustomisedToaster />
</DSProvider>

To change Toaster props from within your application you can use the useToaster hook

import { useToaster } from '@synerise/ds-toaster';

const { setOptions } = useToaster();
setOptions({ position: 'top-center'});

Demo

API

PropertyDescriptionTypeDefault
1.1.1

2 months ago

1.1.0

2 months ago