Skip to content

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

3.0 KB
Raw Blame
---
title: Inline Highlight
description: Animate one word inside a sentence from a base color to a brand color
component: inline-highlight
vibe: clean
length: 90
useWhen:
  - "One keyword inside a sentence needs to draw attention through a color shift without any background decoration."
  - "The text is already visible and a subtle emphasis beat is needed mid-scene, not a full entrance."
  - "Clean, minimal brand-color callout is required — no physical marker, no underline, just the color pop."
avoidWhen:
  - "You want a physical drawn marker or filled background behind the word — use `marker-highlight` for a visible paint-stroke effect instead."
  - "The entire sentence is new and needs to enter — this component is for emphasis within existing text, not a reveal; use `mask-reveal-up` or `per-word-crossfade` for full entrances."
  - "Multiple words across the sentence need to highlight in sequence — this highlights one span; compose multiple `Sequence`-wrapped instances or use `kinetic-center-build` for a word-by-word build."
askedAs:
  - "one word changing color"
  - "I want a keyword in a sentence to shift to the brand color"
  - "draw attention to a single word without a background shape"
  - "color emphasis within a line"
  - "highlight word color shift"
  - "keyword turns brand color"
---

<ComponentPreview name="inline-highlight" />

<InstallBlock name="inline-highlight" />

## Usage

```tsx
// 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}
  />
);
```

<PropsTable title="Props"
  rows={[
    {
      name: "before",
      type: "string",
      required: true,
      description: "Text rendered before the highlighted word",
    },
    {
      name: "highlight",
      type: "string",
      required: true,
      description: "The word that animates color",
    },
    {
      name: "after",
      type: "string",
      default: "\"\"",
      description: "Text rendered after the highlighted word",
    },
    {
      name: "baseColor",
      type: "string",
      default: "\"#171717\"",
      description: "Starting color of the highlighted word and color of the surrounding text",
    },
    {
      name: "highlightColor",
      type: "string",
      default: "\"#ff5e3a\"",
      description: "Final color of the highlighted word",
    },
    {
      name: "fontSize",
      type: "number",
      default: "48",
      description: "Font size in pixels",
    },
    {
      name: "fontWeight",
      type: "number",
      default: "600",
      description: "CSS font-weight",
    },
    {
      name: "className",
      type: "string",
      description: "Optional className passed to the underlying span",
    },
  ]}
/>