Arrow Down A Z

ArrowDownAZIcon is an animated Lucide-style icon showing a downward arrow beside an A-to-Z sort glyph, where the letter side swaps vertically on hover. It is a forwardRef component that can also be driven imperatively through startAnimation and stopAnimation.

Arrow Down A Z
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/arrow-down-a-z.json

Usage

usage.tsx
import { ArrowDownAZIcon } from '@/components/ui/arrow-down-a-z';export function Example() {  return <ArrowDownAZIcon size={28} className='text-foreground' />;}
  • Sort controls or table headers that need an A-to-Z ascending sort affordance with a playful hover animation
  • Toolbar or menu items where a sort-by-name action should be visually distinct from the descending variant
  • Imperatively triggering the swap animation when a sort is applied, for example from a button click via ref
  • Marketing or dashboard UI that needs a lightweight, motion-based icon built on the motion library

Examples

Hover-triggered icon

Default usage. The swap animation plays on mouse enter and reverses on mouse leave.

hover-triggered-icon.tsx
import { ArrowDownAZIcon } from '@/components/ui/arrow-down-a-z';export default function HoverIcon() {  return <ArrowDownAZIcon className='text-neutral-800 dark:text-neutral-200' />;}

Imperative control via ref

Attaching a ref switches the component to controlled mode. Hover no longer animates on its own (your onMouseEnter and onMouseLeave props are called instead), so you can start and stop the animation programmatically.

imperative-control-via-ref.tsx
import { useRef } from 'react';import { Button } from '@/components/ui/button';import { ArrowDownAZIcon, type ArrowDownAZIconHandle } from '@/components/ui/arrow-down-a-z';export default function SortButton() {  const iconRef = useRef<ArrowDownAZIconHandle>(null);  return (    <Button      variant='outline'      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    >      <ArrowDownAZIcon ref={iconRef} size={16} />      Sort A to Z    </Button>  );}

Sort toggle in a table header

Shows the icon in a column header and starts the animation while the sort is active.

sort-toggle-in-a-table-header.tsx
import { useEffect, useRef } from 'react';import { ArrowDownAZIcon, type ArrowDownAZIconHandle } from '@/components/ui/arrow-down-a-z';export function NameHeader({ sorted }: { sorted: boolean }) {  const ref = useRef<ArrowDownAZIconHandle>(null);  useEffect(() => {    if (sorted) ref.current?.startAnimation();    else ref.current?.stopAnimation();  }, [sorted]);  return (    <th className='flex items-center gap-2'>      <ArrowDownAZIcon ref={ref} size={20} />      Name    </th>  );}

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 (not the svg). Use it to set color with text utilities, or size and spacing. Passed through cn().
onMouseEnter(event: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler. When the component is controlled through a ref, this is called instead of the built-in hover animation. Otherwise it is also called by the component's own handler flow only when a ref is attached.
onMouseLeave(event: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler. Same controlled-mode behavior as onMouseEnter: when a ref is attached, this is called instead of the built-in reverse animation.
...propsOmit<HTMLAttributes<HTMLDivElement>, 'onMouseEnter' | 'onMouseLeave' | 'className'> (rest spread onto the wrapping div)—Any other standard div attributes such as id, style, aria-* and data-* are forwarded to the wrapping div.
refReact.Ref<ArrowDownAZIconHandle>—Exposes an imperative handle with startAnimation() (plays the swap) and stopAnimation() (returns to the resting state). Attaching a ref enables controlled mode. The ref does not point at the DOM element.

Accessibility

  • The icon is decorative by default. If it conveys meaning alone, add aria-label or a visually hidden text label on the wrapping element, since the svg has no title or role set in the source.
  • When the icon sits inside a button or link, put the accessible name on that interactive element and mark the icon with aria-hidden='true' to avoid duplicate announcements.
  • The animation is a short spring translation and does not blink or flash. For users who prefer reduced motion, consider disabling startAnimation calls with a prefers-reduced-motion check.
  • Hover-only animation gives no feedback to keyboard or touch users. Pair it with a visible focus style or an explicit state change so the sort state is not conveyed by motion alone.

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 "Arrow Down A Z" component (lucide-animated/arrow-down-a-z) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/arrow-down-a-z.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, ...props, ref.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ArrowDownAZIcon } from '@/components/ui/arrow-down-a-z';export function Example() {  return <ArrowDownAZIcon size={28} className='text-foreground' />;}```

Files & dependencies

  • arrow-down-a-z.tsx
dependenciesmotion

Looks similar, elsewhere