scissors

An animated scissors icon for React, built on Motion and an SVG outline. On hover it briefly squashes vertically to mimic the blades closing, and it can also be driven programmatically through a ref.

scissors
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/scissors

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

Usage

usage.tsx
import { ScissorsIcon } from "@/components/ui/scissors";export function Example() {  return <ScissorsIcon size={28} className="text-foreground" />;}
  • Adding a playful cutting or trimming cue next to a crop, cut, or edit action in a toolbar or menu.
  • Decorating a CTA or menu item where a subtle hover animation adds personality without a large motion budget.
  • Showing a 'clip' or 'split' affordance in a media, text, or document editor.
  • Triggering the snip animation from application state (for example after a successful cut) via the imperative ref API.

Examples

Hover-animated icon in a toolbar

The default hover behavior. The icon animates automatically on mouse enter and resets on mouse leave, with no ref needed.

hover-animated-icon-in-a-toolbar.tsx
import { ScissorsIcon } from "@/components/ui/scissors";export function CutToolbarButton() {  return (    <button type="button" className="inline-flex items-center gap-2 rounded-md px-3 py-2 hover:bg-accent">      <ScissorsIcon size={20} />      <span>Cut</span>    </button>  );}

Programmatic control via ref

Attaching a ref makes the component controlled. Hover no longer animates by itself, and you call startAnimation and stopAnimation yourself.

programmatic-control-via-ref.tsx
import { useRef } from "react";import { ScissorsIcon, type ScissorsIconHandle } from "@/components/ui/scissors";export function SnipOnSave() {  const iconRef = useRef<ScissorsIconHandle>(null);  return (    <div className="flex items-center gap-3">      <ScissorsIcon ref={iconRef} size={32} />      <button        type="button"        onClick={() => {          iconRef.current?.startAnimation();          window.setTimeout(() => iconRef.current?.stopAnimation(), 300);        }}      >        Trim clip      </button>    </div>  );}

Custom hover handlers in controlled mode

When a ref is attached, onMouseEnter and onMouseLeave are forwarded to your handlers instead of the built-in animation, so you can combine them with your own logic.

custom-hover-handlers-in-controlled-mode.tsx
import { useRef } from "react";import { ScissorsIcon, type ScissorsIconHandle } from "@/components/ui/scissors";export function TrackedScissors() {  const iconRef = useRef<ScissorsIconHandle>(null);  return (    <ScissorsIcon      ref={iconRef}      size={24}      className="cursor-pointer text-muted-foreground"      onMouseEnter={() => {        iconRef.current?.startAnimation();        console.log("hovered");      }}      onMouseLeave={() => iconRef.current?.stopAnimation()}    />  );}

Sized to match adjacent text

The size prop sets both width and height of the SVG. Any other div attributes such as aria-label are spread onto the wrapper element.

sized-to-match-adjacent-text.tsx
import { ScissorsIcon } from "@/components/ui/scissors";export function InlineScissors() {  return (    <p className="text-base">      Tap      <ScissorsIcon size={16} className="mx-1 inline-block align-middle" aria-label="scissors" role="img" />      to split the clip.    </p>  );}

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). Use it to set color via currentColor, margins, or layout.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler on the wrapper div. Without a ref it runs alongside the built-in animation. With a ref attached, it replaces the built-in animation and is called instead of starting it.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler on the wrapper div. Without a ref the built-in reset runs. With a ref attached, it replaces the built-in reset and is called instead.
refReact.Ref<ScissorsIconHandle>—Exposes ScissorsIconHandle with startAnimation() (plays the scale pulse) and stopAnimation() (returns to the normal state). Attaching a ref switches the component into controlled mode.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, role, data-*, event handlers) are spread onto the wrapper div.

Accessibility

  • The icon is decorative by default and has no text alternative. If it conveys meaning, add role="img" and an aria-label (or aria-labelledby) through the spread div props, since the SVG itself has no title element.
  • If the icon sits inside a button or link with visible text, mark it aria-hidden="true" so screen readers do not announce a duplicate or unclear label.
  • Motion is a brief single pulse of about 0.25s, but respect prefers-reduced-motion by gating startAnimation calls in controlled mode, or by avoiding hover-only triggers for essential information.
  • Hover-only animation is not reachable by keyboard users. Do not rely on it to communicate state. Pair it with a focusable control and a text label.
  • The icon uses currentColor, so it keeps the text color and inherits focus or disabled styling from its parent. Make sure the parent meets contrast requirements.

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 "scissors" component (heroicons-animated/scissors) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/scissors2. 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 { ScissorsIcon } from "@/components/ui/scissors";export function Example() {  return <ScissorsIcon size={28} className="text-foreground" />;}```

Files & dependencies

  • scissors.tsx
dependenciesmotion

Looks similar, elsewhere