Background Paths - React Component | Kokonut UI
Background Paths
A ribbon of lines in one color that keeps flowing at any size and parts around the cursor.
Installation
Background Paths 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/background-paths.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/background-paths
Usage
import BackgroundPaths from "@/components/kokonutui/background-paths";
export default function Example() {
return <BackgroundPaths />;
}
Props
| Prop | Type | Description |
|---|---|---|
className |
string |
Extra classes for the root element. |
children |
ReactNode |
Content shown over the lines. |
count |
number |
Default 42. Number of lines, shared across the three depth layers. |
spread |
number |
Default 1. How far the ribbon fans out, as a share of the height. |
angle |
number |
Default -8. Tilt of the ribbon, in degrees. |
speed |
number |
Default 1. How fast the ribbon flows. 0 holds it still. |
interactive |
boolean |
Default true. Part the lines around the cursor. |
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.
Additional Backgrounds
- Dot Field: A halftone dot membrane that ripples behind a swipe and rings out from a click, built with React and Canvas.
- Shape Hero: A landing hero where shapes drop in, pile up under the headline and can be grabbed and thrown.