Skip to content
Calm motion: animations on this site only fade, with no movement

Cart drawer ​

The cart in a side panel, with quantities, the subtotal, and checkout

Opens the cart from the side of the screen, so the buyer stays on the page. It uses the sheet. For the totals on the checkout page, use the order summary.

Basic

Cart (4)

  • USB microphoneBlack
    Rp 899.000
  • Foam panels, pack of 12
    Rp 480.000
  • XLR cable, 3 m
    Rp 85.000
SubtotalRp 1.464.000

Shipping and taxes are added at checkout.

  • v-model is the list of lines. Each line has an id, a name, the price of one, and a quantity. It can also have an image and a variant, such as "Black, M".
  • v-model:open opens and closes the panel. The title counts the items, such as "Cart (4)".
  • Each line has − and + buttons and a number field for the quantity. The quantity stays between 1 and max (default 99). The ✕ button removes the line.
  • Each button has a name with the product, such as "One more USB microphone", so a screen reader user knows which line it changes.
  • The footer shows the subtotal and a note that shipping and taxes come later. The checkout button emits checkout. If the cart is empty, the button is off.
  • currency is an ISO 4217 code (default USD), and locale sets the format.
  • Change the words with labels or a label pack: empty, subtotal, note, checkout, and the functions title, remove, less, more, and quantity.

Usage ​

ts
import { BlessCartDrawer } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
currencystring"USD"
localestring"en"
maxnumber99the most of one line a buyer can take
labelsPartial<{ title: (count: number) => string; empty: string; subtotal: string; note: string; checkout: string; remove: (name: string) => string; less: (name: string) => string; more: (name: string) => string; quantity: (name: string) => string; }>—
openbooleanfalse
modelValueBlessCartLine[][]

Events

NamePayloadDescription
update:open[value: boolean]
update:modelValue[value: BlessCartLine[]]
checkout[]

Released under the MIT License. Character names and artwork belong to their owners.