Skip to Content
Kokonut UI

BG-01Backgrounds

Dot Field

A halftone dot membrane that ripples behind a swipe and rings out from a click, built with React and Canvas.

Install with
no extra packages

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-field

Usage

import DotField from "@/components/kokonutui/dot-field";

export default function Example() {
  return <DotField />;
}

Props

className
string

Extra classes for the root element.

children
ReactNode

Content shown over the field. Pass null for a bare background.

spacing
numberDefault 16

Distance between dots, in px.

interactive
booleanDefault true

Let a swipe push the dots and a click send a shockwave.

seed
numberDefault 7

Seed for the halftone pattern, so a page always opens on the same one.

Dependencies

NeedsVersionComes from
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.