The PageNotFound component creates a collision-bouncing container block. It takes any custom react element as children and floats/bounces it dynamically inside the container ref boundaries.
Preview
page not found

















Usage
Installation
$ pnpm dlx shadcn add https://klarden.vercel.app/r/page-not-found.json
Basic Example
import React, { useRef } from "react";
import { PageNotFound } from "@/components/klarden-ui/page-not-found";
export default function App() {
const containerRef = useRef<HTMLDivElement>(null);
return (
<div
ref={containerRef}
className="relative w-full h-[400px] border border-border rounded-xl bg-zinc-950 overflow-hidden"
>
<PageNotFound
containerRef={containerRef}
speed={3}
startPosition={{ x: 10, y: 20 }}
startAngle={45}
>
<div className="px-4 py-2 bg-rose-500 text-white rounded-lg font-bold">
404 Not Found
</div>
</PageNotFound>
</div>
);
}
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
containerRef | React.RefObject<HTMLElement | null> | undefined | Ref object pointing to the parent container bounding box that restricts the element's motion. |
speed | number | 3 | The speed velocity of the bouncing element motion. |
startPosition | { x: number; y: number } | { x: 0, y: 0 } | Initial start coordinate offset positions inside the container boundary container in percentage values (0-100). |
startAngle | number | 45 | The initial motion trajectory angle in degrees. |