ValyroUI Русская версия

Shopping Cart Drawer

Slide-out cart. Pro · Shop and payments › Cart and orders

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add shopping-cart-drawer
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { ShoppingCartDrawer } from 'valyro-ui-pro';

Props

PropTypeDefault
openbooleanControlled open; use with onOpenChange.
defaultOpenbooleanfalseInitial open when uncontrolled.
onOpenChange(open: boolean) => voidCalled with the new open when it changes.
valueCartLineItem[]Cart lines; quantity changes and removals go through onValueChange.
defaultValueCartLineItem[][]Initial value when uncontrolled.
onValueChange(items: CartLineItem[]) => voidCalled with the new value when it changes.
currencystring'USD'ISO 4217 code for every price in the drawer.
freeShippingThresholdnumberSubtotal (minor units) that unlocks free shipping; omit to hide the progress bar.
onCheckout(items: CartLineItem[]) => voidCalled by the Checkout button with the current cart lines.
onContinueShopping() => voidDefaults to closing the drawer.
titleReactNode'Your cart'Drawer heading; also its accessible name.
inlinebooleanfalseRender the panel in the page flow instead of a modal drawer — a cart column on a checkout page, the body of a mini-cart popover, a static preview. It fills its container's height; open and the close button do not apply, and "Continue shopping" shows only with onContinueShopping.
localestringLocale for prices and counts (default: the ThemeProvider's, then the browser's).
labelsPartial<ShoppingCartDrawerLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Location Card · Next: Checkout Summary · All Shop and payments