Kinetic UI
Back to Introduction
Data Visualization

WebGL Line Chart

A glowing neon line chart built in React Three Fiber. Data is rendered as a 3D glowing tube with particle emissions.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add webgl-line-chart
WebGL Line Chart

Revenue (3D)

Interactive WebGL Visualization

Drag to rotateLive Data Stream

Installation

npx kinetic-ui-cli@latest add

Usage

This chart uses `@react-three/fiber` and `@react-three/drei` to draw a 3D line in space, providing a highly immersive alternative to standard 2D SVG charts.

import { WebGLLineChart } from "@/components/creative/webgl-line-chart";

export function Dashboard() {
  const data = [10, 20, 15, 30, 25, 40, 50, 45, 60];

  return (
    <div className="w-full">
      <WebGLLineChart data={data} color="#10b981" />
    </div>
  );
}

Props

PropTypeDefaultDescription
datanumber[][]Array of numerical data points to plot.
colorstring'#8b5cf6'Hex color for the neon line and particles.
classNamestringundefinedAdditional CSS classes for the chart container.

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { WebGLLineChart } from "@/components/creative/webgl-line-chart";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { WebGLLineChart } from "@/components/creative/webgl-line-chart";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <WebGLLineChart
        data{10}
        color="example"
      />
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.