Welcome to Week 1, Day 3 of my Weekly UI challenge! As I stated in the announcement post, week 1 will focus on an ecommerce listing UI component; each day throughout this following week, I will pick one or two (usually related) subelements of the design to implement. For day three, our goal is to…
Add to Cart, Favorite Buttons
My listing has the all essentials: title, price, photo, that's it right? All finished? Nope…
I forgot to make it available for purchase, a pretty imporant step unless you are operating a window shopping ecommerce platform!
Following the original design I created, this is what I've got for Day 3:
Like the title and price of the product, a way to purchase a product or add it to your basket/cart should be prominently displayed on an ecommerce listing. I chose to implement this using a block-level button, or a button that is 100% width, and/or utilizes display: block
. This Cart button uses the "Bootstrap" color scheme; this is essentially: blue for information or primary button state (e.g. a CTA), green for success state (e.g. "the thing was done"), and red for danger state (e.g. "be careful considering this option").
The Favorite button in the top-right of the product image would be helpful if your ecommerce app had some sort of wishlist or "save for later" feature. Both the Favorite and Cart buttons use Fontawesome Icons and color to better convey the message of the button and/or its state, even if one may not understand the label.
Here's a GIF with the different states of both the Cart button and the Favorite button:
You can check out my coded implementation on my Github pages site for this project.
Now it's your turn
I used React.js and Storybook to develop my implementation, but you can use whatever technology stack you would like! (hint: if you use Vue.js or Angular.js, you can still use Storybook for those libraries)
You don't even have to use a view library if you don't want to; HTML and CSS-only (and non-view JavaScript library) components are more than possible, especially for this step.
Also, please add your repos and/or images of your designs in the comments for inspiration! I would love to see what designs you all create.
Happy coding! 🎉
Week 1 Calendar
- Design component ✅
- Display product name, price, and image ✅
- Add to cart button, favorite button 🎯
- Sale price display, sold out states
- Color variant thumbnail buttons
- 100% a11y score
- Tweaks, refactors, fixes
Resources
- Fontawesome Icons - Free and Pro (paid) icons
- Learnstorybook.com - Learn Storybook using a FREE UI tutorial from the folks at Chroma
- Button UX Design: Best Practices, Types and States
Top comments (3)
Deployed Version
Code
Nice!
The logic here needs to be improved. It can be misleading.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.