npm install @sakurawood/react-snack-bar
or
yarn add @sakurawood/react-snack-bar
// example
import { useSnackBar } from '@sakurawood/react-snack-bar';
const App = () => {
const snackBar = useSnackBar();
snackBar.show('hello world', 'SUCCESS');
return (
<div>
<div />
</div>
);
};
const props = {
fontSize: 14 , // font size of text , default is 14
align: 'bottom', // position of snack bar in the screen , optional value: ['top','bottom','center'], default is 'bottom'
rtl: true // right to left layout, default is false
}
useSnackBar(props)
show : (text:string, type:'SUCCESS'|'WARN'|'INFO'|'ERROR'='ERROR')=> ...