Alert | NativeBase | Universal Components for React and React Native

Search
K
Hire us
Data Display
Typography
Disclosure
Media and Icons
Others
If you are starting a new project, please try gluestack-ui for better performance and new design.
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" | (string & {}) | "error" | "success" | "warning"
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 color scheme of the Alert.
Type: ColorSchemeType
Alert.Icon
Styling
NativeBase ships with a default theme for each component. Check out the default theme of the 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
Gluestack logo
gluestack-ui