react-alert
Skill1 starsChanged 7 months agoMITView on GitHub
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.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- emaginebr/AvaBotword for word, first seen Apr 8, 2026
Other versions1 project uses a version of this.
Word for word · 1
- emaginebr/AvaBot★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository39 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- readme-generatorSkill
- add-react-i18nSkill
- band-album-campaignSkill
- band-music-reflectionSkill
- band-streaming-launchSkill
- ckm:banner-designSkill
- ckm:brandSkill
- deploy-prodSkill
- ckm:designSkill
- ckm:design-systemSkill
- docker-compose-configSkill
- doc-managerSkill
- dotnet-architectureSkill
- dotnet-doc-controllerSkill
- dotnet-envSkill
- dotnet-fluent-validationSkill
- dotnet-graphqlSkill
- dotnet-multi-tenantSkill
- dotnet-test-apiSkill
- dotnet-testSkill
- frontend-designSkill
- gitversionSkill
- maui-architectureSkill
- mermaid-chartSkill
- nauth-guideSkill
- nnews-guideSkill
- react-architectureSkill
- react-archSkill
- react-modalSkill
- readme-generatorSkill
- ckm:slidesSkill
- social-media-assetsSkill
- social-media-schedulingSkill
- social-post-authoringSkill
- ckm:ui-stylingSkill
- ui-ux-pro-maxSkill
- wsl-dockerSkill
- ztools-guideSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
No additional setup is needed.
- Distinctive: line 32
Use the appropriate toast variant to match the nature of the message:
- Distinctive: line 91
When the user might want to undo or take a follow-up action:
- Distinctive: line 106
Default auto-dismiss is usually fine, but you can customize:
- Distinctive: line 132
Keep toast messages short and clear (one sentence).
- Distinctive: line 133
Use past tense for completed actions: "Profile updated successfully!" not "Profile has been updated."
- Distinctive: line 134
Use imperative or present tense for errors and instructions: "Failed to save.
- Very specific: line 135
Don't include technical details in user-facing messages — log those to console.error() separately.
- Very specific: line 136
Always provide a fallback message when the error object might not have a .message:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
Setup
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.
Rules
- Always use
toastfromsonnerfor any user-facing alert, notification, or feedback message. - Never use
window.alert()— usetoast()ortoast.error()instead. - Never use
window.confirm()— use the Modal component (seereact-modalskill) for confirmation dialogs, with toast for the resulting success/error feedback. - Never use
window.prompt()— use the Modal component with a form input instead. - Never use
console.log()as a substitute for user feedback — if the user should see it, use a toast. - Never create custom alert/notification components (banners, snackbars, inline alerts) for transient feedback. The toast system already handles this with consistent styling and auto-dismiss behavior.
Toast Types
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...');Usage Patterns
Basic feedback after an action
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.');
}
};Promise-based toast (loading → success/error)
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.',
});
};Toast with action button
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),
},
});Toast with custom duration
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 });Toast with description
For messages that need additional context:
import { toast } from 'sonner';
toast.success('User invited', {
description: 'An invitation email has been sent to john@example.com.',
});Message Guidelines
- Keep toast messages short and clear (one sentence).
- Use past tense for completed actions: "Profile updated successfully!" not "Profile has been updated."
- Use imperative or present tense for errors and instructions: "Failed to save. Please try again."
- Don't include technical details in user-facing messages — log those to
console.error()separately. - Always provide a fallback message when the error object might not have a
.message:toast.error(error.message || 'An unexpected error occurred.');
Existing Conventions
This project already uses toast from sonner in several pages. Follow the same pattern:
- Success on completed action:
toast.success('Login successful! Welcome back.') - Error with message fallback:
toast.error(error.message || 'Login failed. Please try again.') - Callbacks from
nauth-reactcomponents: PassonSuccess/onErrorhandlers that calltoast.success()/toast.error().
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

