BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/godui/light-rays

Light Rays

godui/light-rays
FreeComponent

Volumetric god-rays that slowly sweep and breathe, with optional film grain. Pure CSS.

Install it

npx shadcn@latest add https://godui.design/r/light-rays.json

Source

packages/components/src/light-rays/light-rays.tsxgodui.design/r/light-rays.json
1"use client";
2
3import * as React from "react";
4
5export type LightRaysProps = React.HTMLAttributes<HTMLDivElement> & {
6 /** Number of rays in the fan. */
7 rayCount?: number;
8 /**
9 * Ray color, any CSS color string. Defaults to the `--color-primary` token.
10 */
11 color?: string;
12 /** Sweep speed multiplier. `1` is the calm default. */
13 speed?: number;
14 /** Base angle (deg) the fan points from. */
15 angle?: number;
16 /** Overall ray opacity, `0`–`1`. */
17 intensity?: number;
18 /** Film-grain amount, `0`–`1`. `0` disables the grain layer. */
19 grain?: number;
20};
21
22/**
23 * Volumetric light rays — a soft fan of god-rays that slowly sweeps and
24 * breathes, with optional film grain. Pure CSS. Drop it as the first child of a
25 * `relative overflow-hidden` container; your content sits above it.
26 */
27const LightRays = React.forwardRef<HTMLDivElement, LightRaysProps>(
28 (
29 {
30 className,
31 style,
32 rayCount = 14,
33 color = "var(--primary)",
34 speed = 1,
35 angle = 0,
36 intensity = 0.6,
37 grain = 0.05,
38 ...props
39 },
40 ref,
41 ) => {
42 const rootRef = React.useRef<HTMLDivElement>(null);
43 React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement);
44 const grainId = `light-rays-grain-${React.useId().replace(/:/g, "")}`;
45
46 const step = 360 / rayCount;
47 const rayColor = `color-mix(in oklab, ${color}, transparent 55%)`;
48
49 return (
50 <div
51 ref={rootRef}
52 data-slot="light-rays"
53 aria-hidden="true"
54 className={`absolute inset-0 z-base overflow-hidden ${className ?? ""}`}
55 style={
56 {
57 "--rays-speed": `${14 / speed}s`,
58 "--rays-angle": `${angle}deg`,
59 "--rays-intensity": `${intensity}`,
60 ...style,
61 } as React.CSSProperties
62 }
63 {...props}
64 >
65 {/* Source glow at the top. */}
66 <div
67 className="absolute inset-0"
68 style={{
69 backgroundImage: `radial-gradient(ellipse 60% 40% at 50% -5%, color-mix(in oklab, ${color}, transparent 70%), transparent 70%)`,
70 }}
71 />
72
73 {/* The ray fan — oversized so rotation never reveals an edge, blurred for
74 softness, and faded out toward the bottom. */}
75 <div
76 className="absolute inset-[-50%] origin-top motion-reduce:animate-none animate-light-rays-sweep [will-change:transform,opacity]"
77 style={{
78// … truncated

What it pulls in

Other registry items

  • @godui/godui-theme

Files it writes

  • packages/components/src/light-rays/light-rays.tsx

Facts

Registry
godui
Type
registry:ui
Access
Free
Files written
1
Theme wiring
ships cssVars
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

godui.design LucasBassetti/godui on GitHub Raw registry item This item as JSON

More from godui

All 105 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordiongoduiComponentsFree1 dep
Agent Flowagent-flowgoduiComponentsFree1 dep
Agent Timelineagent-timelinegoduiComponentsFree1 dep
Animated Beamanimated-beamgoduiComponentsFree1 dep
Animated Testimonialsanimated-testimonialsgoduiComponentsFree1 dep
Animated Tooltipanimated-tooltipgoduiComponentsFree1 dep
App Showcaseapp-showcasegoduiComponentsFree1 dep
Aurora Textaurora-textgoduiComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex