Skip to content

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:

@hozo/uiLooks: classes over the layers below. Shipped as source, compiled by your build.@hozo/coreRe-exports, for zero-setup authoring. Owns no implementation.Primitives (compiled)@hozo/primitives · @hozo/semantics@hozo/typographyLowered by the compiler;listed in docs/primitives.mdPatterns (runtime)@hozo/patterns · @hozo/formDialog · Tabs · Menu · Combobox ·Popover · Chip · DatePicker …Write host elements directly@hozo/engineWhat compiled output calls atruntime: environment, animationand class hooks@hozo/behaviorsAccessibility and internationalisation as first-class behaviours:FocusScope · RovingFocus · LiveRegion · Portal · FloatingPositioner ·usePresence · HozoI18nProvider. 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’s View) with its classes compiled. A few lower to a small runtime component instead, such as HozoBadge or HozoDialog, when the element needs structure a single tag cannot carry. Static output is safe for server rendering without 'use client'.
  • @hozo/engine is 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/behaviors is 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 sibling inert for portals).
  • @hozo/ui is 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: