Step 4: Understanding Feedback â
Time: ~5 minutes | Type: Learning | Concepts: User feedback, toast notifications, success messages
What We're Learning â
Understanding why every action needs visible feedback and how toast notifications provide non-blocking user feedback.
Before You Code: Ask AI First â
đĄ Interactive Learning:
Open your AI assistant and ask these questions. Really read the answers!
What is user feedback in software applications? Why should I show success messages after actions? What are toast notifications? How do they differ from alerts? When should I use toast notifications vs modal dialogs? What makes a good success message? Should toast notifications auto-dismiss? Why? What information should a toast notification include? Can you show examples of good and bad user feedback?
What you should learn:
- User feedback confirms actions succeeded
- Without feedback, users are uncertain
- Toast notifications are small, temporary, non-blocking messages
- Different from alerts (which block the UI)
- Good success messages are specific and brief
- Auto-dismiss after 3-5 seconds
- Include action type and result
Understanding User Feedback â
After asking AI, make sure you understand these concepts:
The Feedback Problem â
Scenario: No feedback after creating todo
User clicks "Create Todo"
â
Form submits
â
Redirects to list
â
User thinks: "Did it work? Where's my todo? Should I try again?"Problem: User doesn't know if action succeeded.
Solution: Show success toast: "Todo created successfully!"
The Feedback Solution â
Scenario: Clear feedback
User clicks "Create Todo"
â
Button shows "Creating..." with spinner
â
Todo created in Firestore
â
Toast appears: "â
Todo created!"
â
Redirects to list
â
User thinks: "Great! It worked. I see my new todo."Result: User is confident and informed.
Toast Notifications vs Alerts â
Alert Dialog (blocking) â
// Old approach: blocks the UI
alert('Todo created!');
// User must click OK before continuing
// Annoying and disruptiveProblems:
- Blocks entire UI
- Requires user action (click OK)
- Feels intrusive
- Interrupts workflow
Toast Notification (non-blocking) â
// Modern approach: non-blocking
showToast('Todo created!', 'success');
// Appears briefly, auto-dismisses
// User can keep workingBenefits:
- Doesn't block UI
- Auto-dismisses (3-5 seconds)
- Non-intrusive
- Feels modern and polished
Types of Toast Messages â
Success Toasts â
â
Todo created!
â
Changes saved
â
Todo deleted
â
Profile updatedWhen: After successful actions Color: Green Icon: Checkmark
Error Toasts â
â Title is required
â Network error. Please try again.
â You don't have permission to do thatWhen: After failed actions Color: Red Icon: X or warning
Info Toasts â
âšī¸ Changes saved automatically
âšī¸ New version availableWhen: General information Color: Blue Icon: Info icon
Good vs Bad Success Messages â
| Bad | Why Bad | Good | Why Good |
|---|---|---|---|
| "Success!" | Too vague | "Todo created!" | Specific action |
| "Operation completed" | Generic | "Changes saved" | Clear result |
| "Done" | No context | "Todo deleted" | Tells what happened |
| "OK" | Meaningless | "Profile updated" | Specific and clear |
Principle: Be specific about what succeeded.
Toast Notification Best Practices â
Duration â
- Success: 3 seconds (quick confirmation)
- Error: 5 seconds (give time to read)
- Info: 4 seconds (medium priority)
Position â
- Top-right: Common, non-intrusive
- Top-center: More visible, for important messages
- Bottom-right: Out of the way
Content â
- Brief: 1-2 sentences max
- Specific: "Todo created" not "Success"
- Actionable (errors): Explain how to fix
Behavior â
- Auto-dismiss: Don't require user action
- Stackable: Multiple toasts queue vertically
- Dismissible: User can close early if desired
When to Use Toasts â
â Good Uses â
After CRUD operations:
- Create: "Todo created!"
- Update: "Changes saved"
- Delete: "Todo deleted"
For quick errors:
- "Title is required"
- "Network error. Try again."
For confirmations:
- "Email sent"
- "Settings updated"
â Bad Uses â
For critical errors:
- Use modal dialog instead
- Example: "Account suspended"
For long messages:
- Use modal or inline message
- Toasts should be brief
For actions requiring response:
- Use confirmation dialog
- Example: "Delete account?" needs Yes/No
Understanding Check â
Before moving on, make sure you can answer these:
đĄ Ask yourself (or ask AI if unsure):
- Why show success messages after actions? (User needs confirmation it worked)
- What's the difference between toast and alert()? (Toast is non-blocking, auto-dismisses)
- How long should success toasts stay visible? (3 seconds)
- Should toasts block the UI? (No, they're non-blocking)
- What's a good success message for creating a todo? ("Todo created!")
- When should I use a modal instead of toast? (Critical errors, long messages, actions needing response)
Expected answers:
- Users need to know if their action succeeded
- Toast doesn't block UI, dismisses automatically
- 3 seconds for success, 5 for errors
- No, user can continue working
- Brief, specific, clear action
- When message is critical or requires user decision
What You Learned â
At this point you should understand:
- â Why every action needs visible feedback
- â What toast notifications are
- â How toasts differ from alert dialogs
- â When to use toasts vs modals
- â What makes good success messages
- â Toast notification best practices
- â The importance of user feedback for UX
Next Step â
Now that you understand feedback, let's create a toast notification system for your app: