sort-by-up-01
An animated sort-by-up icon that plays a one-shot motion on hover: the arrow on the right bounces upward while the two stacked value boxes on the left scale and shift in a staggered way. It is a React component built on motion/react and forwards a ref with imperative start/stop controls.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @hugeicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { SortByUp01Icon } from '@/components/ui/sort-by-up-01';export function Example() { return <SortByUp01Icon size={24} className='text-foreground' />;}- Sorting controls in tables, lists, or toolbars where ascending order should be signaled, such as a column header or sort toggle.
- Buttons or menu items that trigger an ascending sort or reorder action and need a subtle hover affordance.
- Dashboards or filter bars where a playful but restrained micro-interaction should reinforce ordering actions.
- Cases where the animation should be triggered programmatically (for example after a sort is applied) through the forwarded ref instead of hover.
Examples
Sortable table column header
Shows the icon next to a column label. The animation plays when the pointer enters the header.
import { SortByUp01Icon } from '@/components/ui/sort-by-up-01';export function SortableHeader({ label }: { label: string }) { return ( <button type='button' className='inline-flex items-center gap-1.5 text-sm font-medium'> <span>{label}</span> <SortByUp01Icon size={16} className='text-muted-foreground hover:text-foreground' /> </button> );}Programmatic trigger via ref
Uses the exported SortByUp01IconHandle to start the animation after a sort is applied. Hover handling is disabled while a ref is attached.
import { useRef } from 'react';import { SortByUp01Icon, type SortByUp01IconHandle } from '@/components/ui/sort-by-up-01';export function SortApplyButton({ onSort }: { onSort: () => void }) { const iconRef = useRef<SortByUp01IconHandle>(null); return ( <button type='button' onClick={() => { onSort(); iconRef.current?.startAnimation(); }} className='inline-flex items-center gap-2 rounded-md border px-3 py-2' > <SortByUp01Icon ref={iconRef} size={20} /> <span>Sort ascending</span> </button> );}Menu item with hover callbacks
Passes onMouseEnter and onMouseLeave through to the wrapping div. The internal animation handler still runs alongside these callbacks.
import { SortByUp01Icon } from '@/components/ui/sort-by-up-01';export function SortMenuItem() { return ( <div role='menuitem' tabIndex={0} className='flex items-center gap-2 rounded px-2 py-1.5 hover:bg-accent' > <SortByUp01Icon size={18} onMouseEnter={() => console.log('hover start')} onMouseLeave={() => console.log('hover end')} /> <span>Name, A to Z</span> </div> );}API reference
Accessibility
- The SVG has no title, desc, or role attribute, so it is decorative by default. When the icon is the only content of a control, add aria-label to the interactive parent or include visually hidden text.
- The wrapper is a plain div with no implicit role or keyboard handling. If it acts as a control, put it inside a button or give it role, tabIndex, and key handlers.
- Animation is skipped when the user has prefers-reduced-motion enabled, via useReducedMotion from motion/react, so no motion is shown to those users.
- Because hover is the only default trigger, keyboard users will not see the animation unless it is started through the ref; the icon's meaning should be conveyed by adjacent text or labels, not by the animation.
- Color contrast depends on the inherited currentColor, so ensure the text color meets WCAG contrast against the 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 "sort-by-up-01" component (hugeicons-animated/sort-by-up-01) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/sort-by-up-012. 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 { SortByUp01Icon } from '@/components/ui/sort-by-up-01';export function Example() { return <SortByUp01Icon size={24} className='text-foreground' />;}```Files & dependencies
- icons/sort-by-up-01.tsx
- lib/use-icon-animation.ts