> ## Documentation Index
> Fetch the complete documentation index at: https://docs.awaitio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Display HTML

> Shows HTML markup, sanitized first.

`io.display.html()` shows HTML markup in a folder's page or in a step of an action, e.g. a preview of an email. Scripts, event handlers and other active content are removed before it is shown. It only displays and returns nothing. Provided by the `@awaitio/display-html` package.

<Frame>
  <img src="https://mintcdn.com/awaitio/MjbT5AW66vMXbVck/images/io-display-html.png?fit=max&auto=format&n=MjbT5AW66vMXbVck&q=85&s=2792cca8a4af43012c973e6a60d19fe1" alt="An Email preview heading with two lines of formatted text and a blue link" width="1404" height="216" data-path="images/io-display-html.png" />
</Frame>

## Install

```bash theme={null}
npm install @awaitio/display-html
```

## Setup

Register it under the key you want in `io`:

```ts app.ts {5} theme={null}
import { displayHtml } from '@awaitio/display-html';

export const app = new AwaitIO({
  // name, actionsDirectory, theme, secret, users…
  components: { display: { html: displayHtml } },
});
```

## Usage

```ts theme={null}
const email = await renderTrialEndingEmail(account);

await io.display.html('Email preview', { html: email.html });
```

The label is the heading above the markup; pass `null` for none.

## Props

| Prop | Type | Required | Description |
| - | - | - | - |
| `html` | `string` | Required | The markup to show. |

## Sanitizing

The markup can carry data from users, so it goes through [DOMPurify](https://github.com/cure53/DOMPurify) in the browser right before it is shown: `<script>`, `on…` attributes such as `onerror`, `javascript:` links and similar are removed, and what stays gets the same text styles as [`io.display.markdown`](/io/display-markdown). For text you write yourself, markdown is usually simpler.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.