CLI & Installation
The @glaceon/cli is a generator that downloads headless Zag.js wrappers from the component registry and writes clean TypeScript or Svelte source files directly into your project.
Adding components
Section titled “Adding components”Run the CLI in your project root to add a component:
npx @glaceon/cli add button --framework reactnpx @glaceon/cli add dialog --framework sveltenpx @glaceon/cli add select --framework solidIf you omit the --framework flag, the CLI prompts you interactively to choose your target framework:
npx @glaceon/cli add buttonThe CLI fetches the exact framework payload from the registry, bundles sub-components automatically (for example, CardHeader and CardContent arrive with Card), writes src/components/ui/cn.ts if it does not exist, and lists any @zag-js/* packages the machine requires.
Project setup
Section titled “Project setup”Install the class merging utilities before adding any component:
npm install clsx tailwind-mergebun add clsx tailwind-mergepnpm add clsx tailwind-mergeThe cn helper
Section titled “The cn helper”All components use a cn helper to merge Tailwind classes without specificity conflicts:
import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]): string { return twMerge(clsx(inputs));}Manual install
Section titled “Manual install”To add just the Zag packages without the CLI:
bun add @zag-js/react @zag-js/<component-machine>bun add @zag-js/svelte @zag-js/<component-machine>bun add @zag-js/solid @zag-js/<component-machine>Each component page lists the exact Zag machine package, props reference, and full usage code.