{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "inline-highlight", "title": "Inline Highlight", "description": "Animates one word inside a sentence from a base color to a brand color.", "dependencies": [ "remotion" ], "files": [ { "path": "registry/remocn/inline-highlight/index.tsx", "content": "\"use client\";\n\nimport {\n interpolate,\n interpolateColors,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface InlineHighlightProps {\n before: string;\n highlight: string;\n after?: string;\n baseColor?: string;\n highlightColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function InlineHighlight({\n before,\n highlight,\n after = \"\",\n baseColor = \"#171717\",\n highlightColor = \"#ff5e3a\",\n fontSize = 48,\n fontWeight = 600,\n speed = 1,\n className,\n}: InlineHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const progress = interpolate(\n frame,\n [durationInFrames * 0.2, durationInFrames * 0.7],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const color = interpolateColors(\n progress,\n [0, 1],\n [baseColor, highlightColor],\n );\n\n return (\n