skills/react-alert/SKILL.md
Display user-facing alerts, notifications, and feedback messages using toast notifications from the sonner library. Use this skill whenever the user asks to show an alert, notification, success message, error message, warning, or any kind of user feedback popup.
npx skillsauth add landim32/awesome-ai-skills react-alertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill defines the standard approach for displaying alerts, notifications, and user feedback in this project. All alerts MUST use toast notifications from the sonner library — never native browser alerts.
The sonner package is already installed in this project. The <Toaster> provider is already mounted in src/App.tsx:
import { Toaster } from 'sonner';
// Inside the App component JSX:
<Toaster position="bottom-right" richColors />
No additional setup is needed. Just import toast from sonner and call it.
toast from sonner for any user-facing alert, notification, or feedback message.window.alert() — use toast() or toast.error() instead.window.confirm() — use the Modal component (see react-modal skill) for confirmation dialogs, with toast for the resulting success/error feedback.window.prompt() — use the Modal component with a form input instead.console.log() as a substitute for user feedback — if the user should see it, use a toast.Use the appropriate toast variant to match the nature of the message:
import { toast } from 'sonner';
// Success — operation completed successfully
toast.success('Profile updated successfully!');
// Error — something went wrong
toast.error('Failed to save changes. Please try again.');
// Warning — caution or important notice
toast.warning('Your session will expire in 5 minutes.');
// Info — neutral informational message
toast.info('New updates are available.');
// Default — generic notification (no icon/color)
toast('Something happened.');
// Loading — for async operations with follow-up
toast.loading('Saving changes...');
import { toast } from 'sonner';
const handleSave = async () => {
try {
await saveData();
toast.success('Changes saved successfully!');
} catch (error) {
toast.error(error.message || 'Failed to save changes.');
}
};
For async operations where you want to show a loading state that resolves:
import { toast } from 'sonner';
const handleDelete = () => {
toast.promise(deleteItem(id), {
loading: 'Deleting item...',
success: 'Item deleted successfully!',
error: 'Failed to delete item.',
});
};
When the user might want to undo or take a follow-up action:
import { toast } from 'sonner';
toast('Item archived.', {
action: {
label: 'Undo',
onClick: () => restoreItem(id),
},
});
Default auto-dismiss is usually fine, but you can customize:
import { toast } from 'sonner';
// Stay longer for important messages (duration in ms)
toast.warning('Unsaved changes will be lost.', { duration: 8000 });
// Persistent toast that requires manual dismiss
toast.error('Connection lost. Check your internet.', { duration: Infinity });
For messages that need additional context:
import { toast } from 'sonner';
toast.success('User invited', {
description: 'An invitation email has been sent to [email protected].',
});
console.error() separately..message:
toast.error(error.message || 'An unexpected error occurred.');
This project already uses toast from sonner in several pages. Follow the same pattern:
toast.success('Login successful! Welcome back.')toast.error(error.message || 'Login failed. Please try again.')nauth-react components: Pass onSuccess / onError handlers that call toast.success() / toast.error().tools
Guides how to integrate the zTools package for ChatGPT, DALL-E image generation, file upload (S3), slug generation, email sending, and document validation in a .NET 8 project. Use when the user wants to use AI features, upload files, generate slugs, send emails, or understand zTools integration.
documentation
Generates a comprehensive, standardized README.md for any project. Use when the user wants to create or regenerate a README file following the project's documentation standard.
development
Create modal dialogs in the frontend using a custom Modal component built on top of Radix UI Dialog. Use this skill whenever the user asks to create, add, or modify a modal, dialog, popup, or confirmation prompt in the React application.
development
Create the complete frontend architecture for a new entity in the React application. Generates TypeScript types, service class, context provider, custom hook, and registers the provider in main.tsx. Use this skill when the user asks to create a new entity, feature module, or domain area in the frontend.