BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/motiq/cart-item-transition

Cart Item Transition

motiq/cart-item-transition
FreeComponent

An app-controlled animated cart LINE ITEM (not a full cart) — arrival, quantity/total morph, variant crossfade, price-change, limited/unavailable, removal→Undo→restore, with optimistic mutation + automatic rollback and honest failed/Retry. Never touches a backend or payment; price/inventory are app-owned. No manipulative urgency.

Live preview

live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://www.motiq.dev/r/cart-item-transition.json

Source

registry/commerce/cart-item-transition.tsxwww.motiq.dev/r/cart-item-transition.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import { motion, AnimatePresence } from "motion/react";
5
6import { cn } from "@/lib/utils";
7import {
8 useOptimisticAction,
9 useReducedMotion,
10 useAnimatedNumber,
11 formatNumber,
12 statusVars,
13 type OptimisticPhase,
14 type StatusTone,
15} from "@/lib/motiq";
16
17/**
18 * CartItemTransition — a single, app-controlled cart LINE ITEM that animates the
19 * realistic transitions a line goes through in a real cart: it arrives, its
20 * quantity and total change (optimistically, with rollback if the app's mutation
21 * fails), a variant is swapped, the price changes, stock turns limited or
22 * unavailable, it is removed, and it can be undone. It is NOT a cart, a
23 * checkout, or a store: it never fetches, prices, decides stock, mutates a
24 * backend, or touches payment. The host app owns every fact — unit price, line
25 * total, availability, inventory copy, discounts — and every side-effect runs
26 * through the app's async callbacks.
27 *
28 * What earns its keep over a static product card: an optimistic quantity/remove
29 * flow with automatic rollback + an honest failed/retry state, a price-change
30 * treatment that morphs the number *and* always states it as text (old → new,
31 * never colour alone), a variant-replace crossfade, an app-owned
32 * limited/unavailable state, and a remove → Undo affordance with correct focus
33 * management throughout.
34 *
35 * Deliberately NOT included: no exaggerated fly-to-cart arc, no manufactured
36 * urgency ("only 2 left!" countdowns), no invented discounts or stock. Inventory
37 * and price copy come from the app verbatim.
38 *
39 * Accessibility: quantity steppers are real <button>s with explicit labels and a
40 * text readout; price and price-change are rendered as text (never conveyed by
41 * animation or colour alone); limited/unavailable is stated in words with an
42 * icon; remove and undo are keyboard operable; focus is preserved on the pressed
43 * quantity control after a change, moves to Undo after a removal, and falls back
44 * to a stable control after undo; every transition renders in its final state
45 * under prefers-reduced-motion. Clean-room original.
46 */
47
48/* -------------------------------------------------------------------------- */
49/* Types */
50/* -------------------------------------------------------------------------- */
51
52/** App-owned availability of the line. Inventory *copy* is separate + verbatim. */
53// … truncated

What it pulls in

npm packages

  • motion

Other registry items

  • https://motiq.dev/r/utils.json
  • https://motiq.dev/r/primitives.json

Files it writes

  • registry/commerce/cart-item-transition.tsx

Facts

Registry
motiq
Type
registry:component
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

Docs on motiq www.motiq.dev RMahammad/motiq on GitHub Raw registry item This item as JSON

More from motiq

All 100 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Activity Streamactivity-streammotiqComponentsFree1 dep
Adaptive Safe-Zone Gridadaptive-safe-zone-gridmotiqComponentsFreeno deps
Agent Run Timelineagent-run-timelinemotiqComponentsFree1 dep
AI Response Streamai-response-streammotiqComponentsFree1 dep
Animated Accordionanimated-accordionmotiqComponentsFree2 deps
Animated Buttonanimated-buttonmotiqComponentsFree1 dep
Animated Dialoganimated-dialogmotiqComponentsFree2 deps
Animated Gridanimated-gridmotiqComponentsFree2 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex