Components

Alert

Inline alert banner with variant colors, sizes, and rounded corners.

iOSAndroid
Preview Alert on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-alert
Required Packages(1 package)
pnpm add react-native-reanimated

Usage

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

PropTypeDefaultDescription
titlestring—Alert title text
descriptionstring—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
classNamestring—Additional CSS classes
titleClassNamestring—Title text CSS classes
descriptionClassNamestring—Description text CSS classes

Type Exports

TypeDescription
AlertPropsProps for Alert component
AlertVariant'info' | 'success' | 'warning' | 'destructive'
AlertSize'sm' | 'md' | 'lg'

On this page