1.0.9 • Published 2 years ago

react-message-bar v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Message Bar Component

npm

This package provides a single component which shows a message/announcement bar. A dismiss button is available and clickable to close the message for the current and further sessions.

LocalStorage is used to hold the 'dismiss-state'. The component can receive an announcement-id prop to set a new message, which overrides the previous (dismissed) message.

Demo

Install

npm i react-message-bar

Usage

Import react-message-bar

import ReactMessageBar from 'react-message-bar'

Add default styling (optional)

import 'react-message-bar/lib/styles/default.css'

Use the component in your app

<ReactMessageBar>Hello, welcome to this announcement!</ReactMessageBar>

Or, to override dismissed bars

<ReactMessageBar messageId="message-2">Hello, welcome to this NEW announcement!</ReactMessageBar>

Styling

Default styling is provided via CSS. All elements have classnames to apply your own styling.

Props

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago