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.
One component, both platforms
Section titled “One component, both platforms”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.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
<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>@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
<View style={hozoStyles.hozo0} accessibilityLabel={"Welcome"}> <Text style={hozoStyles.hozo1} accessibilityRole="header">Hello</Text> <Text style={hozoStyles.hozo2}>Compiled at build time.</Text></View>{ 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.
Where to start
Section titled “Where to start”- Trying it: Getting started picks the page for your bundler or framework.
- Styling: How styles are resolved, Tailwind CSS and StyleX.
- Components & packages:
@hozo/uicomponents, all 76 compiled primitives, headless patterns & form, behaviors & i18n, navigation & deep links and typography & fonts. - Drawing, media, or embedded pages: Graphics & Embedded Content brings together Charts, SVG, Canvas, Three.js, Video & Audio, and WebView.
- Migrating an existing React Native app:
Migration Audit,
React Native compatibility (
@hozo/rn-compat) and the Blueskysocial-appcase study. - Something went wrong: Troubleshooting collects the traps people hit first.
- How it works: How the packages stack and Architecture. For the reasoning behind the design, see RFCs and design decisions.
- Trying it without installing: the REPL compiles in your browser, and the Storybook shows every component.