Smokey Frame

A WebGL smoke rim with noise, falloff, and optional pointer turbulence. Defaults to SonoJS primary blue. Respects prefers-reduced-motion. This docs preview uses a black stage so the glow stays visible.

Default

Procedural smoke along the border. Move the pointer to push the field. Preview stage is black so the emission reads clearly.

Loading…

Installation

CLI
npx @sonojs/ui@latest add smokey-frame

Usage

page.tsx
"use client"

import { SmokeyFrame } from "@/components/3d/smokey-frame"

export default function Page() {
  return (
    <div className="relative h-[520px] w-full overflow-hidden rounded-[12px] bg-black">
      <SmokeyFrame
        className="h-full w-full"
        frameColor="#2563EB"
        frameWidth={0.3}
        interactive
      >
        <p className="text-sm text-white/80">Your content</p>
      </SmokeyFrame>
    </div>
  )
}

Props

PropTypeDefaultDescription
frameColorstring"#2563EB"Smoke / emission color (hex or rgb).
frameBgColorstring-Interior fill when `transparentBg` is false. Defaults from light/dark html class.
transparentBgbooleantrueLeave the center transparent for slotted content.
frameWidthnumber0.3Normalized rim thickness from the edge (0.01–0.5).
speednumber0.15Smoke animation speed.
falloffnumber6Edge sharpness exponent.
noiseScalenumber3Noise granularity.
noiseStrengthnumber1How much noise modulates the rim (0–1).
intensitynumber1.2Emission brightness.
gammanumber2Contrast curve.
opacitynumber1Overall canvas opacity.
interactivebooleantruePointer displaces the smoke field.
glowbooleantrueSoft radial glow behind the frame.
glowBlurnumber36Glow blur in px.
glowOpacitynumber0.45Glow opacity.
radiusstring · number"12px"Corner radius.
dprnumber2Max device pixel ratio.
childrenReactNode-Content centered over the transparent interior.
classNamestring-Outer wrapper classes.
canvasClassNamestring-Canvas element classes.