NewWacht Bench is live — AI-assisted development for Wacht

<CreateWorkspaceForm/> component

<CreateWorkspaceForm /> is the workspace creation surface. It works like the organization form, but it also needs an organization scope so the new workspace is created in the right place.

Usage

The following example shows a basic usage of <CreateWorkspaceForm />.

export default function CreateWorkspacePage() {  return <CreateWorkspaceForm organizationId="org_123" />;}

Properties

All properties are optional unless otherwise noted.

organizationId?: string | undefined;
The target organization scope for the new workspace.
onSuccess?: (result?: { workspace: Workspace; membership: WorkspaceMembership }) => void | undefined;
Called after the workspace is created and the session has been refreshed.
onCancel?: () => void | undefined;
Called when the user backs out of the form.
onCreateOrganization?: () => void | undefined;
Called when the user needs to create an organization first.

Behavior

The form keeps local state for the workspace name, description, image upload, preview image, selected organization, and submission state.
If the deployment allows organization creation from the workspace flow, the form can hand off to the organization form instead of blocking the user.
  • The workspace name is validated before submit.
  • The selected organization must be present before the request can succeed.

Examples

Workspace creation page

export default function CreateWorkspacePage() {  const organizationId = "org_123";  return <CreateWorkspaceForm organizationId={organizationId} />;}

On this page