opjsx

Installation

Add opjsx to a React project.

opjsx ships as a single package with React as a peer dependency.

pnpm add opjsx react

Requirements

  • React 18 or newer (works with React 19).
  • A TypeScript or JavaScript React app (Vite, Next.js, etc.).

Usage

Import the opjsx tagged-template function and return it from a component:

import { opjsx } from "opjsx";

export function App() {
  return opjsx`
    &main.container
      &h1
        Hello world
  `;
}

That's it — no Babel plugin, no compiler step. The template is parsed and rendered at runtime. Continue to Syntax.

On this page