AlertContainer
View source on GitHub
This components designates the location for alerts that fall under a designated namespace.
Alerts can have different semantic meaning and are meant to provide contextual feedback messages for typical user actions. They are triggered using the triggerAlert function and can have 3 types: warning, info and success.
Props
Name
Required
Nullable
Type
maxAlerts
number
namespace
string
Examples
Default namespace
Success
Warning
Info
() => ( <React.Fragment> <AlertContainer style={{ position: "fixed", top: 10, left: 10, right: 10, zIndex: 2 }} /> <FlexRow> <PrimaryButton onPress={() => triggerAlert({ type: "success", message: "Success Message" }) } style={styles.button} > Success </PrimaryButton> <PrimaryButton onPress={() => triggerAlert({ type: "warning", message: "Warning Message" }) } style={styles.button} > Warning </PrimaryButton> <PrimaryButton onPress={() => triggerAlert({ type: "info", message: "Info Message" })} style={styles.button} > Info </PrimaryButton> </FlexRow> </React.Fragment> )