coffee-02

coffee-02 is an animated coffee cup icon with three steam wisps that rise, fade out, and regrow in a loop. It plays on mouse hover or through an imperative ref handle, and it respects the user's reduced-motion setting.

coffee-02
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add @hugeicons-animated/coffee-02

Requires @hugeicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { Coffee02Icon } from '@/components/icons/coffee-02';export function Example() {  return <Coffee02Icon />;}
  • Coffee, café, cafe ordering, or beverage menu items where a hot-drink cue is needed
  • Hover-activated feedback on buttons, cards, or navigation links that carry a coffee or break theme
  • Loading or 'brewing' indicators where a looping steam motion communicates activity, controlled through the ref handle
  • Replacing a static coffee icon when a subtle, playful micro-interaction improves engagement

Examples

Basic hover icon

Renders the icon at its default 28px size. The steam loop starts when the pointer enters the icon and returns to rest when it leaves.

basic-hover-icon.tsx
import { Coffee02Icon } from '@/components/icons/coffee-02';export function BasicExample() {  return <Coffee02Icon />;}

Sized and colored with className

Sets a larger size and a text color through the size prop and className. Color flows into the strokes via currentColor.

sized-and-colored-with-classname.tsx
import { Coffee02Icon } from '@/components/icons/coffee-02';export function SizedExample() {  return <Coffee02Icon size={40} className='text-amber-700' />;}

Controlled animation via ref

Uses the ref handle to start and stop the steam loop programmatically, for example while a brew request is in progress. Hover-driven playback is disabled once the ref is attached.

controlled-animation-via-ref.tsx
import { useEffect, useRef } from 'react';import type { Coffee02IconHandle } from '@/components/icons/coffee-02';import { Coffee02Icon } from '@/components/icons/coffee-02';export function BrewingStatus({ isBrewing }: { isBrewing: boolean }) {  const iconRef = useRef<Coffee02IconHandle>(null);  useEffect(() => {    if (isBrewing) {      iconRef.current?.startAnimation();    } else {      iconRef.current?.stopAnimation();    }  }, [isBrewing]);  return <Coffee02Icon ref={iconRef} size={32} />;}

Inside a button with a label

Places the icon next to a text label inside a button. The icon is decorative, so it is hidden from assistive technology and the label supplies the name.

inside-a-button-with-a-label.tsx
import { Coffee02Icon } from '@/components/icons/coffee-02';export function OrderButton() {  return (    <button type='button' className='inline-flex items-center gap-2 rounded-md border px-4 py-2'>      <span aria-hidden='true'>        <Coffee02Icon size={20} />      </span>      Order coffee    </button>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. Applied to both attributes; the viewBox stays 0 0 24 24.
refReact.Ref<Coffee02IconHandle>—Forwarded ref exposing startAnimation() and stopAnimation(). Attaching it disables hover-triggered playback so the consumer controls the animation. stopAnimation only takes effect for looping icons, which this one is.
classNamestring—Applied to the outer div wrapper via cn(className). Use it for color (through currentColor), margins, or layout.
onMouseEnterMouseEventHandler<HTMLDivElement>—Called on pointer enter before the animation starts. Destructured from props and forwarded to the internal hook.
onMouseLeaveMouseEventHandler<HTMLDivElement>—Called on pointer leave before the animation is stopped. Destructured from props and forwarded to the internal hook.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, data-*, event handlers) are spread onto the outer div wrapper, not the svg.

Accessibility

  • The component sets no role, aria-label, or title. For a meaningful icon, pass aria-label and role='img' through the spread props on the wrapper. For a decorative icon next to visible text, wrap it in an element with aria-hidden='true'.
  • The steam animation is skipped when the user has enabled reduced motion (useReducedMotion from motion/react). The icon then stays in its resting pose.
  • The animation runs continuously while active (loops are infinite), so avoid leaving it running on screens where it adds distraction. Use the ref handle to stop it.
  • Animation is driven by pointer hover, so keyboard-only users get no visual cue. Pair it with focus styles on the interactive parent and do not rely on the motion alone to convey meaning.
  • The SVG inherits its color from currentColor, so it keeps sufficient contrast when the parent text color meets WCAG contrast requirements.

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.

prompt.md
Use the "coffee-02" component (hugeicons-animated/coffee-02) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/coffee-022. 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, ref, className, onMouseEnter, onMouseLeave, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { Coffee02Icon } from '@/components/icons/coffee-02';export function Example() {  return <Coffee02Icon />;}```

Files & dependencies

  • icons/coffee-02.tsx
  • lib/use-icon-animation.ts
dependenciesmotion

Looks similar, elsewhere