You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check the main Readme for a complete installation guide.
Usage
Default
importBpkBannerAlert,{ALERT_TYPES}from'@skyscanner/backpack-web/bpk-component-banner-alert';exportdefault()=>(<BpkBannerAlertmessage="Successful alert with more information."type={ALERT_TYPES.SUCCESS}/>);
Dismissable
import{Component}from'react';import{ALERT_TYPES,BpkBannerAlertDismissable}from'@skyscanner/backpack-web/bpk-component-banner-alert';classDismissableBpkBannerAlertextendsComponent{constructor(){super();this.state={show: true,};}setDismissed=()=>{this.setState({show: false,});}render(){return(<BpkBannerAlertDismissablemessage="Successful alert with dismiss option."type={ALERT_TYPES.SUCCESS}onDismiss={this.setDismissed}show={this.state.show}dismissButtonLabel="Dismiss"/>);}}exportdefault()=>(<DismissableBpkBannerAlert/>);
withBannerAlertState(BpkBannerAlert)
import{Component}from'react';import{ALERT_TYPES,withBannerAlertState,BpkBannerAlertDismissable,BpkBannerAlertExpandable}from'@skyscanner/backpack-web/bpk-component-banner-alert';constBannerAlertDismissableState=withBannerAlertState(BpkBannerAlertDismissable);constBannerAlertExpandableState=withBannerAlertState(BpkBannerAlertExpandable);<BannerAlertDismissableStatedismissButtonLabel="Dismiss"message="Successful alert with dismiss option."type={ALERT_TYPES.SUCCESS}/><BannerAlertDismissableStatedismissButtonLabel="Dismiss"message="Successful alert that will disappear after 5 seconds."hideAfter={5}type={ALERT_TYPES.SUCCESS}/><BannerAlertExpandableStatemessage="Successful alert with expandable option."type={ALERT_TYPES.SUCCESS}toggleButtonLabel="View more">
Lorem ipsum dolor sit amet.
</BannerAlertExpandableState>