Base Templates
Estimated reading time: 2 minutesMost applications use a shared layout with a doctype, <head>, and <body>. In Kita
Html, layouts are regular components that accept children and slot props.
Basic layout
The {'<!doctype html>'} string is concatenated before the <html> tag. JSX cannot
express a doctype natively, so it is inserted as a string expression.
Slot props
For layouts with multiple content regions, use additional props for each slot.
Framework auto-doctype
When using @kitajs/fastify-html-plugin or @kitajs/express-html-plugin, the plugin
automatically prepends <!doctype html> to responses that start with an <html> tag.
This means you can omit the manual {'<!doctype html>'} string in your layout when using
either integration.