bars-arrow-down
An animated bars-arrow-down icon that draws three horizontal bars with a downward arrow at the right, and nudges the arrow down briefly on hover. It is a client component built on motion/react and can also be driven imperatively through a ref.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @heroicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { BarsArrowDownIcon } from '@/components/ui/bars-arrow-down';export function Example() { return <BarsArrowDownIcon size={24} className='text-neutral-700' />;}- Use as a sort-descending or order-by control in table headers, filter bars, or list toolbars.
- Use to signal a downward-ordered list or a 'sort by' menu item in dropdowns and command palettes.
- Use as a subtle hover-animated affordance in navigation or toolbar buttons where a static icon would feel flat.
- Avoid when the icon must communicate a plain 'download' or 'move down' action without an ordering meaning.
Examples
Sort button with hover animation
Uses the default hover behavior. The icon animates on mouse enter and resets on mouse leave without any extra wiring.
import { BarsArrowDownIcon } from '@/components/ui/bars-arrow-down';export function SortButton() { return ( <button type='button' className='inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm'> <BarsArrowDownIcon size={20} /> Sort </button> );}Controlled animation via ref
Passing a ref switches the icon to controlled mode: its own hover handlers only call the props you supply, so you decide when startAnimation and stopAnimation run.
import { useRef } from 'react';import { BarsArrowDownIcon, type BarsArrowDownIconHandle } from '@/components/ui/bars-arrow-down';export function SortColumnHeader() { const iconRef = useRef<BarsArrowDownIconHandle>(null); return ( <th onMouseEnter={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()} > <div className='flex items-center gap-1'> Date <BarsArrowDownIcon ref={iconRef} size={16} /> </div> </th> );}Sized and labeled icon
Changes the rendered SVG size and passes an accessible label through to the wrapper div, since extra HTML attributes are spread onto it.
import { BarsArrowDownIcon } from '@/components/ui/bars-arrow-down';export function SortAscendingLabel() { return ( <BarsArrowDownIcon size={32} className='text-emerald-600' role='img' aria-label='Sort descending' /> );}API reference
Accessibility
- The SVG has no title or desc element, so the icon is not announced by default. Give the wrapper an aria-label and role='img' when the icon conveys meaning, for example 'Sort descending'.
- If the icon is purely decorative next to visible text, add aria-hidden='true' so screen readers skip it.
- The wrapper div is not focusable and carries no keyboard behavior; the animation is hover-only, so keyboard users get no visual feedback unless the parent control also responds to focus and calls startAnimation through the ref.
- Respect reduced-motion preferences by calling stopAnimation or skipping startAnimation when prefers-reduced-motion is set, since the bounce is a continuous motion effect.
- Icon color comes from currentColor, so ensure the parent text color 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.
Use the "bars-arrow-down" component (heroicons-animated/bars-arrow-down) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/bars-arrow-down2. 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 { BarsArrowDownIcon } from '@/components/ui/bars-arrow-down';export function Example() { return <BarsArrowDownIcon size={24} className='text-neutral-700' />;}```Files & dependencies
- bars-arrow-down.tsx