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