Tornado

TornadoIcon is an animated tornado-style icon built from five horizontal stroked lines that shake side to side in a staggered wave on hover. It is a forwardRef component powered by motion/react, and it can be controlled imperatively through startAnimation and stopAnimation.

Tornado
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/tornado.json

Usage

usage.tsx
import { TornadoIcon } from '@/components/ui/tornado'; export default function Example() { return <TornadoIcon className='text-foreground' />; }
  • Use as an animated weather or wind indicator, for example in a forecast widget, storm alert, or weather app header.
  • Use as a hover-triggered decorative icon on feature cards, navigation items, or buttons where a subtle motion cue adds delight.
  • Use as a controlled loading or processing indicator by calling startAnimation and stopAnimation through a ref.
  • Avoid when the icon must convey static meaning only or when users may have reduced-motion preferences and the animation is not essential.

Examples

Hover-animated icon

Basic usage. The animation plays on mouse enter and resets on mouse leave, with no ref needed.

hover-animated-icon.tsx
import { TornadoIcon } from '@/components/ui/tornado'; export default function HoverExample() { return ( <div className='flex items-center gap-2 text-sm'> <TornadoIcon size={32} className='text-blue-500' /> <span>Storm warning</span> </div> ); }

Controlled animation via ref

Attach a ref to drive the animation imperatively, for example while a background task is running. When a ref is attached, hover handlers forward to your own callbacks instead of animating automatically.

controlled-animation-via-ref.tsx
import { useEffect, useRef } from 'react'; import { Button } from '@/components/ui/button'; import { TornadoIcon, type TornadoIconHandle } from '@/components/ui/tornado'; export default function ControlledExample({ loading }: { loading: boolean }) { const iconRef = useRef<TornadoIconHandle>(null); useEffect(() => { if (loading) { iconRef.current?.startAnimation(); } else { iconRef.current?.stopAnimation(); } }, [loading]); return ( <Button variant='outline'> <TornadoIcon ref={iconRef} size={18} className='mr-2' /> Syncing forecast </Button> ); }

Custom hover handlers with ref

When a ref is attached, onMouseEnter and onMouseLeave are called as regular callbacks and the built-in animation is not triggered automatically. This example combines a ref with custom tracking.

custom-hover-handlers-with-ref.tsx
import { useRef } from 'react'; import { TornadoIcon, type TornadoIconHandle } from '@/components/ui/tornado'; export default function HandlerExample() { const iconRef = useRef<TornadoIconHandle>(null); return ( <div onMouseEnter={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()} className='inline-flex cursor-pointer rounded-md border p-3'> <TornadoIcon ref={iconRef} size={24} /> </div> ); }

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24, so the stroke scales with the icon.
classNamestring—Class names applied to the outer wrapper div. Use it to set color (via currentColor), margin, or layout.
onMouseEnter(event: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler inherited from HTMLAttributes<HTMLDivElement>. Called after the built-in animation starts when no ref is attached. When a ref is attached, it replaces the built-in animation trigger and is called instead.
onMouseLeave(event: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler inherited from HTMLAttributes<HTMLDivElement>. Resets the animation when no ref is attached. When a ref is attached, it is called instead of resetting the animation.
refReact.Ref<TornadoIconHandle>—Forwarded ref exposing TornadoIconHandle with startAnimation() and stopAnimation(). It is not a reference to the DOM element. Attaching it switches the component into controlled mode.
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, role, tabIndex, data-*, and so on) are spread onto the wrapper div.

Accessibility

  • The SVG has no title, desc, or role attribute. If the icon conveys meaning, add aria-label or a visible text label on the wrapper, for example aria-label='Tornado warning' with role='img'.
  • If the icon is purely decorative next to visible text, add aria-hidden='true' on the component to hide it from assistive technology.
  • The wrapper div is not focusable by default. If the icon triggers an action or is interactive, add tabIndex={0}, a role such as button, and keyboard handlers.
  • The animation is a motion effect. Respect prefers-reduced-motion by conditionally disabling the animation or avoiding automatic startAnimation calls for users who opt out.
  • Keep the icon from being the only signal of a loading or status change; pair it with text or an aria-live announcement.

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 "Tornado" component (lucide-animated/tornado) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/tornado.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, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { TornadoIcon } from '@/components/ui/tornado'; export default function Example() { return <TornadoIcon className='text-foreground' />; }```

Files & dependencies

  • tornado.tsx
dependenciesmotion

Looks similar, elsewhere