Backgrounds Fancy Stable

StarsBackground

Three-layer starfield background that scrolls continuously while parallax-shifting in response to cursor movement via spring physics, with stars rendered as box-shadow dots across near, mid, and far depth layers

Preview

Installation

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

Usage

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

<StarsBackground />

Examples

Basic Usage

Custom Color

Animation Speed

Props

PropTypeDefaultDescription
factor number0.05Parallax factor for mouse movement
speed number50Base animation speed in seconds
stiffness number50Spring stiffness for parallax
damping number20Spring damping for parallax
starColor string"#fff"Color of the stars

Slots

SlotDescription
childrenChild content to render over the stars