Disc 3

Disc3Icon is an animated disc icon from the lucide-animated registry that rotates two inner arcs around a circular disc when hovered. It can also be driven programmatically through a ref with start and stop methods.

Disc 3
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/disc-3.json

Usage

usage.tsx
import { Disc3Icon } from "@/components/ui/disc-3";export function Example() {  return <Disc3Icon className="text-foreground" />;}
  • Use as a decorative or interactive media icon for music, audio, CD, or disc-related UI such as player controls or playlist items.
  • Use as a hover-animated affordance inside buttons, nav items, or cards where a subtle spin signals interactivity.
  • Use with the ref API when the animation should be triggered by app state, such as a playing or loading status, instead of by pointer hover.

Examples

Basic hover animation

Renders the icon at its default 28px size. The arcs rotate when the pointer enters and reset when it leaves.

basic-hover-animation.tsx
import { Disc3Icon } from "@/components/ui/disc-3";export default function BasicExample() {  return (    <div className="flex items-center gap-2 text-foreground">      <Disc3Icon />      <span>Now playing</span>    </div>  );}

Controlled animation via ref

Attaches a ref to start and stop the rotation programmatically, for example while audio is playing. Once a ref is attached, hover no longer triggers the animation.

controlled-animation-via-ref.tsx
"use client";import { useRef } from "react";import { Disc3Icon, type Disc3IconHandle } from "@/components/ui/disc-3";export default function ControlledExample() {  const ref = useRef<Disc3IconHandle>(null);  return (    <div className="flex gap-2">      <button type="button" onClick={() => ref.current?.startAnimation()}>        Play      </button>      <button type="button" onClick={() => ref.current?.stopAnimation()}>        Stop      </button>      <Disc3Icon ref={ref} size={32} className="text-primary" />    </div>  );}

Icon inside a button with custom size

Uses a smaller size inside a labeled button. The icon is marked aria-hidden because the button text already describes the action.

icon-inside-a-button-with-custom-size.tsx
import { Disc3Icon } from "@/components/ui/disc-3";export default function ButtonExample() {  return (    <button      type="button"      className="inline-flex items-center gap-2 rounded-md border px-4 py-2 text-sm"    >      <Disc3Icon size={16} aria-hidden="true" />      Play album    </button>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. Applied to both the width and height attributes.
classNamestring—Class names applied to the wrapping div (passed through cn). Use text color utilities to change the stroke color.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on pointer enter. When the ref API is attached, this handler is called instead of starting the built-in animation.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on pointer leave. When the ref API is attached, this handler is called instead of resetting the built-in animation.
refReact.Ref<Disc3IconHandle>—Exposes startAnimation() (rotates the arcs to 90 degrees) and stopAnimation() (returns them to 0 degrees). Exported as the Disc3IconHandle interface.
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, data-*, onClick, etc.) are spread onto the wrapping div.

Accessibility

  • The component renders no role, label, or text. For decorative use, pass aria-hidden="true" so screen readers skip it.
  • When the icon conveys meaning on its own, wrap it in an element with role="img" and an aria-label, or place a visually hidden label next to it.
  • Inside a button or link, give the interactive element an accessible name (text or aria-label) and keep the icon aria-hidden.
  • The rotation is triggered only by pointer hover. Keyboard and touch users do not get the effect, so do not rely on it to convey state. Use the ref API to drive it from app state instead.
  • The component does not check prefers-reduced-motion. If motion sensitivity matters in your app, disable the animation by controlling it via the ref API or by wrapping the usage in a reduced-motion check.

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 "Disc 3" component (lucide-animated/disc-3) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/disc-3.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, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { Disc3Icon } from "@/components/ui/disc-3";export function Example() {  return <Disc3Icon className="text-foreground" />;}```

Files & dependencies

  • disc-3.tsx
dependenciesmotion

Looks similar, elsewhere