Complete e-commerce shop solution. Combines @hanzo/commerce + @hanzo/checkout for a full shopping experience.
npm install @hanzo/shop.jsimport {
// Commerce components
ProductCard,
AddToCartWidget,
CartPanel,
// Checkout components
CheckoutProvider,
CheckoutForm,
// Checkout client
createCheckout
} from '@hanzo/shop.js'
function Shop({ products }) {
return (
<CheckoutProvider options={{ apiKey: 'pk_live_xxx' }}>
{/* Product listing */}
<div className="products">
{products.map(product => (
<ProductCard key={product.id} product={product}>
<AddToCartWidget sku={product.sku} />
</ProductCard>
))}
</div>
{/* Cart sidebar */}
<CartPanel />
{/* Checkout form */}
<CheckoutForm />
</CheckoutProvider>
)
}import { CartPanel, AddToCartWidget } from '@hanzo/shop.js/cart'import { CheckoutProvider, CheckoutForm, useCheckout } from '@hanzo/shop.js/checkout'ProductCard- Product displayAddToCartWidget- Add to cart buttonCartPanel- Shopping cartCarouselBuyCard- Product carouselPaymentStepForm- Payment formShippingStepForm- Shipping formIcons- Commerce icons
CheckoutProvider- Checkout contextCheckoutForm- Complete checkout formuseCheckout- Checkout hookcreateCheckout- Programmatic checkout clientHanzoCheckout- Checkout class
BSD-3-Clause