Getting Started
Installation
Install Prism's five library packages and the prismrepo CLI from npm.
Prism ships as six public npm packages under the @prismrepo scope.
Install the library packages
npm install @prismrepo/core @prismrepo/forms @prismrepo/react @prismrepo/adapter-rhf @prismrepo/adapter-zod| Package | Purpose |
|---|---|
@prismrepo/core | Framework-independent, React-free contracts. No runtime dependencies. |
@prismrepo/forms | The registry and form-builder contracts: defineRegistry, createFormBuilder. |
@prismrepo/react | Optional React integration: PrismProvider, usePrismRegistry. |
@prismrepo/adapter-rhf | Binds Prism's form contracts to React Hook Form: usePrismForm, PrismField. |
@prismrepo/adapter-zod | Adapts a Zod schema into the resolver usePrismForm accepts: createZodResolver. |
You also need React Hook Form and Zod themselves, Prism adapts them, it doesn't bundle them:
npm install react-hook-form zodInstall the CLI
The prismrepo CLI (npm package @prismrepo/cli) is a devDependency-only, install-time tool.
It copies Prism's Layer 1 primitives and Layer 2 field components directly into your project,
it never becomes a runtime dependency of your application.
npm install -D @prismrepo/cliRun it without installing first, using npm exec:
npm exec --package @prismrepo/cli -- prismrepo initOr, once added as a devDependency, run the prismrepo command directly:
npx prismrepo initSee Requirements for supported React, Node, and TypeScript versions, and Quick Start to build your first form.