Reinvent WP
Blog

Text to Speech Highlight for React and Next.js

Add a text to speech player that highlights sentences and words as they are being spoken in React and Next.js apps. Works with any TTS API like OpenAI, ElevenLabs, ReinventWP Cloud, etc.

Text to Speech DashboardNPM Package
Try the code generatorJS version

Give every reader another way to follow your story. Keep each word in focus.

Try it free. Pay when you're ready.

Get 40,000 hosted characters for 14 days. No credit card required.

Enter your website domain.

Simple pricing. Focus on your site grow

How many site do you have? Every license includes the complete Pro feature set. Choose a billing cycle, then select the number of sites.

Not ready to pay? Start with the free trial

Individual

1 site

$6

per month

Perfect for personal websites and solo projects.

Professional

5 sites

Most chosen

$20

per month

Ideal for freelancers and solo entrepreneurs managing multiple sites.

Company

20 sites

$120

per month

Best for agencies and businesses handling multiple client websites.

All Pro features included

40,000 cloud characters per month included

Use your own TTS provider API key anytime

Pricing notes

Plugin license

The price listed above is only for the NPM package access.

Third-party provider usage may have separate fees depending on the service you choose and your own API usage.

Bring your own provider

Connect your own third-party Text-to-Speech provider with your own API key, such as Google TTS, OpenAI TTS, ElevenLabs, Amazon Polly, or Azure TTS.

Managed Cloud PRO and refunds

Active monthly or annual subscriptions include 40,000 Reinvent WP Cloud PRO characters per month at no extra cost and with no API key required.

Refund within 14 days. Please refer to our refund policy for more details.

Why add audio to your website?

Give every visitor a simple choice: read your content or listen to it.

One story, different readers

Reach more people

Some visitors find long articles difficult to read. Audio gives them a simpler way to enjoy your content.

See the fact

W3C technique

W3C recognizes a spoken version as one way to make difficult written content more accessible.

See W3C guidance
A brief visit

Boost dwell time and SEO

Visitors who listen stay 2-3x longer than those who skim. Audio holds attention through the full article, extending time on page and improving the engagement signals search engines value.

See the fact

9:31 vs 3:51

One publisher saw audio listeners spend 9 minutes 31 seconds on site, compared with 3 minutes 51 seconds for readers.

Read the publisher story
Start listening

Let them listen anywhere

People can follow your posts while commuting, exercising, cooking, or doing anything away from a screen.

See the fact

131 million daily

Edison Research estimates that 131 million people in the U.S. listen to spoken-word audio every day.

See the audience report
A visitor is about to leave

Reduce bounce rate

Visitors who press play are far less likely to leave. Natural AI voices keep them through the full article, while robotic-sounding tools cause people to bounce within seconds.

See the fact

Listeners stayed longer

The publisher reported that audio listeners spent much longer on the site—a useful sign that people were not leaving immediately.

Read the publisher story

Built for React, Next.js

A light component, simple configuration

Create an article ref

React component API

Mount the player beside an article ref instead of manually scanning the DOM.
Start with browser speech

Next.js friendly

Start with browser speech, or provide a resolver that calls your own API route.
One article

Your choice of audio

Connect to industry leading text to speech providers, or start with browser speech.
OpenAI
OpenAI

Any provider

Pick your settings

Configure without guesswork

Generate a real code snippet from our config editor and paste it into the website.

Hear the voices

Try it free. Pay when you're ready.

Get 40,000 hosted characters for 14 days. No credit card required.

Enter your website domain.

Install. Connect. Start listening.

One package, a public site key, and an article ref. Start with browser speech before adding hosted audio.

  1. Install the package

    Add @reinventwp/text-to-speech to your app.

  2. Choose how to start

    Ready to subscribe? Choose a plan. Not ready to pay? Start with the free trial—40,000 hosted characters for 14 days, no card required.

  3. Copy your public site key

    Finish creating your project in the Text to Speech dashboard, then copy its public site key.

  4. Attach your article

    Create an articleRef, pass it with your publicKey to ReinventTTS, and attach the ref to your article element.

Install the package

npm install @reinventwp/text-to-speech

Simple React component

TypeScript

"use client";

import ReinventTTS from "@reinventwp/text-to-speech";
import { useRef } from "react";

/**
 * Generate public config visually with our config editor: 
 * https://reinventwp.com/text-to-speech/npm#code-generator
 */
const pluginConfig = {
  audio_source: "browser",
  read_title: true
};

// Get public key on https://reinventwp.com/dashboard/text-to-speech
const publicKey = "rwp_public_xxx";

export default function ArticlePage() {
  const articleRef = useRef<HTMLElement | null>(null);

  return (
    <>
      <ReinventTTS
        target={articleRef}
        publicKey={publicKey}
        pluginConfig={pluginConfig}
      />
      <article ref={articleRef}>...</article>
    </>
  );
}
Generate my code

Your settings. Your React code.

Adjust the settings, preview the player, then switch to Code to copy a TypeScript component for your app.

Your player

Designing a calmer publishing workflow

Audio versions help readers keep moving through a story while they cook, commute, or rest their eyes between tasks.

Go to the Text To Speech dashboard to get the public key. You must insert a valid public key to use the tts player.

Plugin config:

Read section

Which sections of your page will be read?

Altering Text

Edit text before sending it to the TTS API. The text will processed with the following sequence steps:

Exclude HTML Selectors

script
style
noscript
code
pre

Enter HTML selectors, then press Enter to add. You can also paste comma or space-separated values.

Exclude Texts

Enter text or words to exclude, then press Enter to add

Global Text Spoken Form

Example: Displayed = WP → Spoken form = WeePee

Case Sensitive

Spoken Prefix

Automatically say a short phrase before matched content such as image captions.

Caption Spoken Prefix Rules

Example: selectors = figcaption, prefix = Image showcasing

No spoken prefix rules yet. Add one to automatically say something like Image showcasing before matched caption text.

Try it free. Pay when you're ready.

Get 40,000 hosted characters for 14 days. No credit card required.

Enter your website domain.

Join our community.

Ask questions, share implementation issues, and help shape the next Text to Speech examples.

Join TelegramJoin Discord

Need a custom solution?

Running a high-traffic website or planning an enterprise integration? We can help you fit the technology to your application.

Discuss your project

reinventwp@gmail.com

Contact us

Tell us what you need. Include enough detail for us to understand your question and help you faster.

Prefer email? Write to support@reinventwp.com

0/2000 characters

By sending, you agree to share your email, website address, and message with Reinvent WP. Privacy Policy