# datocms-structured-text-generic-html-renderer

> A set of Typescript types and helpers to work with DatoCMS Structured Text fields

Latest version **6.0.0** (published 2026-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install datocms-structured-text-generic-html-renderer
pnpm add datocms-structured-text-generic-html-renderer
yarn add datocms-structured-text-generic-html-renderer
bun add datocms-structured-text-generic-html-renderer
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2026-05-25 |
| First published | 2021-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 36.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | Stefano Verna |
| Maintainers | marcelofinamorvieira, stefanoverna, delphaber, mat_jack1, souljuse, sistrall_, datoroger |
| Keywords | datocms, structured-text |

## Links

- npm: https://www.npmjs.com/package/datocms-structured-text-generic-html-renderer
- Repository: https://github.com/datocms/structured-text
- Homepage: https://github.com/datocms/structured-text/tree/master/packages/generic-html-renderer#readme
- Issues: https://github.com/datocms/structured-text/issues
- npm.io page: https://npm.io/package/datocms-structured-text-generic-html-renderer

## Dependencies (1)

- [datocms-structured-text-utils](https://npm.io/package/datocms-structured-text-utils.md) ^6.0.0

## Recent versions

- 6.0.0 (latest) — 2026-05-25
- 4.1.0-alpha.0 (next) — 2025-01-17
- 5.1.16 — 2026-05-03
- 5.1.15 — 2026-04-28
- 5.1.14 — 2026-04-28
- 5.1.13 — 2026-04-28
- 5.1.11 — 2026-04-27
- 5.1.9 — 2026-04-24
- 5.1.7 — 2025-12-05
- 5.1.6 — 2025-10-01
- 5.1.5 — 2025-10-01
- 5.1.4 — 2025-09-21
- 5.1.3 — 2025-09-20
- 5.1.2 — 2025-09-19
- 5.1.1 — 2025-09-10
- … 61 more at https://npm.io/package/datocms-structured-text-generic-html-renderer/versions

## README

<!--datocms-autoinclude-header start-->

<a href="https://www.datocms.com/"><img src="https://www.datocms.com/images/full_logo.svg" height="60"></a>

👉 [Visit the DatoCMS homepage](https://www.datocms.com) or see [What is DatoCMS?](#what-is-datocms)

---

<!--datocms-autoinclude-header end-->

![Node.js CI](https://github.com/datocms/structured-text/workflows/Node.js%20CI/badge.svg)

# structured-text

Monorepo with Typescript libraries for handling and rendering [DatoCMS Structured Text documents](https://www.datocms.com/docs/structured-text/dast).

## Packages

### Official

- [`html-to-structured-text`](https://github.com/datocms/structured-text/tree/main/packages/html-to-structured-text)
  - Convert HTML (or [Hast](https://github.com/syntax-tree/hast) syntax tree) to a valid Structured Text document.
- [`datocms-structured-text-utils`](https://github.com/datocms/structured-text/tree/main/packages/utils)
  - A set of Typescript types and helpers to work with DatoCMS Structured Text fields.
- [`datocms-structured-text-to-plain-text`](https://github.com/datocms/structured-text/tree/main/packages/to-plain-text)
  - Plain text renderer for the Structured Text document.
- [`datocms-structured-text-to-html-string`](https://github.com/datocms/structured-text/tree/main/packages/to-html-string)
  - HTML renderer for the DatoCMS Structured Text field type.
- [`datocms-structured-text-to-markdown`](https://github.com/datocms/structured-text/tree/main/packages/to-markdown)
  - Markdown renderer for the DatoCMS Structured Text field type.
- [`<StructuredText />`](https://github.com/datocms/react-datocms#structured-text)
  - React component that you can use to render Structured Text documents.
- [`<datocms-structured-text />`](https://github.com/datocms/vue-datocms#structured-text)
  - Vue component that you can use to render Structured Text documents.
- [`datocms-structured-text-to-dom-nodes`](https://github.com/datocms/structured-text/tree/main/packages/to-dom-nodes)
  - DOM nodes renderer for the DatoCMS Structured Text field type. To be used inside the browser, as it expects to find `document.createElement`.
- [`datocms-contentful-to-structured-text`](https://github.com/datocms/structured-text/tree/main/packages/contentful-to-structured-text)
  - Convert Contentful Rich Text to a valid Structured Text document.
- [`datocms-structured-text-dastdown`](https://github.com/datocms/structured-text/tree/main/packages/dastdown)
  - Lossless textual serialization (dastdown) for Structured Text documents, with both a parser and a serializer.
- [`datocms-structured-text-slate-utils`](https://github.com/datocms/structured-text/tree/main/packages/slate-utils)
  - Helpers to translate Structured Text documents to and from [Slate](https://docs.slatejs.org/) structures.
- [`datocms-structured-text-generic-html-renderer`](https://github.com/datocms/structured-text/tree/main/packages/generic-html-renderer)
  - Shared building blocks for the HTML-ish renderers above. You rarely depend on it directly.

## About Structured Text

- [Introduction](https://www.datocms.com/docs/content-modelling/structured-text)
- [Structured Text format](https://www.datocms.com/docs/structured-text/dast)
- [Migrating to Structured Text](https://www.datocms.com/docs/structured-text/migrating-content-to-structured-text)
- [Fetching Structured Text using DatoCMS GraphQL API](https://www.datocms.com/docs/content-delivery-api/structured-text-fields)
- [Creating Structured Text fields using DatoCMS Rest API](https://www.datocms.com/docs/content-management-api/resources/field/create#creating-structured-text-fields)
- [Creating records with Structured Text fields using DatoCMS Rest API](https://www.datocms.com/docs/content-management-api/resources/item/create#structured-text-fields)

## Working on this repository

An npm-workspaces monorepo built with [Turborepo](https://turborepo.com/) and
released with [Changesets](https://github.com/changesets/changesets).

```sh
git clone https://github.com/datocms/structured-text && cd structured-text
npm install     # one install for all ten packages; no bootstrap step
npm run build   # turbo, in dependency order
npm test        # eslint, then the Jest suite (448 tests, nothing external)
```

Node 22 or later — see `.nvmrc`. The published packages themselves have no such
requirement; it is the release tooling that does.

The packages resolve each other through their built `dist/`, so **run
`npm run build` before `npm test`** on a fresh checkout.

### Trying a change before it's released

Every push to a branch here publishes a preview of all ten packages, which you
can install anywhere — no npm release, no `npm link`:

```
npm i https://pkg.pr.new/datocms-structured-text-utils@<commit-sha>
```

The exact URLs show up in the commit's check run on GitHub, and in a comment on
the pull request once there is one. Installing one preview pulls in the previews
of its siblings built from the same commit, so a change spanning several
packages can be tried as one coherent set.

Previews are throwaway: they are never published to npm, and the URL stops
resolving after a while. Never commit one to a `package.json` that ships.

### Releasing (maintainers)

Every user-visible change needs a changeset: run `npx changeset` from the repo
root in the same PR, pick the packages that changed and the bump level (`patch`
is for bug fixes only, new API surface is `minor`), and commit the file it
writes under `.changeset/`. See [`.changeset/README.md`](.changeset/README.md)
for the details — in particular, the packages version **independently**, so
which ones you list matters.

To release, from an up-to-date, clean `main`, run `npm run release` from the
repo root. It builds and tests, applies the pending changesets — bumping only
the packages that changed and writing their `CHANGELOG.md`s — publishes to npm,
and only then tags each published package `name@X.Y.Z`, pushes, and creates a
GitHub release per tag whose notes come straight from those changelog entries.
An interrupted release is resumed by re-running it, never undone. Use
`npm run release:next` for a prerelease under the `next` dist-tag.

The script itself lives in
[`@datocms/release-toolchain`](https://github.com/datocms/release-toolchain),
shared with every other DatoCMS repository and pinned here by tag.

## License

This repository is published under the [MIT](LICENSE.md) license.

<!--datocms-autoinclude-footer start-->

---

# What is DatoCMS?

<a href="https://www.datocms.com/"><img src="https://www.datocms.com/images/full_logo.svg" height="60" alt="DatoCMS - The Headless CMS for the Modern Web"></a>

[DatoCMS](https://www.datocms.com/) is Headless CMS for the modern web. Trusted by 25,000+ businesses, agencies, and individuals, it gives your team one place to manage content and ship it to any website, app, or device via API.

**New here?** Start with [Create free account](https://dashboard.datocms.com/signup) and the [Documentation](https://www.datocms.com/docs). Stuck? Ask the [Community](https://community.datocms.com/). Curious what's new? [Product Updates](https://www.datocms.com/product-updates).

**Building with AI:** [Agent Skills](https://www.datocms.com/docs/agent-skills) turn coding assistants (Claude Code, Cursor) into expert DatoCMS developers, with full read/write via the auto-installed CLI. No local terminal? Use the [MCP Server](https://www.datocms.com/docs/mcp-server) instead.

**Talking to DatoCMS from code:**

- [Content Delivery API](https://www.datocms.com/docs/content-delivery-api) (CDA) — the fast, read-only GraphQL API your website/app uses to **fetch** published content.
- [Content Management API](https://www.datocms.com/docs/content-management-api) (CMA) — the REST API for **creating and updating** content, models, and project settings (think scripts, migrations, integrations).
- [CLI](https://www.datocms.com/docs/scripting-migrations/installing-the-cli) — terminal tool for schema migrations and importing from Contentful/WordPress.

**Framework guides:** end-to-end recipes for fetching content, rendering Structured Text, optimizing images/video, handling SEO, and setting up live preview with visual editing in [Next.js](https://www.datocms.com/docs/next-js), [Nuxt](https://www.datocms.com/docs/nuxt), [Svelte](https://www.datocms.com/docs/svelte), and [Astro](https://www.datocms.com/docs/astro).

**Want a head start?** Browse our [starter projects](https://www.datocms.com/marketplace/starters) — ready-to-deploy example sites for popular frameworks.

<!--datocms-autoinclude-footer end-->

---
_Source: https://npm.io/package/datocms-structured-text-generic-html-renderer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
