Backgrounds Fancy Stable

MosaicGlow

Canvas mosaic of small tiles on a dark surface where a soft halo follows the cursor with a lag, lighting tiles to random gold intensities that decay into a comet trail, with an additive bloom over the gaps, a glassy per-tile highlight, ambient flicker and an autonomous drift when idle

Preview

Installation

pnpm add fancy-ui-svelte
import { MosaicGlow } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { MosaicGlow } from 'fancy-ui-svelte';
</script>

<MosaicGlow />

Examples

Basic Usage

Colors

Any hex or rgb() colour for the halo and the surface.

Dense Grid

Smaller tiles for a finer mosaic.

Trail and Idle

A short, cursor-only trail versus a long comet that keeps drifting.

Interactive Playground

Props

PropTypeDefaultDescription
tileSize number18Tile edge in CSS px
gap number2Gap between tiles in CSS px
color string"#f2c318"Halo and tile colour, hex or rgb()
background string"#0a0a0a"Surface colour behind the tiles, hex or rgb()
radius number170Halo radius in CSS px
intensity number1Overall brightness of lit tiles, 0 to 1
trail number0.6How long lit tiles linger after the halo moves on, 0 to 1
smoothing number0.15Pointer lag, 0 (instant) to 1 (very laggy)
noise number0.7Spread of per-tile random brightness inside the halo, 0 to 1
ambient number0.35Visibility of the random faint tiles outside the halo, 0 to 1
flicker booleantrueSlowly re-roll the faint tiles over time
idle "drift" | "none""drift"With no pointer for 1.5s: drift wanders the halo on a slow path, none switches it off
interactive booleantrueFollow the pointer. Off leaves only the idle behaviour
seed number1Seed for the per-tile randomness; same seed, same mosaic
ref HTMLDivElement | nullnullBindable host element
class string-Additional classes on the host

Slots

SlotDescription
childrenContent rendered above the canvas; give the host a height