@real-system/toaster
v0.0.51
Published
Toast components for real system.
Downloads
15
Readme
Installation
# install peer dependencies
# npm
$ npm install react react-dom @real-system/alert @real-system/animation-library @real-system/elements-primitive @real-system/styled-library @real-system/utils-library
# yarn
$ yarn add react react-dom @real-system/alert @real-system/animation-library @real-system/elements-primitive @real-system/styled-library @real-system/utils-library
# install toaster
# npm
$ npm install @real-system/toaster
# yarn
$ yarn add @real-system/toaster
Code Example
import { Toaster, useToast } from '@real-system/toaster';
export const MyComponent = (args) => {
const toaster = useToaster();
return (
<Flex vertical>
<Button
mb={4}
onClick={() => toaster.notify('12 new messages')}>
Push Toast
</Button>
<Toaster {...toaster} />
</Flex>
);
};