Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

feat: pulsing border

dev_wandry8a492bcb2159
diff --git a/content/docs/shaders/index.mdx b/content/docs/shaders/index.mdx
index 00f031cf..846be19e 100644
--- a/content/docs/shaders/index.mdx
+++ b/content/docs/shaders/index.mdx
@@ -142,6 +142,12 @@ Powered by [paper-design/shaders](https://github.com/paper-design/shaders) (Apac
status: "stable",
href: "/docs/shaders/shader-smoke-ring",
},
+ {
+ name: "ShaderPulsingBorder",
+ description: "Glowing border frame that pulses around the edges",
+ status: "stable",
+ href: "/docs/shaders/shader-pulsing-border",
+ },
]}
/>
diff --git a/content/docs/shaders/meta.json b/content/docs/shaders/meta.json
index 2c1f1384..6906a212 100644
--- a/content/docs/shaders/meta.json
+++ b/content/docs/shaders/meta.json
@@ -19,6 +19,7 @@
"shader-dithering",
"shader-god-rays",
"shader-smoke-ring",
- "shader-metaballs"
+ "shader-metaballs",
+ "shader-pulsing-border"
]
}
diff --git a/content/docs/shaders/shader-pulsing-border.mdx b/content/docs/shaders/shader-pulsing-border.mdx
new file mode 100644
index 00000000..2bd2ea71
--- /dev/null
+++ b/content/docs/shaders/shader-pulsing-border.mdx
@@ -0,0 +1,37 @@
+---
+title: Shader Pulsing Border
+description: Glowing border frame that pulses around the edges
+---
+
+<ComponentPreview name="shader-pulsing-border" />
+
+## Installation
+
+<InstallBlock name="shader-pulsing-border" />
+
+## Usage
+
+```tsx
+// src/Root.tsx
+import { Composition } from "remotion";
+import { ShaderPulsingBorder } from "@/components/remocn/shader-pulsing-border";
+
+const ShaderPulsingBorderScene = () => (
+ <ShaderPulsingBorder speed={1} thickness={0.1} roundness={0.25} />
+);
+
+export const RemotionRoot = () => (
+ <Composition
+ id="ShaderPulsingBorder"
+ component={ShaderPulsingBorderScene}
+ durationInFrames={150}
+ fps={30}
+ width={1280}
+ height={720}
+ />
+);
+```
+
+## Credits
+
+Shader by [paper-design/shaders](https://github.com/paper-design/shaders) (Apache-2.0).
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index 365a391e..08ed90ac 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -103,6 +103,8 @@ import { ShaderNeuroNoise } from "@/registry/remocn/shader-neuro-noise";
import { shaderNeuroNoiseConfig } from "@/registry/remocn/shader-neuro-noise/config";
import { ShaderPerlinNoise } from "@/registry/remocn/shader-perlin-noise";
import { shaderPerlinNoiseConfig } from "@/registry/remocn/shader-perlin-noise/config";
+import { ShaderPulsingBorder } from "@/registry/remocn/shader-pulsing-border";
+import { shaderPulsingBorderConfig } from "@/registry/remocn/shader-pulsing-border/config";
import { ShaderSimplexNoise } from "@/registry/remocn/shader-simplex-noise";
import { shaderSimplexNoiseConfig } from "@/registry/remocn/shader-simplex-noise/config";
import { ShaderVoronoi } from "@/registry/remocn/shader-voronoi";
@@ -410,6 +412,10 @@ const registry: Record<string, RegistryEntry> = {
Component: ShaderMetaballs,
config: shaderMetaballsConfig,
},
+ "shader-pulsing-border": {
+ Component: ShaderPulsingBorder,
+ config: shaderPulsingBorderConfig,
+ },
"dynamic-grid": { Component: DynamicGrid, config: dynamicGridConfig },
"simulated-cursor": {
Component: SimulatedCursor,
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index 2bc22521..136a473e 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -759,6 +759,22 @@
}
]
},
+ {
+ "name": "shader-pulsing-border",
+ "type": "registry:component",
+ "title": "Shader Pulsing Border",
+ "description": "Glowing border frame that pulses around the edges.",
+ "dependencies": [
+ "@paper-design/shaders-react"
+ ],
+ "files": [
+ {
+ "path": "shader-pulsing-border/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/shader-pulsing-border.tsx"
+ }
+ ]
+ },
{
"name": "dynamic-grid",
"type": "registry:component",
diff --git a/registry/remocn/shader-pulsing-border/config.ts b/registry/remocn/shader-pulsing-border/config.ts
new file mode 100644
index 00000000..6407db58
--- /dev/null
+++ b/registry/remocn/shader-pulsing-border/config.ts
@@ -0,0 +1,45 @@
+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";
+
+export const shaderPulsingBorderConfig: ComponentConfig = {
+ componentName: "ShaderPulsingBorder",
+ importPath: "@/components/remocn/shader-pulsing-border",
+ controls: {
+ speed: {
+ type: "number",
+ default: 1,
+ min: 0.1,
+ max: 4,
+ step: 0.1,
+ label: "Speed",
+ },
+ thickness: {
+ type: "number",
+ default: 0.1,
+ min: 0.02,
+ max: 0.5,
+ step: 0.02,
+ label: "Thickness",
+ },
+ roundness: {
+ type: "number",
+ default: 0.25,
+ min: 0,
+ max: 1,
+ step: 0.05,
+ label: "Roundness",
+ },
+ intensity: {
+ type: "number",
+ default: 0.2,
+ min: 0,
+ max: 1,
+ step: 0.05,
+ label: "Intensity",
+ },
+ colorBack: { type: "color", default: "#12121a", label: "Background" },
+ },
+ durationInFrames: 150,
+ fps: FPS,
+ compositionWidth: W,
+ compositionHeight: H,
+};
diff --git a/registry/remocn/shader-pulsing-border/index.tsx b/registry/remocn/shader-pulsing-border/index.tsx
new file mode 100644
index 00000000..348642e4
--- /dev/null
+++ b/registry/remocn/shader-pulsing-border/index.tsx
@@ -0,0 +1,67 @@
+"use client";
+
+import {
+ PulsingBorder,
+ type PulsingBorderProps,
+} from "@paper-design/shaders-react";
+import { useCallback, useState } from "react";
+import {
+ continueRender,
+ delayRender,
+ useCurrentFrame,
+ useVideoConfig,
+} from "remotion";
+
+const NEUTRAL_COLORS = ["#52527a", "#8a8a95", "#3a3a5c"];
+
+export interface ShaderPulsingBorderProps
+ extends Omit<PulsingBorderProps, "frame" | "ref"> {}
+
+export function ShaderPulsingBorder({
+ speed = 1,
+ colorBack = "#12121a",
+ colors = NEUTRAL_COLORS,
+ roundness = 0.25,
+ thickness = 0.1,
+ intensity = 0.2,
+ bloom = 0.25,
+ className,
+ ...rest
+}: ShaderPulsingBorderProps) {
+ const frame = useCurrentFrame();
+ const { fps, width, height } = useVideoConfig();
+
+ const [handle] = useState(() => delayRender("shader-pulsing-border"));
+ const gate = useCallback(
+ (element: HTMLDivElement | null) => {
+ if (!element) return;
+ requestAnimationFrame(() =>
+ requestAnimationFrame(() => continueRender(handle)),
+ );
+ },
+ [handle],
+ );
+
+ return (
+ <div
+ ref={gate}
+ className={className}
+ style={{ position: "absolute", inset: 0 }}
+ >
+ <PulsingBorder
+ speed={0}
+ frame={(frame / fps) * speed * 1000}
+ colorBack={colorBack}
+ colors={colors}
+ roundness={roundness}
+ thickness={thickness}
+ intensity={intensity}
+ bloom={bloom}
+ fit="cover"
+ width={width}
+ height={height}
+ {...rest}
+ />
+ </div>
+ );
+}