The BuyNowButton component renders a button that adds an item to the cart and redirects the customer to checkout.

Example code


Name Type Description
quantity? number The item quantity. Defaults to 1.
variantId string The ID of the variant.
attributes? Object<string, string>[] An array of cart line attributes that belong to the item being added to the cart.
children ReactNode<Imported> Any ReactNode elements.

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.