pulsing border

A luminous animated border with flowing spots of colour, optional smoke trails, and pulsing glow. Great for highlighting CTAs or wrapping a hero image.

Preview

live

Install

npm
npm i @devmischief/shaders-svelte

Code

import { PulsingBorder } from '@devmischief/shaders-svelte';

<PulsingBorder
  width={1280}
  height={720}
  colors={['#ff006e', '#3a86ff', '#06d6a0']}
  colorBack="#000000"
  roundness={0.25}
  thickness={0.1}
  softness={0.75}
  aspectRatio="auto"
  intensity={0.2}
  bloom={0.25}
  spots={4}
  spotSize={0.5}
  pulse={0.25}
  smoke={0.3}
  smokeSize={0.6}
  margin={0}
  scale={0.6}
  rotation={0}
  offsetX={0}
  offsetY={0}
  speed={1}
  fit="contain"
/>
			
			

Shader Props

16
namedescriptiontypevalues
colorsSpot colors that flow along the border (up to 5).string[]hex / rgb
colorBackBackground color shown behind the border.stringhex / rgba
roundnessCorner radius of the border.number0 → 1
thicknessBase width of the border.number0 → 1
softnessBorder edge sharpness. 0 = hard edge, 1 = smooth gradient.number0 → 1
aspectRatioAspect ratio mode. auto = follows the canvas, square = forces a square border.stringauto · square
intensityThickness of individual color spots along the border.number0 → 1
bloomGlow blend mode. 0 = normal blending, 1 = additive blending.number0 → 1
spotsNumber of spots added for each color.number1 → 20
spotSizeAngular size of each spot along the border.number0 → 1
pulsePulsing animation intensity.number0 → 1
smokeNoisy shape extending the border outward.number0 → 1
smokeSizeScale of the smoke effect.number0 → 1
marginDistance from each canvas edge to the border.number0 → 1
speedAnimation speed of the flowing spots.number0 → 3
fitHow the border world is fit into the canvas.stringnone · cover · contain

Common Props

6
namedescriptiontypevalues
originXReference point for positioning width in the canvas.number0 → 1
originYReference point for positioning height in the canvas.number0 → 1
worldWidthVirtual width of the graphic before it's scaled to fit the canvas.number
worldHeightVirtual height of the graphic before it's scaled to fit the canvas.number
minPixelRatioMinimum pixel ratio used when rendering the shader (default 2).number
maxPixelCountMaximum pixel count the shader may process.number

built with mischief by devmischief

@devmischief/shaders-svelte