Components
iOSAndroid
Installation
pnpm dlx @docyrus/cli add @docyrus/rn-alertRequired Packages(1 package)
pnpm add react-native-reanimatedUsage
import { Alert } from '@/components/docyrus-native/alert';
<Alert variant="info" title="Information" description="This is an informational alert." />
<Alert variant="success" title="Success" description="Operation completed." />
<Alert variant="warning" title="Warning" description="Please review before proceeding." />
<Alert variant="destructive" title="Error" description="Something went wrong." size="lg" />API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | — | Alert title text |
description | string | — | Alert description text |
variant | 'info' | 'success' | 'warning' | 'destructive' | 'info' | Visual style variant |
size | 'sm' | 'md' | 'lg' | 'md' | Component size |
rounded | 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'md' | Border radius preset |
className | string | — | Additional CSS classes |
titleClassName | string | — | Title text CSS classes |
descriptionClassName | string | — | Description text CSS classes |
Type Exports
| Type | Description |
|---|---|
AlertProps | Props for Alert component |
AlertVariant | 'info' | 'success' | 'warning' | 'destructive' |
AlertSize | 'sm' | 'md' | 'lg' |