minus-sign
An animated minus sign icon that squashes horizontally and springs back when hovered. It is a 24x24 SVG line rendered at a configurable size and is controllable through a forwarded ref.
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 { MinusSignIcon } from '@/icons/minus-sign';export function Example() { return <MinusSignIcon />;}- Use as a decrement or collapse control, such as a quantity stepper's minus button or a 'remove' affordance.
- Use as a playful micro-interaction in a toolbar, menu, or icon button where a subtle hover squash adds feedback.
- Use when you need to trigger the squash programmatically (e.g., on validation or on a keyboard action) through the ref handle.
- Avoid when a static icon is preferred or when the motion would be distracting in dense data interfaces.
Examples
Quantity stepper decrement button
Wraps the icon in a button for a decrement control. The hover animation plays on the wrapping div, and the button handles the click.
import { MinusSignIcon } from '@/icons/minus-sign';export function QuantityDecrement({ onDecrement }: { onDecrement: () => void }) { return ( <button type='button' aria-label='Decrease quantity' onClick={onDecrement} className='inline-flex h-9 w-9 items-center justify-center rounded-md border'> <MinusSignIcon size={20} /> </button> );}Programmatic trigger via ref
Uses the forwarded ref to call startAnimation when an external event occurs. Once a ref is attached, hover no longer auto-plays the animation.
import { useRef } from 'react';import type { MinusSignIconHandle } from '@/icons/minus-sign';import { MinusSignIcon } from '@/icons/minus-sign';export function RemoveRow({ onRemove }: { onRemove: () => void }) { const iconRef = useRef<MinusSignIconHandle>(null); return ( <div className='flex items-center gap-2'> <MinusSignIcon ref={iconRef} size={24} className='text-red-500' /> <button type='button' onClick={() => { iconRef.current?.startAnimation(); onRemove(); }}> Remove </button> </div> );}Colored and sized icon in a toolbar
Sets size and color through the size prop and className, which applies to the wrapping div. The icon uses currentColor, so text color classes take effect.
import { MinusSignIcon } from '@/icons/minus-sign';export function ZoomOutTool() { return ( <div role='group' aria-label='Zoom controls' className='flex items-center gap-1'> <MinusSignIcon size={32} className='text-slate-700 dark:text-slate-200 cursor-pointer' /> </div> );}API reference
Accessibility
- The SVG has no role, title, or aria-hidden attribute, so a purely decorative use may be announced by some screen readers. Add aria-hidden='true' on the icon when it is decorative, or give the parent control an aria-label.
- When used as the only content of a button or link, provide an accessible name on the interactive element (for example aria-label='Decrease quantity').
- The animation respects the user's reduced-motion preference via useReducedMotion, which skips the squash animation when reduced motion is enabled.
- Because hover is the trigger, keyboard and touch users do not get the motion; the icon should not be the sole carrier of meaning.
- The animation is short (about 0.42s) and does not loop, so it does not create persistent motion.
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 "minus-sign" component (hugeicons-animated/minus-sign) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/minus-sign2. 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 { MinusSignIcon } from '@/icons/minus-sign';export function Example() { return <MinusSignIcon />;}```Files & dependencies
- icons/minus-sign.tsx
- lib/use-icon-animation.ts