Flash messenger
Displays flash messages on the screen.
Install
yarn add @arturdoruch/flash-messenger
Usage
; const flashMessenger = // Options. See options description below.; // Adds messages with custom types to the stack. flashMessenger;flashMessenger;flashMessenger; // Displays messages of all types.flashMessengerdisplay; // Displays messages of specific type.flashMessengerdisplay'error';
Global options
Global options applied to the all FlashMessenger instances. Set by calling function setOptions().
; ;
-
elementsClassPrefix
string (default:flash-message
)The class name prefix of the message container and item elements.
-
all the common options
Instance options
Options specific for FlashMessenger instance.
; const flashMessenger = // Options;
-
containerClassName
string (default:null
)Adds custom class name for message container div element.
-
all the common options
Common options
Global and per instance FlashMessenger options.
-
removeAfter
int|null (default:5
)Time (in seconds) after message item will be removed form the container. If null message item will not be removed until will be clicked.
-
removeOnClick
boolean (default:true
)Specifies whether the message item should be removed after clicking.
-
positionVertical
string (default:top
)Vertical position of displayed message container. One of:
top
,center
,bottom
. -
positionHorizontal
string (default:center
)Horizontal position of displayed message container. One of:
left
,center
,right
.
CSS styles
For styling flash messages use existing CSS styles import '@arturdoruch/flash-messenger/styles/flash-messenger.css';
or create your own.