Skip to Content
ComponentsAlert

Alert

A status message component for displaying feedback to users.

Import

import { Alert } from '@grannyshot/ui'

Usage

<Alert variant="info" title="Info"> This is an informational message. </Alert>

Variants

<Alert variant="info" title="Info">Informational message.</Alert> <Alert variant="success" title="Success">Operation completed.</Alert> <Alert variant="warning" title="Warning">Please review.</Alert> <Alert variant="error" title="Error">Something went wrong.</Alert>

Without Title

<Alert variant="info">A simple alert without a title.</Alert>

Without Icon

<Alert variant="success" title="Done" icon={false}> Custom alert without icon. </Alert>

API Reference

PropTypeDefaultDescription
variant'info' | 'success' | 'warning' | 'error''info'Visual style
titleReactNodeAlert title
iconReactNode | falseautoCustom icon, or false to hide
classNamestringAdditional CSS classes
childrenReactNodeAlert description

Extends all native <div> HTML attributes.

Last updated on