chevron-double-right

An animated double-right chevron icon for React that nudges right twice on hover, built with motion/react. It can run on its own hover state or be driven imperatively through a ref with startAnimation and stopAnimation.

chevron-double-right
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-right

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

Usage

usage.tsx
import { ChevronDoubleRightIcon } from '@/components/ui/chevron-double-right';<ChevronDoubleRightIcon />
  • Next, forward, or skip-ahead buttons and pagination controls where a double chevron signals jumping several steps
  • Breadcrumbs or navigation trails that need a subtle hover cue
  • Carousels or timelines that should advance on hover or on click via an imperative ref
  • Settings or menu rows where a motion hint replaces a static arrow

Examples

Hover-triggered next link

Default uncontrolled usage. Hovering the wrapper plays the nudge animation.

hover-triggered-next-link.tsx
import { ChevronDoubleRightIcon } from '@/components/ui/chevron-double-right';export function NextPageLink() {  return (    <div className='inline-flex items-center gap-1 text-sm font-medium'>      <span>Next page</span>      <ChevronDoubleRightIcon size={16} />    </div>  );}

Imperative control via ref

Parent controls the animation with startAnimation and stopAnimation. Hover handlers from the icon are forwarded to props rather than auto-playing.

imperative-control-via-ref.tsx
import { useRef } from 'react';import { ChevronDoubleRightIcon, type ChevronDoubleRightIconHandle } from '@/components/ui/chevron-double-right';export function SkipButton() {  const ref = useRef<ChevronDoubleRightIconHandle>(null);  return (    <div className='flex items-center gap-2'>      <button type='button' onClick={() => ref.current?.startAnimation()}>        Skip      </button>      <ChevronDoubleRightIcon ref={ref} size={20} />    </div>  );}

Custom size and color

Size is set with the size prop and color is inherited via currentColor, so Tailwind text utilities apply.

custom-size-and-color.tsx
import { ChevronDoubleRightIcon } from '@/components/ui/chevron-double-right';export function ForwardControl() {  return (    <ChevronDoubleRightIcon size={24} className='cursor-pointer text-blue-600 hover:text-blue-800' />  );}

Decorative icon in a menu row

Marks the icon as decorative so screen readers skip it, while the row label carries the meaning.

decorative-icon-in-a-menu-row.tsx
import { ChevronDoubleRightIcon } from '@/components/ui/chevron-double-right';export function MenuRow() {  return (    <div className='flex items-center justify-between rounded-md px-3 py-2 hover:bg-muted'>      <span>Advanced options</span>      <ChevronDoubleRightIcon aria-hidden='true' className='text-muted-foreground' />    </div>  );}

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 outer wrapper div (passed through cn). The SVG itself has no className.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse enter. When the ref is attached (controlled mode), this is the only action taken; the built-in hover animation is skipped. Otherwise the hover animation runs and this is also called only through the internal handler.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse leave. In controlled mode it replaces the built-in return-to-rest animation.
...HTMLAttributes<HTMLDivElement>React.HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, aria-*, role, style, data-*, etc.) are spread onto the outer wrapper div. Spreading comes after the internal handlers, so an onMouseEnter passed here is overridden by the internal one.
refRef<ChevronDoubleRightIconHandle>—Imperative handle exposing startAnimation() (plays the nudge) and stopAnimation() (returns to rest). Attaching a ref switches the component into controlled mode for hover.

Accessibility

  • The SVG has no title, role, or aria-label. If the icon conveys meaning on its own, add an aria-label or role='img' to the wrapper, or pair it with visible text.
  • When the icon is purely decorative, pass aria-hidden='true' so screen readers ignore it.
  • Hover-only animation is not available on touch devices. Do not rely on it to reveal information or state; keep the control's label and behavior fully usable without it.
  • The component does not check prefers-reduced-motion. If motion sensitivity matters for your UI, gate startAnimation calls on a media query check in your own code.
  • Wrap the icon in an interactive element (button or link) that provides focus and keyboard activation; the icon itself is not focusable and does not respond to keyboard events.
  • The outer element is a div, so avoid placing it inside a button or anchor without verifying HTML content-model rules for your markup.

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-right" component (heroicons-animated/chevron-double-right) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/chevron-double-right2. 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 { ChevronDoubleRightIcon } from '@/components/ui/chevron-double-right';<ChevronDoubleRightIcon />```

Files & dependencies

  • chevron-double-right.tsx
dependenciesmotion

Looks similar, elsewhere