Alert | NativeBase | Universal Components for React and React Native

Data Display
Typography
Disclosure
Media and Icons
Others
Alert
Alerts convey a state that can influence a system, feature, or page.
Show Code
Playground
Import
NativeBase exports 2 Alert related components:
Alert: The wrapper for alert components.
Alert.Icon: The visual icon for the alert that changes based on the status prop.
Copy
import { Alert } from "native-base";
Examples
Basic
Playground
Status
Playground
Variant
Playground
Composition
Playground
Action
Playground
Props
Alert
status
The status of the alert
Type: "info" | "warning" | "success" | "error" | (string & {})
Default: info
variant
The variant of the alert style to use.
Type: ResponsiveValue<"subtle" | "solid" | "outline" | "left-accent" | "top-accent" | "outline-light" | (string & {})>
Default: subtle
colorScheme
The colorScheme of the Alert.
Type: ColorSchemeType
Alert.Icon
Styling
NativeBase ships with a default theme for each component. Checkout the default theme of alert.
Info: We can easily extend the alert component theme using extendTheme function as described in the documentation .
Accessibility
Alert has role set to alert.
Nativebase logo
MadeWithNativeBase