Alert
Basic Usage
<neura::alerts type="info">
This is an informational alert
</neura::alerts>
Types
<neura::alerts type="info">...</neura::alerts>
<neura::alerts type="success">...</neura::alerts>
<neura::alerts type="warning">...</neura::alerts>
<neura::alerts type="error">...</neura::alerts>
Color Variants
With Content Slot
<neura::alerts type="success">
<x-slot:heading>
Title Here
</x-slot:heading>
<x-slot:content>
Detailed message content
</x-slot:content>
</neura::alerts>
With Actions
<neura::alerts type="info">
<x-slot:heading>Title</x-slot:heading>
<x-slot:content>Message</x-slot:content>
<x-slot:actions>
<div class="flex gap-2 mt-3">
<neura::button>Action</neura::button>
</div>
</x-slot:actions>
</neura::alerts>
Custom Icons
<neura::alerts type="info" iconName="light-bulb">
Custom icon alert
</neura::alerts>
Without Icons
<neura::alerts type="info" :icon="false">
Alert without icon
</neura::alerts>
Use Cases
Form Validation
- The email field is required
- The password must be at least 8 characters
- The passwords do not match
System Notifications
Feature Announcements
Payment & Billing
All Types Showcase
Complex Content
Follow these steps to set up your account:
- Verify your email address
- Complete your profile
- Choose a subscription plan
- Invite your team members
<neura::alerts type="info">
<x-slot:heading>Title</x-slot:heading>
<x-slot:content>
<ol>
<li>Step 1</li>
<li>Step 2</li>
</ol>
</x-slot:content>
<x-slot:actions>
<neura::button>Action</neura::button>
</x-slot:actions>
</neura::alerts>
Advanced Color Usage
<!-- Premium Features -->
<neura::alerts type="info" iconName="rocket-launch" iconClass="!text-purple-500">
Premium alert message
</neura::alerts>
<!-- New Updates -->
<neura::alerts type="success" iconName="sparkles" iconClass="!text-teal-500">
New feature alert
</neura::alerts>
<!-- Limited Offers -->
<neura::alerts type="warning" iconName="fire" iconClass="!text-orange-600">
Limited time alert
</neura::alerts>
<!-- Rewards -->
<neura::alerts type="success" iconName="gift" iconClass="!text-pink-500">
Reward notification
</neura::alerts>
Icon Customization
<neura::alerts
type="info"
iconName="rocket-launch"
iconClass="!text-purple-500"
>
Message here
</neura::alerts>
Best Practices
Info for information, Success for success, Warning for attention, Error for errors
Short and clear messages for better understanding
Always provide a clear action the user can take
Place alerts near the related content for context
Too many alerts reduce their effectiveness and fatigue users
Color & Type Reference
| Type/Color | Badge | Default Icon | Use Case |
|---|---|---|---|
| info | General information, tips, helpful hints | ||
| success | Successful actions, confirmations, positive outcomes | ||
| yellow | Mild cautions, non-urgent warnings | ||
| warning | Warnings, cautions requiring attention | ||
| error | Errors, failures, critical issues | ||
| purple | Premium features, special offers | ||
| pink | Rewards, gifts, special notifications | ||
| teal | New updates, announcements, fresh features | ||
| neutral | Neutral notices, general messages |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| type | string | info | Semantic alert type: info, success, warning, error (legacy) |
| color | string | null | Color variant: blue, green, yellow, orange, red, purple, pink, teal, neutral |
| icon | boolean | true | Show/hide icon |
| iconName | string | auto | Custom icon name |
| iconClass | string | null | Custom icon classes |
| heading | slot | null | Alert title |
| content | slot | null | Alert body content |
| actions | slot | null | Action buttons |