Cart Add

A shop page picks a color and size, then a cart drawer slides in with Checkout. A free, MIT-licensed Remotion product scene.

Installation
$ pnpm dlx shadcn@latest add @remocn/cart-add

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { CartAdd } from "@/components/remocn/cart-add";
 
const CartAddScene = () => (
  <CartAdd product="Trail Jacket" brand="northline" pickColor={2} accent="#3B5BFD" />
);
 
export const RemotionRoot = () => (
  <Composition
    id="CartAdd"
    component={CartAddScene}
    durationInFrames={400}
    fps={60}
    width={1280}
    height={720}
  />
);

A product page appears, a cursor picks a color swatch and a size, the price updates, and clicking Add to cart flies a thumbnail into a cart drawer that slides in with a free-shipping bar and Checkout button. Pass product, colors, sizes (label and price), and images (one per color) to match your shop. The theme prop ships light and dark.

The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. Pick another look with the ground preset prop.

Props29

PropTypeDefault
brand
string"fernway"

Brand name shown in the header and on the product.

product
string"Summit Bottle"

Product name shown on the page and in the cart.

category
string"Drinkware"

Small category label above the product name.

description
string"Double-wall steel keeps drinks cold for 24 hours. Leak-proof cap, powder-coat finish that never sweats."

Product description paragraph shown on the page.

rating
number4.8

Rating shown next to the review count.

reviews
string"2,184"

Review count text, for example 2,184.

colors
CartColor[]DEFAULT_COLORS

Color options as name and swatch pairs.

sizes
CartSize[]DEFAULT_SIZES

Size options with a label and numeric price each.

startColor
number0

Index of the color selected at the start.

pickColor
number1

Index of the color the cursor picks.

startSize
number1

Index of the size selected at the start.

pickSize
number2

Index of the size the cursor picks.

images
string[]—

Product image URLs, one per color. Defaults to a drawn illustration.

currency
string"$"

Currency symbol placed before prices.

freeShippingAt
number75

Order total that unlocks free shipping in the drawer bar.

addLabel
string"Add to bag"

Label of the main button before it is pressed.

addedLabel
string"Added to bag"

Label of the main button once the item is in the bag.

checkoutLabel
string"Checkout"

Button at the bottom of the bag drawer.

theme
"light" | "dark""light"

Light or dark page and drawer styling.

accent
string"#3B5BFD"

Accent color for selection, buttons and the progress bar.

ink
string—

Text color; overrides the theme ink.

fontFamily
string"Instrument Sans"

Typeface for the copy. Load the font in your project first.

scale
number1

Size of the foreground around the frame's center; the background stays put.

delay
number0

Frames to hold the first frame before anything moves.

speed
number1

Playback speed multiplier for the whole timeline.

ground
GshPresetId—

Preset id for the shader background.

background
string—

Solid fill in place of the gradient ground; pass "transparent" to drop it.

groundParams
Partial<GradientParams>—

Overrides for the shader background parameters.

url
string—

Declared in the props type but not used by the component.

  • brandstring

    Brand name shown in the header and on the product.

    Default"fernway"

  • productstring

    Product name shown on the page and in the cart.

    Default"Summit Bottle"

  • categorystring

    Small category label above the product name.

    Default"Drinkware"

  • descriptionstring

    Product description paragraph shown on the page.

    Default"Double-wall steel keeps drinks cold for 24 hours. Leak-proof cap, powder-coat finish that never sweats."

  • ratingnumber

    Rating shown next to the review count.

    Default4.8

  • reviewsstring

    Review count text, for example 2,184.

    Default"2,184"

  • colorsCartColor[]

    Color options as name and swatch pairs.

    DefaultDEFAULT_COLORS

  • sizesCartSize[]

    Size options with a label and numeric price each.

    DefaultDEFAULT_SIZES

  • startColornumber

    Index of the color selected at the start.

    Default0

  • pickColornumber

    Index of the color the cursor picks.

    Default1

  • startSizenumber

    Index of the size selected at the start.

    Default1

  • pickSizenumber

    Index of the size the cursor picks.

    Default2

  • imagesstring[]

    Product image URLs, one per color. Defaults to a drawn illustration.

  • currencystring

    Currency symbol placed before prices.

    Default"$"

  • freeShippingAtnumber

    Order total that unlocks free shipping in the drawer bar.

    Default75

  • addLabelstring

    Label of the main button before it is pressed.

    Default"Add to bag"

  • addedLabelstring

    Label of the main button once the item is in the bag.

    Default"Added to bag"

  • checkoutLabelstring

    Button at the bottom of the bag drawer.

    Default"Checkout"

  • theme"light" | "dark"

    Light or dark page and drawer styling.

    Default"light"

  • accentstring

    Accent color for selection, buttons and the progress bar.

    Default"#3B5BFD"

  • inkstring

    Text color; overrides the theme ink.

  • fontFamilystring

    Typeface for the copy. Load the font in your project first.

    Default"Instrument Sans"

  • scalenumber

    Size of the foreground around the frame's center; the background stays put.

    Default1

  • delaynumber

    Frames to hold the first frame before anything moves.

    Default0

  • speednumber

    Playback speed multiplier for the whole timeline.

    Default1

  • groundGshPresetId

    Preset id for the shader background.

  • backgroundstring

    Solid fill in place of the gradient ground; pass "transparent" to drop it.

  • groundParamsPartial<GradientParams>

    Overrides for the shader background parameters.

  • urlstring

    Declared in the props type but not used by the component.