2.0.3 • Published 3 years ago
@billogram/foundation-message-bar v2.0.3
@billogram/foundation-message-bar
React message bar components
Install
yarn add @billogram/foundation-message-bar
Usage
import {
FoundationMessageBar,
FoundationMessageBarConsumer,
FoundationMessageBarProvider,
useMessageBar,
} from '@billogram/foundation-message-bar';
See types for exported types.
FoundationMessageBar
<FoundationMessageBarProvider>
<FoundationMessageBar />
</FoundationMessageBarProvider>
useMessageBar
function Component() {
const messageBar = useMessageBar();
return (
<button
onClick={ () => {
messageBar.show('Cupcake ipsum dolor sit amet ice cream brownie');
} }>
Show message
</button>
);
}
Note
This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public. We probably won't take your feature requests unless they align with our own needs.
License
MIT