Files
Brad Anderson 436f9393b3 Revert "fix: remove catalog: deps"
This reverts commit 7dd128962d.
2025-08-16 09:32:20 -04:00
..
2025-01-29 15:39:31 +01:00
2025-06-12 13:40:19 +02:00
2025-06-09 10:33:53 +00:00
2025-06-09 23:13:47 +01:00
2024-12-12 15:09:20 +00:00
2025-06-06 08:02:38 +01:00

Form example with Jazz and React

Live version: https://form-demo.jazz.tools

This is a simple form example that shows you how to make a form for creating and editing a CoValue, called BubbleTeaOrder, with fields of different types such as single-select, multi-select, date, text, and boolean.

To create a new BubbleTeaOrder, we create an empty order. Because BubbleTeaOrder has some required fields, we can't create an empty BubbleTeaOrder directly.

Instead, we create a DraftBubbleTeaOrder, which has the same structure as BubbleTeaOrder, but with all fields set to optional.

When the user is ready to submit the order, we treat DraftBubbleTeaOrder as a "real order" by converting it into a BubbleTeaOrder.

See the full guide here.

Getting started

You can either

  1. Clone the jazz repository, and run the app within the monorepo.
  2. Or create a new Jazz project using this example as a template.

Using the example as a template

Create a new Jazz project, and use this example as a template.

npx create-jazz-app@latest form-app --example form

Go to the new project directory.

cd form-app

Run the dev server.

npm run dev

Using the monorepo

This requires pnpm to be installed, see https://pnpm.io/installation.

Clone the jazz repository.

git clone https://github.com/garden-co/jazz.git

Install and build dependencies.

pnpm i && npx turbo build

Go to the example directory.

cd jazz/examples/form/

Start the dev server.

pnpm dev

Open http://localhost:5173 with your browser to see the result.

Questions / problems / feedback

If you have feedback, let us know on Discord or open an issue or PR to fix something that seems wrong.

Configuration: sync server

By default, the example app uses Jazz Cloud (wss://cloud.jazz.tools) - so cross-device use, invites and collaboration should just work.

You can also run a local sync server by running npx jazz-run sync, and setting the sync parameter of JazzReactProvider in ./src/main.tsx to { peer: "ws://localhost:4200" }.