How the packages stack
Hozo’s packages divide by who runs them: the compiler, or your app at runtime. The dependency arrows point down, and the bottom depends on nothing:
- Primitives are what you write:
View,Text,Heading,Meter, and the rest. The compiler lowers each one to a host element (<div>, React Native’sView) with its classes compiled. A few lower to a small runtime component instead, such asHozoBadgeorHozoDialog, when the element needs structure a single tag cannot carry. Static output is safe for server rendering without'use client'. @hozo/engineis the runtime the compiled output calls: environment hooks (dark:,md:,motion-safe:), the animation and keyframe hooks, and the class resolver for classes only known at runtime.- Patterns are stateful widgets that ship as runtime code. Their behavior stays with the widget: for example, focus and keyboard handling on the Web, or touch and accessibility actions on Native. The compiler can prepare styles for the class slots it recognizes, but the widget still applies them to its own hosts. See Architecture for the build/runtime boundary.
@hozo/behaviorsis the base every string-showing and focus-handling package builds on, so accessibility and internationalisation are designed in from the start rather than added at the end (decision 008). The compiler statically removes what is knowable at build time (static initial focus, build-time ARIA IDs, static siblinginertfor portals).@hozo/uiis a look. Its components are classes over the packages above, shipped as source so your build compiles them with your theme.- The RFCs and older comments call these Layer 1 (primitives), Layer 2 (behaviors) and Layer 3 (patterns). The numbering reads as if each layer were built from the one below it. Patterns are built on behaviors, not on primitives, which is what this section used to get wrong (#764).
- Domain, navigation, and migration packages sit beside this stack as opt-in packages so applications that do not use them carry none of their dependencies:
@hozo/charts,@hozo/svg,@hozo/canvas,@hozo/three,@hozo/media, and@hozo/webviewfor graphics, media, and embedded frames.@hozo/navigationfor router-agnostic links, deep links, and.well-knownverification files.@hozo/nativefor Android TalkBack focus restoration.@hozo/rn-compatand@hozo/migration-auditfor migrating existing React Native applications; its command ishozo dry-fitfrom@hozo/cli, the onehozocommand for every Hozo tool.