Skip to content

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

3.3 KB
Raw Blame
---
title: Marker Highlight
description: A colored marker block draws behind a phrase while the text color shifts
component: marker-highlight
vibe: playful
length: 90
useWhen:
  - "A key phrase inside a sentence needs a physical, hand-drawn-feeling highlight that visually underscores the word."
  - "A playful or educational tone is appropriate and the visible paint stroke adds expressive energy."
  - "The brand color should appear as a background fill rather than a text color shift."
avoidWhen:
  - "You want a subtle color-only emphasis with no visible background — use `inline-highlight` for a clean color-shift with no marker block."
  - "The entire sentence is new text that needs to enter the scene — both highlight components are emphasis tools, not entrances; use `mask-reveal-up` or `per-word-crossfade` for full reveals."
  - "The scene tone is minimal or premium and a bold painted marker would clash — use `inline-highlight` for a quieter callout."
  - "The emphasis should land the moment a speaker says the word — use `caption-marker`, which swipes keywords from a timed transcript."
askedAs:
  - "highlighter pen behind text"
  - "I want a marker stroke drawn behind a phrase"
  - "hand drawn highlight on a key phrase"
  - "playful emphasis that underscores a word"
  - "yellow marker highlight"
  - "highlighted phrase"
---

<ComponentPreview name="marker-highlight" />

<InstallBlock name="marker-highlight" />

## Usage

```tsx
// src/Root.tsx
import { Composition } from "remotion";
import { MarkerHighlight } from "@/components/remocn/marker-highlight";

const MarkerHighlightScene = () => (
  <MarkerHighlight
    before="Ship it "
    highlight="fast"
    after="."
    markerColor="#facc15"
  />
);

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

<PropsTable title="Props"
  rows={[
    {
      name: "before",
      type: "string",
      default: "\"\"",
      description: "Text that appears before the highlighted phrase",
    },
    {
      name: "highlight",
      type: "string",
      required: true,
      description: "The phrase the marker draws behind",
    },
    {
      name: "after",
      type: "string",
      default: "\"\"",
      description: "Text that appears after the highlighted phrase",
    },
    {
      name: "markerColor",
      type: "string",
      default: "\"#facc15\"",
      description: "Color of the marker block",
    },
    {
      name: "baseColor",
      type: "string",
      default: "\"#171717\"",
      description: "Color of the surrounding text",
    },
    {
      name: "highlightedTextColor",
      type: "string",
      default: "\"#171717\"",
      description: "Final color of the highlighted phrase once the marker is drawn",
    },
    {
      name: "fontSize",
      type: "number",
      default: "72",
      description: "Font size in pixels",
    },
    {
      name: "fontWeight",
      type: "number",
      default: "600",
      description: "CSS font-weight",
    },
    {
      name: "speed",
      type: "number",
      default: "1",
      description: "Multiplier for animation speed",
    },
    {
      name: "className",
      type: "string",
      description: "Optional className passed to the outer text span",
    },
  ]}
/>