Skip to content

Hozo documentation

Hozo is a compiler. You write components with React Native’s vocabulary (View, Text, Pressable, and semantic primitives such as Heading and Nav) and Tailwind classes. The build turns them into semantic HTML, CSS and ARIA on the Web, and into React Native components and StyleSheet values on iOS and Android. What the build can read is compiled; only what it cannot read is left to a small runtime.

Hozo is early (0.x). It is published and tested, and its APIs may still change in any minor release. What Hozo does not do yet is the honest list.

This is the component from the README, rendered here by this site’s own build. Under its source is what the compiler wrote for each platform:

Hello

Compiled at build time.
Rendered by Hozo when this page was built. No JavaScript reaches the browser for it.
Welcome.tsx
import { Heading, Section, Text } from '@hozo/core'export function Welcome() {  return (    <Section accessibilityLabel="Welcome" className="gap-2 p-6">      <Heading level={2} className="text-xl font-bold">        Hello      </Heading>      <Text className="text-gray-600">Compiled at build time.</Text>    </Section>  )}
What the Web build writes
Markup
<section className="hozo-view hozo-0" aria-label={"Welcome"}>  <h2 className="hozo-1">Hello</h2>  <span className="hozo-2">Compiled at build time.</span></section>
CSS
@property --tw-leading {  syntax: "*";  inherits: false;}.hozo-0 {  gap: 8px;  padding-top: 24px;  padding-right: 24px;  padding-bottom: 24px;  padding-left: 24px;}.hozo-1 {  font-size: 20px;  line-height: var(--tw-leading, 28px);  font-weight: 700;}.hozo-2 {  color: oklch(44.6% 0.03 256.802);}
What the React Native build writes
Components
<View style={hozoStyles.hozo0} accessibilityLabel={"Welcome"}>  <Text style={hozoStyles.hozo1} accessibilityRole="header">Hello</Text>  <Text style={hozoStyles.hozo2}>Compiled at build time.</Text></View>
StyleSheet
{  hozo0: {    rowGap: 8,    columnGap: 8,    paddingTop: 24,    paddingRight: 24,    paddingBottom: 24,    paddingLeft: 24,  },  hozo1: {    fontSize: 20,    lineHeight: 28,    fontWeight: '700',  },  hozo2: {    color: '#4a5565',  },}

On the Web, a <section> with a name is a region landmark, the heading is an <h2>, and the classes are real CSS; no React Native for Web and no style runtime is involved. On iOS and Android the same source becomes View and Text with StyleSheet values.