Alert

Alerts are used to communicate a state that affects a system, feature or page.

Source@chakra-ui/react

Import#

import { Alert } from '@chakra-ui/react'

Usage#

<Alert.Root status='error'>
<Alert.Icon />
<Stack gap='1'>
<Alert.Title>Your browser is outdated!</Alert.Title>
<Alert.Description>
Your Chakra experience may be degraded.
</Alert.Description>
</Stack>
</Alert.Root>

Status#

Change the status of the alerts by passing the status prop. This affects the color scheme and icon used. Alert supports error, success, warning, and info statuses.

<Stack gap={3}>
<Alert.Root status='error'>
<Alert.Icon />
There was an error processing your request
</Alert.Root>
<Alert.Root status='success'>
<Alert.Icon />
Data uploaded to the server. Fire on!
</Alert.Root>
<Alert.Root status='warning'>
<Alert.Icon />
Seems your account is about expire, upgrade now
</Alert.Root>
<Alert.Root status='info'>
<Alert.Icon />
Chakra is going live on August 30th. Get ready!
</Alert.Root>
</Stack>

Variant#

Alert has 3 variant styles you can use. Pass the variant prop and use either subtle, solid, or outline

<Stack gap={3}>
<Alert.Root status='success' variant='outline'>
<Alert.Icon />
Data uploaded to the server. Fire on!
</Alert.Root>
<Alert.Root status='success' variant='solid'>
<Alert.Icon />
Data uploaded to the server. Fire on!
</Alert.Root>
<Alert.Root status='success' variant='subtle'>
<Alert.Icon />
Data uploaded to the server. Fire on!
</Alert.Root>
</Stack>
Edit this page on GitHub

Proudly made inNigeria by Segun Adebayo

Deployed by â–² Vercel