Building a React app powered by Enonic
Contents
This is a step-by-step tutorial on building a client-side React application that renders structured content from Enonic. The application fetches published content through Guillotine, Enonic’s GraphQL API, and uses the @enonic/react-components library to render rich text.
Requirements: We recommend that you complete the introduction to Enonic before embarking on this tutorial. You should be familiar with React and TypeScript.
Intro
Enonic can be used as a headless CMS: editors manage content in Content Studio, and your application reads it through an API. In this tutorial the application is a single-page application built with Vite, which runs entirely in the browser.
You will complete the following steps:
-
Set up Enonic with sample content, and try out the GraphQL API
-
Create a React app and connect it to Enonic
-
List persons fetched from the API
-
Show the details of a single person
-
Render rich text, with control over links and images
-
Render macros using your own React components
The tutorial covers delivery of published content. If you need server-side rendering or live preview in Content Studio, have a look at the Next.js integration instead.
The finished application is available on GitHub.
Prerequisites
To follow this tutorial you will need:
-
The Enonic CLI
-
Node.js 24 or newer, with npm
-
Your favorite code editor
This version of the tutorial was produced and tested with the following stack:
| Component | Version |
|---|---|
|
Enonic XP |
8.1 |
|
Guillotine |
9 |
|
|
7 |
|
React |
19 |
|
Vite |
8 |
Using an older setup? Select the matching tutorial version from the version menu on this page.
Get started by setting up Enonic.