Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Backgrounds

Pro

Tornado Background for React

A storm sky with a twister: a dark cloud base turns overhead and a banded funnel drops to the ground, leaning and spinning up dust. For React with Base UI, when a weather page, an alert or a bold hero needs a storm behind its copy.

Framework

A ceiling of dark cloud drifts across the top of the box and turns slowly over a funnel that drops from it to the ground on the end side of the box. Bands of condensation wind up around the funnel, the whole column leans slowly from side to side, debris spins at its foot and dust blows along the ground. Every part is a gradient or a noise texture the browser draws once; CSS turns, slides and leans them, so nothing repaints and no script runs. It follows your theme: a pale green-grey storm on a light page, a night storm on a dark one.

Use it for a weather or alert page, an "intense" product launch or a hero with a storm in it. For a whirlpool of streaks seen from above, use Vortex; for gusts streaking sideways, Wind; for plumes that rise instead of spin, Smoke; for the rest of the storm, Lightning.

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Usage

import { Tornado } from "@/components/ui/tornado";

The storm fills the box behind whatever you put inside, with the funnel on the end side (on the right, or the left on a right-to-left page), so your copy has the open sky. Give the container a height; for the whole page, render it empty with className="fixed inset-0 -z-10".

<Tornado className="flex min-h-[420px] items-center px-12">
  <h1 className="text-4xl font-semibold">Category five</h1>
</Tornado>

Demos

Dust storm

dustColor takes any CSS colour; here sandy dust, a wider funnel (funnelWidth={1.3}) and a slower spin (speed={0.6}). The card adds the dark class to its own container, so it shows the night storm on a light page too.

Preview width

In a card

A narrower funnel (funnelWidth={0.8}) that stands still (sway={false}), in a small card. The funnel, the clouds and the dust are sized from the box, so the storm keeps its shape at any size.

Preview width

Accessibility

The storm is decorative: it's hidden from assistive tech and never takes the pointer, and your content stays on top in normal flow. With reduced motion every part stops where it is, so the storm stays as a still picture. Nothing flashes.

The sky keeps body text in your foreground colour (text-foreground) above 4.5:1 in both color schemes, the funnel included; keep long copy in the open sky on the start side for the calmest read. The spin is a physical direction, so it isn't mirrored on right-to-left pages; only the funnel's place is.

FAQ

Can the funnel be wider or narrower?

Yes. funnelWidth is a multiplier from 0.5 to 1.5; at 1 the funnel's mouth under the cloud is 30% of the box's height, and it narrows into a rope at the ground.

Can I move the funnel?

Set --tornado-x on the component, as a share of the box's width: 68% by default, 32% on a right-to-left page. --tornado-swing sets how far it leans each way, in degrees.

How fast does it spin?

speed multiplies everything: the bands winding up the funnel, the debris, the turning cloud base and the drifting clouds and dust. 2 is twice as fast, 0.5 half as fast.

Can I change the colours?

dustColor sets the dust and debris at the funnel's foot. The sky, the clouds and the funnel follow your theme; for the night storm on a light page, add the dark class to the container.

Is it heavy?

No script runs per frame: every part moves with translate, rotate or a skew, which the browser composites without repainting, and each loops many times per animation cycle, so the page is barely woken. It's about 15 layers and 100 MB of GPU memory on a 2× screen.

Does it respect reduced motion?

Yes. Every part stops where it is, so the storm stays as a still picture.

API Reference

Tornado

<div> data-slot="tornado"

PropType
dustColor?string

The colour of the dust and debris at the funnel's foot, any CSS colour.

Default
a dusty brown, darker on a dark page
funnelWidth?number

How wide the funnel is, as a multiplier from 0.5 to 1.5; at 1 its mouth under the cloud is 30% of the box's height.

Default
1
speed?number

How fast it all turns and drifts: 2 is twice as fast, 0.5 half as fast.

Default
1
sway?boolean

The funnel leaning slowly from side to side from the cloud; false keeps it upright.

Default
true
render?ReactElement | ((props: object, state: object) => ReactElement)

Replace the host element or compose it with another component.

Type
ReactElement | ((props: object, state: object) => ReactElement)
className?string

Merged with the part's classes.

CSS variableType
--tornado-colorstring

The dust and debris (a dusty brown).

--tornado-speedstring

How fast it turns, a multiplier (1).

--tornado-swingstring

How far the funnel leans each way, in degrees (4).

--tornado-widthstring

The funnel's width, a multiplier (1).

--tornado-xstring

Where the funnel stands across the box (68%; 32% right to left).

All 100 backgrounds