---
title: "Rich HTML Text in Video | Rendley SDK Docs"
description: "Render HTML snippets as visual elements on the video canvas. Support for mixed styles, nested elements, inline formatting and CSS-styled text."
url: https://docs.rendley.com/sdk/getting-started/clips/html-text/
---

# HTML text clips

The [HtmlTextClip](https://docs.rendley.com/sdk/api-reference/classes/HtmlTextClip.html) renders a snippet of HTML as a visual element on the canvas. Useful when you need mixed styles, nested elements, or inline formatting that plain [TextClip](https://docs.rendley.com/sdk/getting-started/clips/text/) does not support.

Everything is rendered inside a `<span>` element, so any HTML and CSS that a span can contain is valid.

## Create an HTML text clip

Gradient text  `, fonts: [], startTime: 0, duration: 5 }); clip.style.setPosition(960, 540); await Engine.getInstance().getTimeline().play(); } export { run }; ">

Runnable exampleShow full code

Run

```
const clip = await layer.addClip({
  type: "html_text",
  htmlText: `
    <span style="
      background: linear-gradient(90deg, #ff4d6d, #6d6ff2);
      -webkit-background-clip: text;
      color: transparent;
      font-size: 160px;
      font-weight: 900;
    ">
      Gradient text
    </span>
  `,
  fonts: [],
  startTime: 0,
  duration: 5,
});
clip.style.setPosition(960, 540);
```

## Fonts

If your HTML uses custom fonts, list them in the `fonts` array. Each entry must also be registered through the [FontRegistry](https://docs.rendley.com/sdk/getting-started/fonts/):

```
await layer.addClip({
  type: "html_text",
  htmlText: `<span style="font-family: Inter, sans-serif">Hello</span>`,
  fonts: ["Inter"],
  startTime: 0,
  duration: 5,
});
```

Warning

Any font referenced in the HTML without being listed in `fonts` will fall back to the browser default. Subtle bugs come from missing a font name in the array.

## Update the content

```
htmlTextClip.setHtmlText(`<span>Updated</span>`);
```

## What to read next

- **[Text clips](https://docs.rendley.com/sdk/getting-started/clips/text/)** add and style text overlays.
- **[Fonts](https://docs.rendley.com/sdk/getting-started/fonts/)** loads Google Fonts or your own files for text clips.
- API reference: [`HtmlTextClip`](https://docs.rendley.com/sdk/api-reference/classes/HtmlTextClip.html).

[Previous pageText clips](https://docs.rendley.com/sdk/getting-started/clips/text/) [Next pageSubtitle clips](https://docs.rendley.com/sdk/getting-started/clips/subtitles/)
