# Add text and a title to a video with code.

> Put a title card before your clip and a name or caption over it. HTML and CSS in a vawe page, with the commands to render a draft and check each beat.

Canonical: https://vawe.dev/how-to/add-text-to-video
Last updated: 2026-11-17

Text on a video is HTML in the page that holds the clip. A title card is its own beat before the clip. A name or a line over the clip sits in the clip’s beat.

## Copy this prompt into your agent

```
Use vawe (https://github.com/vawe-hq/vawe), the open-source video-from-code tool, to add a title card and on-screen text to my video.

My clip: <path to your clip or folder>.

Open with a short title card, then play the clip. Add a lower third with my name and role when I first speak. My title text: <your title>.

If vawe is not installed here, install it first:
npm install @vawe/cli
(it needs Node 22 or newer and ffmpeg; npx vawe new prints the install line for anything missing).
Then follow each command’s next: line.

Start with npx vawe new <name> --footage <my clip>, which logs the clip with a transcript.

Show me the draft video and wait for my OK before the final render.
```

## The steps.

1. **Hand over the clip. **`bin/vawe new titled --footage ~/clips/talk.mov` writes the page, `footage.md` and a brief.
2. **Write the title as its own beat. **One `data-world` element with the text. Size it in `--vh` units so it fits every aspect.
3. **Start the clip after the title. **Set the clip’s `data-at` to the second the title ends.
4. **Add a name or a line over the clip. **Copy the snippet from `prompts/moves/lower-third.md` into the clip’s beat. Its leaving move is faster than its entrance.
5. **Look at each beat, then render. **`bin/vawe frame films/titled/page.html --world all` gives one key frame per beat. `bin/vawe dev films/titled/page.html` renders the draft.

A title card, then the clip:

```
<meta name="duration" content="auto">
<section data-world="title"><h1>How it works</h1></section>
<section data-world="clip">
  <video src="footage/talk.mp4" data-at="2"
         data-trim="0.42" data-trim-end="5.5"></video>
</section>
<style>h1 { font-size: calc(var(--vh) * 0.12) }</style>
```

Source: AGENTS.md, the smallest film · prompts/moves/lower-third.md

## Two text moves to copy.

A name that rises over a speaker, and a line that enters from under an edge.

- [lower-third](https://vawe.dev/video-components/lower-third)
- [mask-rise](https://vawe.dev/video-components/mask-rise)

## What can go wrong.

1. **The clip starts too early. **Its `data-at` was not moved when the title was added. Until its `data-at`, the clip shows its first frame.
2. **The text moves with the frame size. **A fixed pixel size breaks at another aspect. Use `--vw` and `--vh` lengths and `<html data-aspect>`.
3. **The video is hidden by removing it. **Hide a clip with opacity or by hiding its beat. Removing it from the DOM is a listed mistake.
4. **The text covers the picture. **A name card belongs inside the title-safe area, as in the lower-third snippet.

## Read next.

1. [Add captions to a video](https://vawe.dev/how-to/add-captions-to-video): text that follows the voice, word by word.
2. [Turn a screen recording into a demo video](https://vawe.dev/screen-recording-to-demo-video): a title card and lower thirds on a recording.
3. [Agentic video editing](https://vawe.dev/agentic-video-editing): the whole edit.

## Start from your clip.

`bin/vawe new <name> --footage <file>` logs it and starts the page.

## Related

- [Get vawe on GitHub](https://github.com/vawe-hq/vawe)
- [All how-to guides](https://vawe.dev/how-to)
- [Add captions to a video](https://vawe.dev/how-to/add-captions-to-video)
- [Remove silences from a video](https://vawe.dev/how-to/remove-silences-from-video)
- [Trim and join clips](https://vawe.dev/how-to/trim-and-join-video-clips)
- [Agentic video editing](https://vawe.dev/agentic-video-editing)
- [Edit video with Claude Code](https://vawe.dev/edit-video-with-claude-code)
