How chakra-ui/zag works
Zag is a headless accessible-interaction library: users pair a component state machine with a framework adapter, connect the service to normalized props, and apply those props to their own markup. The repository separates shared machine runtime, framework bindings, and a broad catalog of component behaviors. The README documents the principal usage and framework support; unsampled machine and adapter internals are represented at directory level, so their finer interactions are not asserted.
Main entry points: frameworks Framework bindings · machines Selection and input · create-machine.ts Machine runtime · machine.ts React adapter
Components 17
Shared runtime
- Machine runtime
packages/core/src/create-machine.ts
Framework adapters
- Framework bindings
packages/frameworks - React adapter
packages/frameworks/react/src/machine.ts - Vue adapter
packages/frameworks/vue/src/machine.ts - Solid adapter
packages/frameworks/solid/src/machine.ts - Svelte adapter
packages/frameworks/svelte/src/machine.svelte.ts - Preact adapter
packages/frameworks/preact/src/machine.ts - Vanilla adapter
packages/frameworks/vanilla/src/machine.ts
Selection and input
- Selection and input
packages/machines - Collections and choice
packages/machines - Date controls
packages/machines
Overlays and navigation
- Dialogs and overlays
packages/machines - Menus and navigation
packages/machines
Other behaviors
- Feedback and presence
packages/machines - Layout and display
packages/machines
Other components
- Application developer
- Custom markup
Connections 18
- Application developer → Framework bindings: uses adapter
README.md - Application developer → Selection and input: chooses behavior
README.md - Selection and input → Framework bindings: provides machine
README.md - Framework bindings → Custom markup: connects props
README.md - Application developer → Custom markup: authors markup
README.md - Machine runtime → Framework bindings: powers adapters
README.md - Collections and choice → Framework bindings: provides machine
- Date controls → Framework bindings: provides machine
- Dialogs and overlays → Framework bindings: provides machine
- Menus and navigation → Framework bindings: provides machine
- Feedback and presence → Framework bindings: provides machine
- Layout and display → Framework bindings: provides machine
- Framework bindings → React adapter: includes binding
- Framework bindings → Vue adapter: includes binding
- Framework bindings → Solid adapter: includes binding
- Framework bindings → Svelte adapter: includes binding
- Framework bindings → Preact adapter: includes binding
- Framework bindings → Vanilla adapter: includes binding