For Tailwind CSS v3 docs, click here.

Silk Background

A soft, flowing shader-powered background inspired by silk fabric motion and texture, rendered using ShaderToy.

API

Prop NameTypeDefaultDescription
huenumber300Base hue for the silk texture (in degrees, 0–360).
saturationnumber0.5Saturation of the color (0–1).
brightnessnumber1Brightness multiplier for the output color (0–2 recommended).
speednumber1Controls the animation speed multiplier (e.g., 2 = double speed).
classstringOptional additional CSS classes for the container div (e.g., z-index, etc).

💡 This component uses a full-screen absolute container by default. You can override positioning or stacking via the class prop.

Install using CLI

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://registry.inspira-ui.com/bg-silk.json"

Install Manually

SilkBackground.vue

Features

  • Shader-powered silk effect: Based on a fragment shader that simulates soft silk motion using recursive trigonometry and noise.
  • Real-time animation: Runs on GPU with smooth transitions and natural waves.
  • Interactive response: Subtle mouse-based parallax and warping effects when the cursor is active.
  • Custom color control: Adjust hue, saturation, brightness, and animation speed using props.
  • Lightweight and performant: Optimized GLSL logic for modern GPUs and browsers.
  • Modular: Embeds the GLSL shader inside a ShaderToy wrapper component for easy reuse.

Notes

  • Adapted from this ShaderToy shader by Giorgi Azmaipharashvili (MIT License).
  • Designed primarily for decorative use, such as full-screen hero backgrounds or section dividers.
  • Shader uses a combination of sine wave functions, noise layers, and distance-based distortion.
  • Not recommended for low-end devices due to GPU intensity.

Credits

  • Embedded in a Vue component and adapted for dynamic input via props.
  • Inspired by silk textures and fluid motion patterns found in organic materials.