NeonAurora
neon-ui/neon-auroraFreeComponent
The neon.com hero as a live WebGL surface: clusters of thin vertical bars twinkling in green, teal, and blue.
Install it
npx shadcn@latest add https://ui.neon.com/r/neon-aurora.jsonSource
1"use client";23/*4 * NeonAurora: the neon.com hero as a live WebGL surface — clusters of5 * thin vertical bars in green/teal/blue twinkling on black. A brand6 * background for heroes, empty workspaces, and marketing moments.7 * Static single frame under reduced motion. GLSL lives in8 * neon-aurora-shader.ts.9 */1011import { useEffect, useRef } from "react";12import type { ComponentProps } from "react";1314import { cn } from "@/lib/utils";1516import { AURORA_FRAGMENT, AURORA_VERTEX } from "./neon-aurora-shader";1718export type NeonAuroraProps = Omit<ComponentProps<"canvas">, "children"> & {19 /** Animation speed multiplier; 0 freezes the field. */20 speed?: number;21 /** 0-1 share of bar clusters alive at once. */22 density?: number;23 /** Overall brightness multiplier. */24 intensity?: number;25 /** 0-1 depth-of-field blur on the near layer as it approaches. */26 blur?: number;27 /** 0-1 ambient bloom fog hanging around the lit regions. */28 glare?: number;29 /** 0-1 how often the warm flare ignites; 0 disables it. */30 flare?: number;31 /** 0-1 how much of its column each bar fills. */32 thickness?: number;33 /** 0-1 how often the hot white flare ignites; 0 disables it. */34 whiteFlare?: number;35 /** Bar palette, mixed per bar: [deep, primary, accent]. */36 colors?: [string, string, string];37};3839/**40 * Seconds for a dial change to close ~63% of its gap — uniforms ease41 * toward their targets each frame, so a dragged slider glides42 * instead of snapping.43 */44const SMOOTH_TAU = 0.12;4546const DEFAULT_COLORS: [string, string, string] = [47 "#0e5f45",48 "#00e599",49 "#3b82f6",50];5152const parseColor = (css: string): [number, number, number] => {53 const probe = document.createElement("canvas");54 probe.width = 1;55 probe.height = 1;56 const context = probe.getContext("2d");5758 if (!context) {59 return [0, 0.9, 0.6];60 }6162 context.fillStyle = css;63 context.fillRect(0, 0, 1, 1);64 const [r, g, b] = context.getImageData(0, 0, 1, 1).data;65 return [(r ?? 0) / 255, (g ?? 0) / 255, (b ?? 0) / 255];66};6768const warnDev = (message: string) => {69 if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {70 console.warn(message);71 }72};7374const compile = (75 gl: WebGLRenderingContext,76 type: number,77 source: string78): WebGLShader | null => {79 const shader = gl.createShader(type);8081 if (!shader) {82 return null;83 }8485 gl.shaderSource(shader, source);86 gl.compileShader(shader);8788 if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {89// … truncated
What it pulls in
Other registry items
Files it writes
More from neon-ui
All 77 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ActivityFeedactivity-feed | neon-ui | Components | Free | 2 deps | |
| AgentChatagent-chat | neon-ui | Components | Free | 6 deps | |
| AnimatedWashanimated-wash | neon-ui | Components | Free | no deps · 2 files | |
| ApiKeyListapi-key-list | neon-ui | Components | Free | 2 deps | |
| AppCardapp-card | neon-ui | Components | Free | 2 deps | |
| AppCreatorapp-creator | neon-ui | Components | Free | 2 deps | |
| AuthFormauth-form | neon-ui | Components | Free | no deps | |
| AutoscaleChartautoscale-chart | neon-ui | Components | Free | 1 dep |
