Add to cart
"idle"Ready to add to cart.
Commerce
AddToCartStateIconShows the lifecycle of adding an item to a cart.
Ready to add to cart.
"idle"Ready to add to cart.
"adding"animatedAdding to cart is in progress.
"added"Added to cart successfully.
"error"The add to cart action failed.
Implementation
The component stays presentational. Your application remains in control of async work and business logic. The state prop is a TypeScript string literal union — pass an invalid state and you'll get a type error at build time.
import { AddToCartStateIcon } from "@stateglyph/react";
<AddToCartStateIcon state="idle" decorative />