AddToCartButton component renders a button that adds an item to the cart when pressed.
It must be a descendent of the
Example codeAnchor link to section titled "Example code"
||An array of cart line attributes that belong to the item being added to the cart.|
||The ID of the variant.|
||The item quantity.|
||Any ReactNode elements.|
||The text that is announced by the screen reader when the item is being added to the cart. Used for accessibility purposes only and not displayed on the page.|
Component typeAnchor link to section titled "Component type"
AddToCartButton component is a client component, which means that it renders on the client. For more information about component types, refer to React Server Components.