shopping-cart-add-01
An animated shopping cart outline icon with a plus badge that pops in and the cart and wheels bounce on hover. It is built on motion/react and is controllable through a ref with startAnimation and stopAnimation.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @hugeicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { ShoppingCartAdd01Icon } from '@/icons/shopping-cart-add-01';export default function Example() { return <ShoppingCartAdd01Icon size={28} className="text-foreground" />;}- Add-to-cart buttons or product cards where the icon should animate on hover to signal that an item was added.
- E-commerce headers or navigation that need a cart icon with a playful, lightweight micro-interaction.
- Empty-state or onboarding UI that shows the cart being filled, controlled by a ref when an action completes.
- Places where a static cart glyph is too plain and a subtle motion accent helps draw attention without heavy animation.
Examples
Basic hover icon
Plays the add-to-cart animation once each time the pointer enters the icon.
import { ShoppingCartAdd01Icon } from '@/icons/shopping-cart-add-01';export default function BasicExample() { return <ShoppingCartAdd01Icon />;}Larger icon with color and aria label
Sets a larger size and a text color via className, and exposes an accessible name on the wrapper.
import { ShoppingCartAdd01Icon } from '@/icons/shopping-cart-add-01';export default function LabeledExample() { return ( <div role="img" aria-label="Add to cart" className="inline-flex text-emerald-600"> <ShoppingCartAdd01Icon size={40} /> </div> );}Controlled via ref
Triggers the animation programmatically, for example after a successful add action. Hover is ignored while a ref is attached.
'use client';import { useRef } from 'react';import { ShoppingCartAdd01Icon, type ShoppingCartAdd01IconHandle } from '@/icons/shopping-cart-add-01';export default function ControlledExample() { const iconRef = useRef<ShoppingCartAdd01IconHandle>(null); return ( <div className="flex items-center gap-3"> <ShoppingCartAdd01Icon ref={iconRef} size={32} /> <button type="button" onClick={() => iconRef.current?.startAnimation()}> Add item </button> </div> );}API reference
Accessibility
- The SVG has no title or role, so the icon is decorative by default. Provide an accessible name by wrapping it in an element with role="img" and aria-label, or with aria-hidden="true" when a text label already exists nearby.
- Interactive use should put the icon inside a focusable control such as a button or link that carries the action name, since the wrapper div itself is not focusable.
- Animation respects prefers-reduced-motion through useReducedMotion, so no motion plays for users who request reduced motion.
- Hover-only animation gives no feedback to keyboard or touch users. Make sure the surrounding control conveys its state through text or other cues.
- The icon uses currentColor, so it keeps sufficient contrast when the parent sets an accessible text color.
Docs written by anthropic:claude-haiku-5-5 from the registry source.
Use with Coding Agent
Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.
Use the "shopping-cart-add-01" component (hugeicons-animated/shopping-cart-add-01) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/shopping-cart-add-012. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, className, onMouseEnter, onMouseLeave, ref, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ShoppingCartAdd01Icon } from '@/icons/shopping-cart-add-01';export default function Example() { return <ShoppingCartAdd01Icon size={28} className="text-foreground" />;}```Files & dependencies
- icons/shopping-cart-add-01.tsx
- lib/use-icon-animation.ts