Resonance Logo

Wishlist Button

A toggle button that lets users save or remove products from their wishlist, communicating its pressed state clearly to assistive technology through both visual and programmatic state changes.

Demo

Click or press Space/Enter on the wishlist button below to toggle it between saved and unsaved states. Observe how the visual appearance changes and, with a screen reader active, listen for the state announcement. Try both the icon-only and text variants and note how each communicates the button's current state without requiring mouse interaction.

Icon-only variants

Text variants

What to Observe

Anatomy

[Anatomy image placeholder — will be added when assets are available]

  1. Toggle button element: A native button element with a pressed state attribute that reflects whether the item is currently saved to the wishlist.
  2. Icon: A heart or bookmark icon that visually represents the saved/unsaved state; decorative when the button has a text label, accessible when icon-only.
  3. Accessible name: The text or label exposed to assistive technology; updates to reflect the button's current context (e.g., "Save to wishlist" or "Remove from wishlist").
  4. Pressed state indicator: The programmatic attribute that communicates the current toggle state to screen readers — true when saved, false when unsaved.
  5. Confirmation feedback (optional): A brief visible or announced message confirming the action, such as "Added to wishlist" or "Removed from wishlist".

Accessibility Behavior

Common Mistakes

Why This Matters

Wishlist functionality is a lightweight but meaningful part of the shopping experience — it lets users bookmark products for later without committing to a purchase. A screen reader user who cannot determine whether an item is already saved, or who activates a button without knowing it will remove a previously saved item, may inadvertently lose their wishlist contents. An icon-only button with no accessible name is completely opaque to users navigating by screen reader. When the wishlist button is accessible, all users can build, manage, and return to their saved items with the same ease and confidence.

Accessibility Validation

This component is validated against internal accessibility criteria aligned with WCAG standards, using our internally developed system, Resonance Specs.

To learn more, please contact us.

Code

Reference Implementation