BuyNowButton
The BuyNowButton
component renders a button that adds an item to the cart and redirects the customer to checkout.
Example code
Anchor link to section titled "Example code"
Name | Type | Description |
---|---|---|
quantity? | number |
The item quantity. Defaults to 1. |
variantId | string |
The ID of the variant. |
attributes? | Object< |
An array of cart line attributes that belong to the item being added to the cart. |
children | ReactNode< |
Any ReactNode elements. |
Component type
Anchor link to section titled "Component type"The BuyNowButton
component is a shared component, which means that it renders on both the server and the client. For more information about component types, refer to React Server Components.