Cart Reveal
Install the component, then paste your configured usage. Your settings are included in the code below.
npx arclen-ui add cart-reveal --settings eyJ0aGVtZSI6ImRhcmsiLCJ0aXRsZSI6IlJlbGF5IFRyYWlsIDAxIiwiYnJhbmQiOiJBcmNsZW4gRm9vdHdlYXIiLCJwcmljZSI6NTksImltYWdlIjoiIiwiY29uZmlybUxhYmVsIjoiU2xpZGUgdG8gY29uZmlybSIsInJlY2VpcHRUZXh0IjoiQ29uZmlybWVkIiwic2hvd1dpc2hsaXN0Ijp0cnVlLCJzb3VuZCI6ZmFsc2UsInJhZGl1cyI6MzQsImFjY2VudCI6IiNlMDE4MmQiLCJmb2xkU3BlZWQiOjEsImNvbmZpcm1TcGVlZCI6MSwiY29uZmlybVRocmVzaG9sZCI6OTIsInJlY2VpcHREdXJhdGlvbiI6MTc1MCwiY2FyZFdpZHRoIjozMDIsImZyYW1lUGFkZGluZyI6MTUsImxpZ2h0RnJhbWUiOiIjZTdlNmUwIiwiZGFya0ZyYW1lIjoiIzIyMjQyNCIsImxpZ2h0VGV4dCI6IiMyNDI3MjQiLCJkYXJrVGV4dCI6IiNmOGY2ZWYiLCJtZWRpYUhlaWdodCI6MjQxLCJtZWRpYUluc2V0UmFkaXVzIjo5LCJtZWRpYUJhY2tncm91bmQiOiIjZWJlYWU3IiwiaW1hZ2VTY2FsZSI6MSwiaW1hZ2VGb2N1c1giOjUwLCJpbWFnZUZvY3VzWSI6NDQsImZhdm9yaXRlU2l6ZSI6MzgsImZhdm9yaXRlSW5zZXQiOjcsImZhdm9yaXRlSWNvbiI6MTksImZhdm9yaXRlRmlsbCI6IiMxNTE1MTUiLCJmYXZvcml0ZUxpZ2h0RmlsbCI6IiNmZmZmZmYiLCJzcGFya1NpemUiOjYsInNwYXJrUmVhY2giOjI1LCJkZXRhaWxzVG9wIjoyMiwidGl0bGVTaXplIjoyMCwidGl0bGVXZWlnaHQiOjYwMCwiYnJhbmRHYXAiOjYsImJyYW5kU2l6ZSI6MTQsInByaWNlR2FwIjozMCwicHJpY2VTaXplIjozOCwicHJpY2VXZWlnaHQiOjc1MCwicXVhbnRpdHlHYXAiOjcsImFkZFNpemUiOjYyLCJhZGRJY29uIjoyNSwicmVtb3ZlU2l6ZSI6MzYsInJlbW92ZUljb24iOjE3LCJjb3VudFNpemUiOjIzLCJjb3VudEZvbnQiOjExLCJidXR0b25GaWxsIjoiI2ZmZmZmZiIsImJ1dHRvbkluayI6IiMxNTE1MTUiLCJ0cmFja0hlaWdodCI6NTQsInRyYWNrR2FwIjoxOCwidHJhY2tSYWRpdXMiOjM2LCJ0aHVtYkluc2V0Ijo0LCJhcnJvd1NpemUiOjIwLCJ0cmFja1RleHRTaXplIjoxNCwibGlnaHRUcmFjayI6IiNkMGQyY2IiLCJkYXJrVHJhY2siOiIjMzUzNzM3Iiwia2V5Ym9hcmRTdGVwIjoyNSwicmVjZWlwdFRvcCI6MTUsInJlY2VpcHRHYXAiOjgsInJlY2VpcHRGb250IjoxNCwicmVjZWlwdEJhZGdlIjoxOSwicmVjZWlwdEljb24iOjEyLCJyZWNlaXB0RmlsbCI6IiMyZmJmNWYiLCJyZWNlaXB0SW5rIjoiIzBkMmUxOCIsInN1YnRvdGFsRHVyYXRpb24iOjM4MCwidGV4dEVudHJhbmNlU3BlZWQiOjEsInRleHRTdGFnZ2VyIjo1NSwiY29uZmlybUhvbGQiOjc3MCwiZ2xvd1N0cmVuZ3RoIjoyNCwiZ2xvd0NvbG9yIjoiIzI2OWE1YSJ9import { CartReveal } from "@/components/cart-reveal";
export default function Example() {
return <CartReveal {...{
"theme": "dark",
"title": "Relay Trail 01",
"brand": "Arclen Footwear",
"price": 59,
"image": "",
"confirmLabel": "Slide to confirm",
"receiptText": "Confirmed",
"showWishlist": true,
"sound": false,
"radius": 34,
"accent": "#e0182d",
"foldSpeed": 1,
"confirmSpeed": 1,
"confirmThreshold": 92,
"receiptDuration": 1750,
"cardWidth": 302,
"framePadding": 15,
"lightFrame": "#e7e6e0",
"darkFrame": "#222424",
"lightText": "#242724",
"darkText": "#f8f6ef",
"mediaHeight": 241,
"mediaInsetRadius": 9,
"mediaBackground": "#ebeae7",
"imageScale": 1,
"imageFocusX": 50,
"imageFocusY": 44,
"favoriteSize": 38,
"favoriteInset": 7,
"favoriteIcon": 19,
"favoriteFill": "#151515",
"favoriteLightFill": "#ffffff",
"sparkSize": 6,
"sparkReach": 25,
"detailsTop": 22,
"titleSize": 20,
"titleWeight": 600,
"brandGap": 6,
"brandSize": 14,
"priceGap": 30,
"priceSize": 38,
"priceWeight": 750,
"quantityGap": 7,
"addSize": 62,
"addIcon": 25,
"removeSize": 36,
"removeIcon": 17,
"countSize": 23,
"countFont": 11,
"buttonFill": "#ffffff",
"buttonInk": "#151515",
"trackHeight": 54,
"trackGap": 18,
"trackRadius": 36,
"thumbInset": 4,
"arrowSize": 20,
"trackTextSize": 14,
"lightTrack": "#d0d2cb",
"darkTrack": "#353737",
"keyboardStep": 25,
"receiptTop": 15,
"receiptGap": 8,
"receiptFont": 14,
"receiptBadge": 19,
"receiptIcon": 12,
"receiptFill": "#2fbf5f",
"receiptInk": "#0d2e18",
"subtotalDuration": 380,
"textEntranceSpeed": 1,
"textStagger": 55,
"confirmHold": 770,
"glowStrength": 24,
"glowColor": "#269a5a"
}} />;
}| Property | Type | Default |
|---|---|---|
themeCard finish Options: dark, light | select | "dark" |
titleProduct name Up to 90 characters | text | "Relay Trail 01" |
brandBrand Up to 60 characters | text | "Arclen Footwear" |
priceUnit price (USD) 0–100000Step 0.01 | number | 59 |
imageProduct image URL or path Up to 12000000 characters | text | "" |
confirmLabelConfirmation button text Up to 44 characters | text | "Slide to confirm" |
receiptTextReceipt message Up to 64 characters | text | "Confirmed" |
showWishlistShow wishlist button | boolean | true |
soundPlay confirmation tone | boolean | false |
radiusCard corner radius 6–56Step 1 | number | 34 |
accentCart accent | color | "#e0182d" |
foldSpeedFold speed 0.4–2Step 0.05 | number | 1 |
confirmSpeedHandle and confirmation speed 0.4–2Step 0.05 | number | 1 |
confirmThresholdRequired travel (%) 60–100Step 1 | number | 92 |
receiptDurationReceipt hold (ms) 500–6000Step 50 | number | 1750 |
cardWidthCard width (px) 240–440Step 1 | number | 302 |
framePaddingFrame inset (px) 4–28Step 1 | number | 15 |
lightFrameLight frame midtone | color | "#e7e6e0" |
darkFrameDark frame midtone | color | "#222424" |
lightTextLight card text | color | "#242724" |
darkTextDark card text | color | "#f8f6ef" |
mediaHeightImage height at 272px wide (px) 152–360Step 1 | number | 241 |
mediaInsetRadiusCorner inset from frame (px) 0–36Step 1 | number | 9 |
mediaBackgroundImage background | color | "#ebeae7" |
imageScaleProduct zoom (×) 0.65–1.6Step 0.01 | number | 1 |
imageFocusXProduct horizontal focus (%) 0–100Step 1 | number | 50 |
imageFocusYProduct vertical focus (%) 0–100Step 1 | number | 44 |
favoriteSizeHeart button diameter (px) 26–60Step 1 | number | 38 |
favoriteInsetHeart button inset (px) 0–24Step 1 | number | 7 |
favoriteIconHeart icon size (px) 12–28Step 1 | number | 19 |
favoriteFillDark heart button fill | color | "#151515" |
favoriteLightFillLight heart button fill | color | "#ffffff" |
sparkSizeBurst particle diameter (px) 2–10Step 1 | number | 6 |
sparkReachBurst travel (px) 10–45Step 1 | number | 25 |
detailsTopSpace above name (px) 8–40Step 1 | number | 22 |
titleSizeName size (px) 14–30Step 1 | number | 20 |
titleWeightName weight 350–850Step 10 | number | 600 |
brandGapSpace above brand (px) 0–16Step 1 | number | 6 |
brandSizeBrand size (px) 10–20Step 1 | number | 14 |
priceGapSpace above subtotal (px) 8–48Step 1 | number | 30 |
priceSizeSubtotal size (px) 22–48Step 1 | number | 38 |
priceWeightSubtotal weight 350–900Step 10 | number | 750 |
quantityGapButton spacing (px) 1–18Step 1 | number | 7 |
addSizeAdd button diameter (px) 44–76Step 1 | number | 62 |
addIconCart icon size (px) 16–36Step 1 | number | 25 |
removeSizeRemove button diameter (px) 28–50Step 1 | number | 36 |
removeIconMinus icon size (px) 12–25Step 1 | number | 17 |
countSizeCount badge diameter (px) 18–32Step 1 | number | 23 |
countFontCount label size (px) 9–14Step 1 | number | 11 |
buttonFillAdd and thumb fill | color | "#ffffff" |
buttonInkAdd and thumb icon | color | "#151515" |
trackHeightTrack height (px) 44–72Step 1 | number | 54 |
trackGapSpace above track (px) 6–34Step 1 | number | 18 |
trackRadiusTrack radius (px) 0–36Step 1 | number | 36 |
thumbInsetThumb inset (px) 2–8Step 1 | number | 4 |
arrowSizeArrow and check size (px) 12–28Step 1 | number | 20 |
trackTextSizeTrack label size (px) 10–18Step 1 | number | 14 |
lightTrackLight track fill | color | "#d0d2cb" |
darkTrackDark track fill | color | "#353737" |
keyboardStepKeyboard travel (%) 5–50Step 1 | number | 25 |
receiptTopSpace above receipt (px) 4–32Step 1 | number | 15 |
receiptGapReceipt icon gap (px) 0–20Step 1 | number | 8 |
receiptFontReceipt label size (px) 10–20Step 1 | number | 14 |
receiptBadgeReceipt badge size (px) 14–32Step 1 | number | 19 |
receiptIconReceipt check size (px) 8–18Step 1 | number | 12 |
receiptFillReceipt badge fill | color | "#2fbf5f" |
receiptInkReceipt check color | color | "#0d2e18" |
subtotalDurationSubtotal roll duration (ms) 80–900Step 10 | number | 380 |
textEntranceSpeedText entrance speed (×) 0.25–3Step 0.05 | number | 1 |
textStaggerText entrance stagger (ms) 0–200Step 5 | number | 55 |
confirmHoldOrder placed hold (ms) 100–5000Step 10 | number | 770 |
glowStrengthGlow strength (%) 0–100Step 1 | number | 24 |
glowColorGlow color | color | "#269a5a" |
Cart Reveal is a product tile with a quantity picker and slide-to-confirm control. The save button works in either view.
React
import { CartReveal } from './components/cart-reveal/src/react';
<CartReveal
title="Relay Trail 01"
brand="Arclen Footwear"
price={59}
image="./trail-shoe.webp"
onConfirm={({ quantity, total }) => console.log(quantity, total)}
/>Use an image path relative to the page, a root-relative path, an HTTPS image URL or an embedded WebP. The bundled original trail-shoe photograph appears by default and if a supplied image fails to load. Portrait product photography sits just above the lower edge of the tile and keeps its original orientation. Square images cover the tile. Whole-dollar prices omit cents. Set sound to opt into a short synthesized tone on confirmation.
HTML and vanilla JavaScript
import { mount } from './cart-reveal/src/core';
import './cart-reveal/src/styles.css';
const host = document.querySelector<HTMLElement>('#cart')!;
const controller = mount(host, { title: 'Relay Trail 01' });
host.addEventListener('cartconfirm', (event) => {
const { quantity, total } = (event as CustomEvent).detail;
console.log(quantity, total);
});
controller.update({ price: 82 });render(settings) returns the closed tile for static output. mount replaces the host contents. Call destroy() when removing the instance. The callback and bubbling event report demo confirmation. Connect any purchase flow in the host application.
Input and motion
Activate the tile to reveal its details. In a container at least 600px wide with space for two card widths (604px at the default size), the photo stays on the left and the panel opens to its right. In a narrower container the details unfold below the photo, with the confirmation slider spanning the available inner width. The cart opens with one item. Press the shopping cart button to add another. Hover or focus the quantity controls to reveal the minus button, which is always visible on touch devices when an item can be removed. At zero, the confirmation control announces that the cart is empty.
Drag the thumb to the far end and release to confirm. Releasing partway returns it to the start. The center label also confirms with a single click or tap. When the thumb is focused, arrow keys adjust its position. Home returns it to the start. End, Enter or Space confirm. The handle shows a check before the details close to the receipt (34px at the defaults). The receipt clears automatically. The next cart starts with quantity one.
Reduced motion and paused apply cart movements immediately. Confirmation fires once per cart. Pointer cancellation returns the handle to its starting position. Hidden or offscreen instances finish the current subtotal update. The closed panel follows standard keyboard focus order when reopened.
Tuning the card
radius adjusts the silhouette and the matching image corner. accent sets the quantity badge, the saved heart and its burst. The default accent is #E0182D. The receipt uses a #2FBF5F success indicator.
foldSpeed adjusts the details fold and subtotal counter. confirmSpeed adjusts the handle return and the transition into the receipt. Both are playback multipliers with a default of 1. In **Text entrance**, textEntranceSpeed scales the 480 ms row entrance and textStagger sets the interval between rows, initially 55 ms. Set the stagger to zero for simultaneous entrances. The thumb can be picked up during its return. It continues from its painted position.
confirmThreshold sets how far the thumb must travel before release commits, as a percentage of the available track. Its default is 92. receiptDuration sets the receipt dwell in milliseconds. Changing appearance and motion controls preserves the current quantity and open state.
Set the theme prop to light for the porcelain finish or dark for graphite. Changing the finish preserves the open cart and its quantity.
Confirmation copy and wishlist
Set confirmLabel to change the rail button and the keyboard slider’s accessible name. A completed slide shows “Order placed” on the rail. The folded card then shows a green check and “Confirmed”. Set receiptText to change the visible receipt and the live success announcement. The announcement includes the quantity and total. Short labels fit the rail at its default width.
Drag the handle or start on the rail text and release at the end to confirm. The light theme uses a white wishlist button with a dark heart. The dark theme uses a dark button with a white heart. Saved items keep the accent colour in both themes.
Set showWishlist={false} to hide the heart and remove it from keyboard navigation. Showing it again restores its saved state. All three settings can change while the card is open, using React props or controller.update().
Icon credits
Functional icons come from Lucide. The bundled license includes the ISC and Feather MIT notices. Lucide
The preview groups controls by card part. Use cardWidth and framePadding for the frame, mediaHeight for the image proportions, and imageFocusX, imageFocusY and imageScale to compose the photograph. The image height setting is measured at a reference width of 272px and scales with the card.
The details fold adapts to your title, spacing, subtotal type and quantity button sizes. trackHeight and thumbInset size the thumb and recalculate its travel. keyboardStep sets travel per arrow press. subtotalDuration and confirmHold set base durations in milliseconds for the subtotal and “Order placed” respectively. The hold is independent of handle speed. Under **Order confirmation**, glowColor and glowStrength control the bottom wash. The default is #269a5a at 24%. A strength of zero hides the wash. Reduced motion skips the wash and retains the message hold. The receipt height follows its top spacing, type and badge size. Every preview control is also a React prop and a vanilla controller.update setting.
The preview runs the component’s own JavaScript. It respects reduced motion and pauses when off screen. The HTML bundle includes a static fallback.
Every setting in this panel comes from the component manifest. Preview size, pause and replay stay in the inspector.