Syntax
Estimated reading time: 2 minutesKita Html uses standard JSX syntax. HTML elements and attributes from the HTML specification are type-checked.
Fragments
Use fragments to return multiple elements without a wrapper.
Boolean attributes
When a boolean attribute is true, it renders as a valueless attribute. When false, it
is omitted entirely.
Style attribute
The style attribute accepts both strings and objects. Object keys are converted from
camelCase to kebab-case automatically.
Class attribute
The class attribute also accepts an array.
Falsy values are filtered out and the remaining values are joined with spaces.
This pattern is similar to clsx but does not support objects.
The tag element
The <tag of="name"> element renders a tag whose name is determined at runtime. Use this
when the tag name is dynamic or would otherwise be read as a component, such as a
capitalized name.
For tags known at compile time, prefer extending the JSX type system instead.
Serialization
Different JavaScript types serialize differently when used as children.
Arrays are concatenated with no separator. Booleans, null, and undefined produce no
output, matching React. bigint renders its digits, while React renders nothing.
Void elements
Void elements like <br />, <img />, <input />, and <meta /> do not produce a
closing tag. The runtime detects void elements by tag name.
Missing elements or attributes
If an HTML element or attribute is missing from the type definitions, open a pull request adding it. See the contributing guide for setup instructions.