Cart Button - React Component | Kokonut UI

Cart Button

An Add button that opens into a quantity stepper in place, with a bin at one and press-and-hold to repeat.

Install with npx shadcn@latest add https://kokonutui.com/r/cart-button.json, then show me how to use it.

Subtotal · 2 items
$5.20
Checkout

Installation

Cart Button is a free, open-source React component in the Kokonut UI Buttons collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/cart-button.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/cart-button

Or add it by hand: install its packages, then copy the source from above into components/kokonutui/cart-button.tsx.

npm install lucide-react motion

Usage

import CartButton from "@/components/kokonutui/cart-button";

export default function Example() {
  return <CartButton />;
}

Props

CartItem

Dependencies

Needs Version Comes from
lucide-react ^0.556.0 npm, installed by the CLI
motion ^12.23.25 npm, installed by the CLI
cn from lib/utils.ts shadcn init
React 19 Your app
Tailwind CSS 4 Your app

No provider, font or global CSS to set up: the file works as soon as it lands.