@invisionag/iris-react-flash-message
v4.5.2
Published
```js import FlashMessage from '@invisionag/iris-react-flash-message'; ```
Downloads
212
Maintainers
Keywords
Readme
import FlashMessage from '@invisionag/iris-react-flash-message';
A general single flash message.
Basic Usage:
type Props = {
text: string,
type: 'success' | 'error',
onDismiss: string => any,
};
<FlashMessage text={text} type={type} onDismiss={onDismiss} />
autoDismiss:
When passing the autoDismiss
prop, the flash message will automatically invoke the passed onDismiss
callback after an amount of ms specified in iris settings. The lifespan timer will pause when the Flash Message receives a mouseover event and start up again on mouseleave.
<FlashMessage text="My days are numbered :(" lifespan={2500} onDismiss={onDismiss} />
If autoDismiss
is not passed, the message will stay on screen indefinitely.