Inline Highlight

Animate one word inside a sentence from a base color to a brand color

Installation

$ pnpm dlx shadcn@latest add @remocn/inline-highlight

Usage

// src/Root.tsx
import { Composition } from "remotion";
import { InlineHighlight } from "@/components/remocn/inline-highlight";

const InlineHighlightScene = () => (
  <InlineHighlight
    before="Ship faster with "
    highlight="remocn"
    highlightColor="#ff5e3a"
    fontSize={72}
  />
);

export const RemotionRoot = () => (
  <Composition
    id="InlineHighlight"
    component={InlineHighlightScene}
    durationInFrames={90}
    fps={30}
    width={1280}
    height={720}
  />
);

Props

PropTypeDefaultDescription
beforerequired
stringText rendered before the highlighted word
highlightrequired
stringThe word that animates color
after
string""Text rendered after the highlighted word
baseColor
string"#171717"Starting color of the highlighted word and color of the surrounding text
highlightColor
string"#ff5e3a"Final color of the highlighted word
fontSize
number48Font size in pixels
fontWeight
number600CSS font-weight
className
stringOptional className passed to the underlying span