Skip to content

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) ​

tsx
// Old approach: blocks the UI
alert('Todo created!');
// User must click OK before continuing
// Annoying and disruptive

Problems:

  • Blocks entire UI
  • Requires user action (click OK)
  • Feels intrusive
  • Interrupts workflow

Toast Notification (non-blocking) ​

tsx
// Modern approach: non-blocking
showToast('Todo created!', 'success');
// Appears briefly, auto-dismisses
// User can keep working

Benefits:

  • 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 updated

When: After successful actions Color: Green Icon: Checkmark

Error Toasts ​

❌ Title is required
❌ Network error. Please try again.
❌ You don't have permission to do that

When: After failed actions Color: Red Icon: X or warning

Info Toasts ​

â„šī¸ Changes saved automatically
â„šī¸ New version available

When: General information Color: Blue Icon: Info icon

Good vs Bad Success Messages ​

BadWhy BadGoodWhy 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):

  1. Why show success messages after actions? (User needs confirmation it worked)
  2. What's the difference between toast and alert()? (Toast is non-blocking, auto-dismisses)
  3. How long should success toasts stay visible? (3 seconds)
  4. Should toasts block the UI? (No, they're non-blocking)
  5. What's a good success message for creating a todo? ("Todo created!")
  6. When should I use a modal instead of toast? (Critical errors, long messages, actions needing response)

Expected answers:

  1. Users need to know if their action succeeded
  2. Toast doesn't block UI, dismisses automatically
  3. 3 seconds for success, 5 for errors
  4. No, user can continue working
  5. Brief, specific, clear action
  6. 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:

Step 5: Create Toast System →

Built for learning | Open source on GitHub