Elysia

Estimated reading time: less than 1 minute

@elysiajs/html integrates Kita Html with Elysia. The plugin is maintained as part of the Elysia ecosystem and uses @kitajs/html as its JSX runtime.

Setup

npm
yarn
pnpm
bun
npm i @elysiajs/html
import { Elysia } from 'elysia';
import { html } from '@elysiajs/html';

const app = new Elysia()
  .use(html())
  .get('/', () => (
    <html>
      <body>
        <h1>Hello from Elysia</h1>
      </body>
    </html>
  ))
  .listen(3000);

The plugin automatically sets Content-Type: text/html; charset=utf8, prepends the doctype, and converts JSX output into a proper response.

Configuration

The plugin accepts options for content type, auto-detection, and doctype behavior. Refer to the Elysia HTML plugin documentation for the full configuration reference and up-to-date usage examples.

XSS protection

The same XSS protection tooling applies. Install @kitajs/ts-html-plugin alongside @elysiajs/html for editor diagnostics and CI scanning with xss-scan.