no-symbol

Animated no-symbol (prohibited) icon for React that pulses its circle and redraws its diagonal slash on hover or via an imperative ref. It is a 24x24 outline SVG rendered in currentColor and built on motion/react.

no-symbol
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/no-symbol

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

Usage

usage.tsx
import { NoSymbolIcon } from "@/components/ui/no-symbol";<NoSymbolIcon />
  • Show a blocked, disallowed, unavailable or prohibited state next to a label, button or menu item.
  • Add a playful hover micro-interaction to a 'not allowed' or 'disabled' indicator.
  • Use the imperative ref to trigger the animation from parent state, such as on row hover or on an error event.
  • Pick it over a static no-symbol icon when you want motion feedback without writing your own keyframes.

Examples

Hover animation on a blocked action button

The icon animates on hover by default, since the wrapper div handles mouse events internally when no ref is attached.

hover-animation-on-a-blocked-action-button.tsx
import { NoSymbolIcon } from "@/components/ui/no-symbol";export function BlockUserButton() {  return (    <button      type="button"      className="inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm"    >      <NoSymbolIcon size={16} />      Block user    </button>  );}

Controlled animation driven by a parent container

Attaching a ref switches the icon to controlled mode, so the parent decides when startAnimation and stopAnimation run.

controlled-animation-driven-by-a-parent-container.tsx
"use client";import { useRef } from "react";import { NoSymbolIcon, type NoSymbolIconHandle } from "@/components/ui/no-symbol";export function ControlledNoSymbol() {  const iconRef = useRef<NoSymbolIconHandle>(null);  return (    <div      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    >      <NoSymbolIcon ref={iconRef} size={32} className="text-red-500" />    </div>  );}

Disabled feature row with a styled icon

Uses className to color the icon through currentColor and sets a custom size for a compact status row.

disabled-feature-row-with-a-styled-icon.tsx
import { NoSymbolIcon } from "@/components/ui/no-symbol";export function UnavailableFeature() {  return (    <div className="flex items-center gap-2 text-sm text-muted-foreground">      <NoSymbolIcon size={20} className="text-amber-500" aria-label="Not available" />      <span>Export is not available on the free plan</span>    </div>  );}

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 via cn(). The SVG itself uses currentColor, so set text color on this element to recolor the icon.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse enter only when a ref is attached (controlled mode). In uncontrolled mode the built-in hover animation runs and this handler is not invoked.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse leave only when a ref is attached (controlled mode). In uncontrolled mode the built-in hover animation resets and this handler is not invoked.
refReact.Ref<NoSymbolIconHandle>—Exposes startAnimation() and stopAnimation() through NoSymbolIconHandle. Attaching a ref switches the component into controlled mode.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, data-*, etc.) are spread onto the outer wrapper div, not the SVG.

Accessibility

  • The SVG has no role or accessible name by default. If the icon conveys meaning (for example, 'not available'), add aria-label or a visually hidden text node, or set role="img" on the wrapper via props.
  • If the icon is decorative and the adjacent text already explains the state, add aria-hidden="true" on the wrapper so screen readers skip it.
  • Hover animation is purely visual and does not change state, so do not rely on it to communicate status. Pair the icon with text.
  • Respect reduced-motion preferences by wrapping controlled calls in a check for prefers-reduced-motion, since the component does not check it internally.
  • Keep color contrast sufficient by setting className to a color that 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.

prompt.md
Use the "no-symbol" component (heroicons-animated/no-symbol) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/no-symbol2. 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 { NoSymbolIcon } from "@/components/ui/no-symbol";<NoSymbolIcon />```

Files & dependencies

  • no-symbol.tsx
dependenciesmotion

Looks similar, elsewhere