chevron-double-left

An animated double-left chevron icon for React that nudges leftward on hover, built with motion. It exposes a ref handle so parents can trigger or stop the animation manually.

chevron-double-left
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 @heroicons-animated/chevron-double-left

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

Usage

usage.tsx
import { ChevronDoubleLeftIcon } from "@/components/ui/chevron-double-left";export default function Example() {  return <ChevronDoubleLeftIcon />;}
  • Previous or back-navigation controls in pagination, carousels, or timelines that skip multiple pages
  • Fast-rewind or jump-to-start affordances in media players and date pickers
  • Buttons or links where a subtle hover motion should reinforce a leftward action
  • Controlled demos or onboarding flows where an animation should be triggered programmatically via ref

Examples

Basic hover animation

Renders the icon with default size 28. The animation plays on mouse enter and reverses on mouse leave.

basic-hover-animation.tsx
import { ChevronDoubleLeftIcon } from "@/components/ui/chevron-double-left";export default function Demo() {  return <ChevronDoubleLeftIcon />;}

Programmatic control via ref

Attaching a ref switches the component into controlled mode, so hover no longer animates on its own and the parent calls startAnimation or stopAnimation.

programmatic-control-via-ref.tsx
import { useRef } from "react";import { ChevronDoubleLeftIcon, type ChevronDoubleLeftIconHandle } from "@/components/ui/chevron-double-left";export default function Demo() {  const iconRef = useRef<ChevronDoubleLeftIconHandle>(null);  return (    <button      type="button"      onClick={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}      className="inline-flex items-center gap-2 rounded-md border px-3 py-2"    >      <ChevronDoubleLeftIcon ref={iconRef} size={20} />      Previous    </button>  );}

Custom size and color

Size is set through the size prop and color is controlled with a Tailwind text utility, since the stroke uses currentColor. The icon is decorative here, so it is hidden from assistive tech.

custom-size-and-color.tsx
import { ChevronDoubleLeftIcon } from "@/components/ui/chevron-double-left";export default function Demo() {  return <ChevronDoubleLeftIcon size={32} className="text-emerald-500" aria-hidden="true" />;}

Accessible pagination button

Wraps the icon in an interactive element with an accessible name, keyboard focus, and a click handler so the icon is not the only label.

accessible-pagination-button.tsx
import { ChevronDoubleLeftIcon } from "@/components/ui/chevron-double-left";export default function Demo() {  return (    <div      role="button"      tabIndex={0}      aria-label="Go back 10 pages"      onKeyDown={(e) => { if (e.key === "Enter" || e.key === " ") e.preventDefault(); }}      className="inline-flex cursor-pointer rounded-md p-2 hover:bg-accent focus-visible:ring-2"    >      <ChevronDoubleLeftIcon aria-hidden="true" />    </div>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the rendered SVG in pixels.
classNamestring—Class names applied to the outer div wrapper (from HTMLAttributes<HTMLDivElement>).
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse enter. When a ref is attached (controlled mode), the built-in hover animation is skipped and only this callback runs.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse leave. In controlled mode the built-in reverse animation is skipped and only this callback runs.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, role, tabIndex, event handlers) are spread onto the outer wrapper div.
refReact.Ref<ChevronDoubleLeftIconHandle>—Exposes startAnimation() and stopAnimation() through ChevronDoubleLeftIconHandle. Attaching a ref enables controlled mode.

Accessibility

  • The SVG has no title or role, so the icon is announced as nothing by default; wrap it in a button or link with aria-label, or set aria-hidden="true" when the surrounding control already has a text label.
  • Hover motion is purely decorative and conveys no state; do not rely on it alone to communicate that an action is available.
  • When used inside a button, avoid nesting the wrapper div (it is a block-level element) and prefer a span-based wrapper or pass the icon as the sole child of an element with an accessible name.
  • Respect reduced motion preferences by avoiding programmatic startAnimation calls for users who opt out, since the component does not read prefers-reduced-motion itself.
  • Keyboard users get the same visual feedback only if you call startAnimation on focus, because the built-in animation is triggered by mouse events only.

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 "chevron-double-left" component (heroicons-animated/chevron-double-left) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/chevron-double-left2. 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, ...HTMLAttributes<HTMLDivElement>, ref.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ChevronDoubleLeftIcon } from "@/components/ui/chevron-double-left";export default function Example() {  return <ChevronDoubleLeftIcon />;}```

Files & dependencies

  • chevron-double-left.tsx
dependenciesmotion

Looks similar, elsewhere