BG-01Backgrounds
Dot Field
A halftone dot membrane that ripples behind a swipe and rings out from a click, built with React and Canvas.
PRODither Reveal Hero and more like it are in Kokonut UI Pro
Installation
Dot Field is a free, open-source React component in the Kokonut UI Backgrounds collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/dot-field.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/dot-fieldUsage
import DotField from "@/components/kokonutui/dot-field";
export default function Example() {
return <DotField />;
}Props
classNamestringExtra classes for the root element.
childrenReactNodeContent shown over the field. Pass null for a bare background.
spacingnumberDefault 16Distance between dots, in px.
interactivebooleanDefault trueLet a swipe push the dots and a click send a shockwave.
seednumberDefault 7Seed for the halftone pattern, so a page always opens on the same one.
Dependencies
| Needs | Version | Comes from |
|---|---|---|
cn from lib/utils.ts | shadcn init | |
| React | 19 | Your app |
| Tailwind CSS | 4 | Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.