Zag ships finite-state machines for dialogs, menus, date pickers, and similar widgets across React, Vue, Solid, and Svelte with WAI-ARIA behavior you style yourself.
Overview
Zag provides framework adapters that wire shared state machines to your markup. Keyboard navigation, focus management, and ARIA attributes follow WAI-ARIA authoring practices while visuals stay entirely in your design system.
The same machines run through @zag-js packages for React, Vue, Solid, Svelte, Preact, or vanilla JavaScript. Machines describe interaction states explicitly, with Playwright coverage noted across frameworks.
Consumers install a specific machine package plus the adapter for their framework, connect outputs to elements, and apply their own CSS or component libraries.
The project grew from Chakra UI work and credits influences such as Radix UI, XState, and Material Components Web.
Key features
- Headless component state machines
- React, Vue, Solid, Svelte adapters
- WAI-ARIA interaction patterns
- Keyboard and focus management
- Vanilla and Preact support
- Playwright-tested behaviors
- Per-component machine packages
- Bring-your-own styling
Use cases
- Building accessible design systems
- Sharing logic across JS frameworks
- Custom-styled date and menu widgets
- Predictable complex UI behavior
- Replacing ad hoc component state