Feedback and status
Alert
inline, persistent · variant default/info/success/warning/destructive · icon · onDismiss/action make it a nudge
function AlertDemo() { return ( <View className="w-full gap-3"> <Alert variant="success" icon={CircleCheckIcon}> <AlertTitle>Changes saved</AlertTitle> <AlertDescription>Everything is up to date.</AlertDescription> </Alert> <Alert variant="info" icon={InfoIcon}> <AlertTitle>Scheduled maintenance tonight</AlertTitle> <AlertDescription>Some features pause between 02:00 and 03:00.</AlertDescription> </Alert> <Alert variant="warning" icon={TriangleAlertIcon}> <AlertTitle>Storage almost full</AlertTitle> <AlertDescription>Free up space to keep syncing.</AlertDescription> </Alert> <Alert variant="destructive" icon={CircleAlertIcon}> <AlertTitle>Upload failed</AlertTitle> <AlertDescription>Check your connection and try again.</AlertDescription> </Alert> <Alert icon={InfoIcon}> <AlertTitle>Neutral, title only</AlertTitle> </Alert> <DismissibleAlertDemo /> </View> );}Usage
Inline and persistent, tinted by tone. For transient messages use Toast. onDismiss and action turn it into a nudge — never dismissible for an error the user must act on.
API
<Alert icon variant="default|info|success|warning|destructive" onDismiss? action?><AlertTitle /><AlertDescription /></Alert>Get it
Already in every copy of the native kit:
import { Alert } from '@/components/ui/alert';Details
- Exports
Alert- Packages
- class-variance-authority@^0.7.1, lucide-react-native@^1.21.0
- Installs with
- @halftone-native/icon, @halftone-native/lib-utils, @halftone-native/text
- Also searched as
- inline message, banner, callout, error, success
- Registry JSON
- /r/native/alert.json
<div className="grid w-full max-w-xl gap-3"> <Alert> <ShieldCheckIcon /> <AlertTitle>Two-step sign-in is on</AlertTitle> <AlertDescription>We’ll ask for a code when you sign in on a new device.</AlertDescription> </Alert> <Alert variant="destructive"> <CircleAlertIcon /> <AlertTitle>Payment failed</AlertTitle> <AlertDescription>Your card was declined. Update it to keep your plan.</AlertDescription> </Alert></div>API
<Alert variant?><Icon /><AlertTitle /><AlertDescription /></Alert>Get it
Already in every copy of the web kit:
import { Alert, AlertTitle, AlertDescription } from '@/components/ui/alert';Details
- Exports
Alert,AlertTitle,AlertDescription- Packages
- class-variance-authority@^0.7.1, cn@^0.5.2
- Registry JSON
- /r/web/alert.json
Agents: the whole registry is at /llms.txt.