Wifi Pen

WifiPenIcon is an animated Wi-Fi signal icon in which a pen tip wobbles and nudges at the lower right of the arcs, built on Motion and a forwardRef handle. It animates on hover by default and can be driven imperatively through startAnimation and stopAnimation.

Wifi Pen
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 https://lucide-animated.com/r/wifi-pen.json

Usage

usage.tsx
import { WifiPenIcon } from "@/components/ui/wifi-pen";export function Example() {  return <WifiPenIcon />;}
  • Use as a hover-triggered icon on Wi-Fi, wireless, network, or connectivity settings rows and buttons where a subtle writing or editing hint is wanted.
  • Use when a playful micro-interaction should signal that a network or wireless configuration can be edited.
  • Use with the ref handle when the parent should start or stop the wobble, for example after a Wi-Fi name is saved or while a connection is being configured.
  • Avoid it where continuous motion would be distracting, since the animation is a short two-cycle wobble and not a loop.

Examples

Hover-triggered icon in a settings row

The default uncontrolled mode. Hovering the wrapper div plays the pen wobble and mouse leave resets it.

hover-triggered-icon-in-a-settings-row.tsx
import { WifiPenIcon } from "@/components/ui/wifi-pen";export function WifiSettingsRow() {  return (    <div className="flex items-center gap-3 rounded-md border p-3">      <WifiPenIcon size={24} className="text-muted-foreground" />      <span className="text-sm">Wi-Fi network</span>    </div>  );}

Imperative control through a ref

Once a ref is attached, the component switches to controlled mode, so hover no longer triggers the animation. The parent calls startAnimation and stopAnimation directly.

imperative-control-through-a-ref.tsx
import { useRef } from "react";import { WifiPenIcon, type WifiPenIconHandle } from "@/components/ui/wifi-pen";export function EditWifiButton() {  const iconRef = useRef<WifiPenIconHandle>(null);  return (    <button      type="button"      className="inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm"      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    >      <WifiPenIcon ref={iconRef} size={20} />      Edit Wi-Fi    </button>  );}

Larger icon with a custom hover handler

In uncontrolled mode the component still calls the passed onMouseEnter and onMouseLeave, so they can be used alongside the built-in animation without losing it.

larger-icon-with-a-custom-hover-handler.tsx
import { WifiPenIcon } from "@/components/ui/wifi-pen";export function NetworkHero() {  return (    <WifiPenIcon      size={48}      className="text-blue-600 cursor-pointer"      onMouseEnter={() => console.log("hover")}      onMouseLeave={() => console.log("leave")}    />  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24, so the icon scales proportionally.
classNamestring—Applied to the outer div wrapper through cn(className). Use it to set color (via currentColor), margins, or layout.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse enter. In uncontrolled mode it runs in addition to the built-in animation. Once a ref is attached (controlled mode), the built-in animation is skipped and only this handler runs.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse leave. Behaves the same way as onMouseEnter with respect to the built-in reset animation and controlled mode.
refReact.Ref<WifiPenIconHandle>—Exposes startAnimation(): void, which plays the pen wobble, and stopAnimation(): void, which returns the pen to its resting position. Attaching a ref switches the component into controlled mode.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—Any other standard div attributes (id, style, aria-*, role, tabIndex, onClick, and so on) are spread onto the wrapper div.

Accessibility

  • The SVG has no title, desc, or role, so it is decorative. If it conveys meaning alone, pass role="img" and aria-label through the wrapper props, or place visible text next to it.
  • When the icon is inside an interactive element such as a button, put the accessible name on the button and set aria-hidden on the icon, so screen readers do not announce an unlabeled graphic.
  • The animation is a brief wobble of about 1px and a fraction of a degree, so it does not cause vestibular trouble. Still, for users who prefer reduced motion, consider gating startAnimation calls with a prefers-reduced-motion check.
  • Hover-only triggering is not available to keyboard or touch users. If the icon indicates an action, pair it with focus or click handling so the same state is reachable without a mouse.

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 "Wifi Pen" component (lucide-animated/wifi-pen) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/wifi-pen.json2. 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 { WifiPenIcon } from "@/components/ui/wifi-pen";export function Example() {  return <WifiPenIcon />;}```

Files & dependencies

  • wifi-pen.tsx
dependenciesmotion

Looks similar, elsewhere