/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-integration-with-ht-29e7214ebd38-integration-with-html-middleware-s0027-c0000.md
Integration with html Middleware - hono-docs
Integration with html Middleware Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt integration with...
Integration with html Middleware
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#integration-with-html-middleware
Summary
Combine the JSX and HTML middlewares for powerful templating. For in-depth details, consult the HTML middleware documentation. ```tsx import { Hono } from 'hono' import { html } from 'hono/html' const app = new Hono...
Content
Combine the JSX and HTML middlewares for powerful templating. For in-depth details, consult the HTML middleware documentation.
import { Hono } from 'hono'
import { html } from 'hono/html'
const app = new Hono()
interface SiteData {
title: string
children?: any
}
const Layout = (props: SiteData) =>
html`<!doctype html>
<html>
<head>
<title>${props.title}</title>
</head>
<body>
${props.children}
</body>
</html>`
const Content = (props: { siteData: SiteData; name: string }) => (
<Layout {...props.siteData}>
<h1>Hello {props.name}</h1>
</Layout>
)
app.get('/:name', (c) => {
const { name } = c.req.param()
const props = {
name: name,
siteData: {
title: 'JSX with html sample',
},
}
return c.html(<Content {...props} />)
})
export default app