Spelte

Open Github

Light Rays

Animated light rays effect using WebGL shaders.

Multi Colored

Light Rays

Installation

pnpm dlx shadcn-svelte@latest add https://spelte.dev/r/light-rays.json

Usage

<script>
	import LightRays from '$registry/spelte/light-rays.svelte';
</script>
 
<div class="relative h-80 overflow-hidden rounded-lg">
	<LightRays raysColor={{ mode: 'single', color: '#ffffff' }} />
</div>

Props

PropTypeDefaultDescription
backgroundColorstring"var(--background)"Background color
raysColor{ mode: 'single'; color: string } | { mode: 'multi'; color1: string; color2: string }{ mode: 'single', color: '#ffffff' }Color config
stylestring—Inline styles for the container
classstring—Additional CSS classes