Caption Neon Accent
framecn/caption-neon-accentFreeComponent
Captions where words glow with a bright neon accent border and subtle glow.
Install it
npx shadcn@latest add https://framecn.dev/r/caption-neon-accent.jsonSource
1"use client";23import { Timegroup } from "@editframe/react";4import type { CSSProperties } from "react";56export interface CaptionWord {7 text: string;8 start: number;9 end: number;10}1112export interface CaptionNeonAccentProps {13 words?: CaptionWord[];14 accentWords?: string[];15 color?: string;16 accentColor?: string;17 fontSize?: number;18 fontWeight?: number | string;19 accentScale?: number;20 background?: string;21 speed?: number;22 fps?: number;23 durationInFrames?: number;24 width?: number;25 height?: number;26 className?: string;27}2829const DEFAULT_WORDS: CaptionWord[] = [30 { end: 0.35, start: 0, text: "Every" },31 { end: 0.65, start: 0.35, text: "great" },32 { end: 1, start: 0.65, text: "video" },33 { end: 1.45, start: 1.1, text: "starts" },34 { end: 1.65, start: 1.45, text: "with" },35 { end: 1.8, start: 1.65, text: "a" },36 { end: 2.15, start: 1.8, text: "single" },37 { end: 2.7, start: 2.15, text: "frame." },38 { end: 3.2, start: 3, text: "No" },39 { end: 3.9, start: 3.2, text: "timelines." },40 { end: 4.2, start: 4, text: "No" },41 { end: 4.5, start: 4.2, text: "drag" },42 { end: 4.65, start: 4.5, text: "and" },43 { end: 5.1, start: 4.65, text: "drop." },44 { end: 5.55, start: 5.3, text: "Just" },45 { end: 6, start: 5.55, text: "code." },46];4748const WORDS_PER_GROUP = 3;4950export const CaptionNeonAccent = ({51 words = DEFAULT_WORDS,52 accentWords = ["frame.", "code."],53 color = "#ffffff",54 accentColor = "#a855f7",55 fontSize = 64,56 fontWeight = 700,57 accentScale = 1.5,58 background = "#0a0a0a",59 speed = 1,60 fps = 30,61 durationInFrames = 180,62 width = 1280,63 height = 720,64 className,65}: CaptionNeonAccentProps) => {66 const safeSpeed = Math.max(0.01, speed);67 const durationMs = (durationInFrames / fps) * 1000;6869 const groups = [];70 for (let i = 0; i < words.length; i += WORDS_PER_GROUP) {71 const groupWords = words.slice(i, i + WORDS_PER_GROUP);72 groups.push({73 endMs: ((groupWords.at(-1)?.end ?? 0) * 1000) / safeSpeed + 180,74 startMs: (groupWords[0].start * 1000) / safeSpeed,75 words: groupWords,76 });77 }7879 const containerStyle: CSSProperties = {80 background,81 height,82 overflow: "hidden",83 position: "relative",84 width,85 };8687 const clampedScale = Math.max(1.2, Math.min(2.5, accentScale));8889 return (90 <Timegroup91 className={className}92 duration={`${durationMs}ms`}93 mode="fixed"94 style={containerStyle}95 >96 <>97 <style>{`98// … truncated
What it pulls in
npm packages
Files it writes
More from framecn
All 101 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| AI Generate Overlayai-generate-overlay | framecn | Components | Free | 1 dep | |
| AI Generation Canvasai-generation-canvas | framecn | Components | Free | 1 dep | |
| Animated Bar Chartanimated-bar-chart | framecn | Components | Free | 1 dep | |
| Animated Line Chartanimated-line-chart | framecn | Components | Free | 1 dep | |
| Backdropbackdrop | framecn | Components | Free | 1 dep | |
| Blur Out Upblur-out-up | framecn | Components | Free | 1 dep | |
| Blur Revealblur-reveal | framecn | Components | Free | 1 dep | |
| Bounding Box Selectorbounding-box-selector | framecn | Components | Free | 1 dep |
