Infusion

Displays a visual effect layer that changes the appearance of the components behind it.

Preview ​

Adjust the parameters to see how they change the effect. The global Infusion switch enables the page-wide effect.

Interactive Infusion Demo

Adjust the sliders below. Notice how it overlays all components in this block.

Sample Form
Customize Effect
Enable/disable the global page effect

Video ​

Installation ​

npx sigma-ui@latest add infusion

Usage ​

vue
<script setup lang="ts">
import { Infusion } from '@/components/ui/infusion';
</script>

<template>
  <Infusion src="/background-image.png" />
</template>

Infusion paints an image, blur, and noise layer. Without relative, the layer covers the page. With relative, it stays inside the nearest positioned parent.

This effect was first built for Sigma File Manager.

Examples ​

Full-page effect ​

vue
<template>
  <div>
    <Infusion src="/background-image.png" />
    <div>
      <!-- Page content -->
    </div>
  </div>
</template>

Contained effect ​

vue
<template>
  <div class="relative h-[400px] overflow-hidden rounded-lg">
    <Infusion
      src="/background-image.png"
      relative
    />
    <div class="relative z-10">
      <!-- Content above the effect -->
    </div>
  </div>
</template>

API Reference ​

Infusion ​

Props

PropType Default
srcrequired

URL of the image or video used as the background.

string""
opacity

Opacity of the media in light mode, from 0 to 1.

number0.2
opacityDark

Opacity of the media in dark mode, from 0 to 1.

number0.3
zIndex

CSS z-index of the overlay.

number100
blur

Blur radius applied to the media, in pixels.

number64
noiseIntensity

Alpha of the generated noise pixels, from 0 to 1; 0 disables the noise layer.

number0.5
noiseScale

Scale multiplier of the noise tile (256px at 1).

number1
noiseOpacity

Opacity of the noise layer, from 0 to 1.

number0.05
blendMode

CSS mix-blend-mode of the overlay.

Property.MixBlendMode"normal"
relative

Fills the nearest positioned parent instead of the whole viewport.

booleanfalse
type

Whether src points to an image or a looping, muted video.

"image" | "video""image"

Accessibility ​

The layer is decorative and does not add controls. Keep text on top of it readable, and do not put information into the background image alone.

KeyDescription
TabMoves focus past the effect. The layer is not interactive.
Edit this page on GitHub