Pause

PauseIcon is an animated pause (||) icon for shadcn/ui, built on motion/react. On hover it lowers the two bars slightly in a staggered bounce, and a ref handle lets you trigger the same animation programmatically.

Pause
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 https://lucide-animated.com/r/pause.json

Usage

usage.tsx
import { PauseIcon } from "@/components/ui/pause";export default function Example() {  return <PauseIcon />;}
  • Play/pause toggles in media players, podcasts, or audio controls where a hover cue reinforces the action
  • Playback or timer controls in dashboards, kiosks, or onboarding where a subtle motion draws attention to a pause button
  • Buttons or menu items that should animate when hovered or when a parent component triggers the animation through a ref
  • Replacing a static pause glyph with an animated one while keeping the same size and color inheritance as other Lucide-style icons

Examples

Basic hover animation

Renders the icon at the default 28px size. Hovering it runs the bounce animation automatically.

basic-hover-animation.tsx
import { PauseIcon } from "@/components/ui/pause";export default function BasicPause() {  return (    <div className="text-foreground">      <PauseIcon />    </div>  );}

Programmatic control with a ref

Passing a ref switches the component into controlled mode, so hover no longer animates it directly. Call startAnimation and stopAnimation from your own handlers.

programmatic-control-with-a-ref.tsx
import { useRef } from "react";import { PauseIcon, type PauseIconHandle } from "@/components/ui/pause";export default function ControlledPause() {  const iconRef = useRef<PauseIconHandle>(null);  return (    <button      type="button"      className="inline-flex items-center gap-2 rounded-md border px-3 py-2"      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}      onFocus={() => iconRef.current?.startAnimation()}      onBlur={() => iconRef.current?.stopAnimation()}    >      <PauseIcon ref={iconRef} size={20} />      Pause    </button>  );}

Custom size and color

The size prop sets the SVG width and height in pixels. Color comes from the className passed to the wrapper div, because the stroke is currentColor.

custom-size-and-color.tsx
import { PauseIcon } from "@/components/ui/pause";export default function ColoredPause() {  return (    <PauseIcon      size={40}      className="text-emerald-500 cursor-pointer"      aria-label="Pause playback"      role="img"    />  );}

Play/pause toggle

A media control that switches between a pause icon and the parent state. The icon animates on hover in uncontrolled mode when no ref is passed.

play/pause-toggle.tsx
import { useState } from "react";import { PauseIcon } from "@/components/ui/pause";export default function PlayPauseToggle() {  const [playing, setPlaying] = useState(false);  return (    <button      type="button"      aria-pressed={playing}      aria-label={playing ? "Pause" : "Play"}      onClick={() => setPlaying((p) => !p)}      className="rounded-full p-2 hover:bg-muted"    >      {playing ? <PauseIcon size={24} /> : <span className="block h-6 w-6" aria-hidden="true" />}    </button>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24, so the icon scales proportionally.
classNamestring—Class names applied to the wrapping div. Use it for color (via currentColor), margins, and layout.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse enter. When a ref is attached (controlled mode), this callback replaces the built-in hover animation, so you must start the animation yourself.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse leave. When a ref is attached (controlled mode), this callback replaces the built-in return-to-rest animation.
refReact.Ref<PauseIconHandle>—Forwarded ref exposing PauseIconHandle with startAnimation() and stopAnimation(). Attaching it switches the component to controlled mode.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, role, tabIndex, onClick, onFocus, etc.) are spread onto the wrapper div. Note that the wrapper is a div, not a button.

Accessibility

  • The SVG has no title, desc, or aria-label. If the icon conveys meaning on its own, pass role="img" and an aria-label through the props, or put the label on the parent button.
  • If the icon is decorative (for example, next to a visible text label), leave it unlabeled and add aria-hidden="true" to the wrapper via props so screen readers skip it.
  • The animation is triggered by mouse hover only by default. Keyboard users will not see it unless you connect startAnimation and stopAnimation to focus and blur, as shown in the controlled example.
  • The wrapper div is not focusable and has no role. When the icon acts as a control, place it inside a button or link so it has keyboard and screen reader semantics.
  • motion does not disable animations for prefers-reduced-motion by default. Wrap the app in MotionConfig with reducedMotion="user" if you need to respect that setting.
  • The default pause icon has no color of its own. Make sure the chosen currentColor meets contrast requirements against its background.

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 "Pause" component (lucide-animated/pause) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/pause.json2. 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, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { PauseIcon } from "@/components/ui/pause";export default function Example() {  return <PauseIcon />;}```

Files & dependencies

  • pause.tsx
dependenciesmotion

Looks similar, elsewhere