Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Animated Drop-In 404 Error Block for React

A full-height 404 page for a kids' language app where three digit tiles drop onto a rule one after the other with a small overshoot, in CSS only, and a button replays the drop.

Framework
UI library

Preview

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.

Overview

Let your 404 page arrive with some personality, with this animated 404 block for React with Base UI. It's the not-found page of Kitelark, a language-learning app for kids: the page's rails run its full height and one band crosses the screen between two rules with a plus mark where each meets a rail. Three digit tiles stand on the band's lower rule as if on a floor: the first 4 drops in from behind the upper rule, then the last 4, then the 0 between them, each overshooting the floor a little and settling, all with CSS transitions and a spring-like curve and no animation library. Under the band come the heading, one sentence, a Shine Button link home, the only colored control, and "Drop them again", a ghost Button that replays the drop. With reduced motion the tiles simply appear. It's built from Shine Button, Button and Guides. For children's apps, creative portfolios and any product that can afford a smile on an error.

FAQ

How does the animation work without a library?

Each tile has a starting: style, a CSS rule for the first frame after it's inserted: it begins above the row and transparent, and a transition on its translate and opacity carries it to rest with cubic-bezier(0.34, 1.56, 0.64, 1), a curve that overshoots its target before settling. The three tiles wait 0, 250 and 500 ms (delay-0, delay-[250ms], delay-[500ms] in TILES), which is why the 0 lands last. The row clips the overshoot at the floor, so the tiles seem to press into it. Nothing loops and no script runs a frame.

What does Drop them again do?

It adds one to a counter, and the row of tiles is keyed by that counter, so React mounts a fresh row and the entrance runs from the start. A polite status line says "The numerals dropped again", with the round number so repeats are heard. It changes nothing else: the link and the words stay put, and the page keeps its height.

What happens with reduced motion?

The transition is switched off, so the tiles are simply there when the page loads and again after Drop them again, which still works and still announces itself. The only other motion is the words fading up once, and that's off too.

Is it accessible?

The tiles are decoration, hidden from assistive technology: the heading says "Page not found" and the sentence says "Error 404" in words. Pressing a tile nudges it down 2 px with CSS, but tiles aren't controls and aren't in the tab order. The two real controls, the link and the replay button, have visible focus and come after the heading in reading order.

What stays local, and how do I wire it?

The link goes to #: point it at your home route. The 404 status is your server's job, so render the page from your framework's not-found route. Drop them again is purely cosmetic and needs no wiring; delete it, and the counter with it, if you want a one-shot entrance.

How do I change the timing, size or order?

Edit TILES: each tile's delay is a literal class so Tailwind keeps it. For a slower drop, raise duration-700 on TILE; for a bigger bounce, raise the curve's second number a little. The tile sizes step up at the sm breakpoint with the numerals.

  • Pro

    A full-height 404 page for a notes app with only the display numerals, a heading, one sentence that names the missing address as typed text, and one link back to the docs.

  • Pro

    A full-height 404 page for a bookkeeping app whose picture is the way back: a drawn filing drawer with three folders that are links and one dashed slot for the missing page.

  • Pro

    A full-height 404 page for a podcast player where the numerals echo in stacked rows that fade upward, over a framed row of three whole-cell links: go back, browse the library, contact support.

  • Pro

    A full-height 404 page for a documentation host: the headline and a link home at the start, the whole site's sitemap as a keyboard-walkable tree at the end, with a divider between.

  • Pro

    A full-height 404 page for a design-review tool that shows the trail of pages you visited on a rail-to-rail rule, tags the last good page, and lets you clear and restore the trail.

  • Pro

    A full-height 404 page for a knitting-pattern library: the display 404, a heading that names the missing address, an inline command list in a framed panel that shows five popular pages and filters ten as you type, and one button to the homepage.