Skip to main content

CreateWorkspaceForm

Form for creating new workspaces with organization selection and image upload support.
import { CreateWorkspaceForm } from "@wacht/react-router";

export default function NewWorkspacePage() {
  return <CreateWorkspaceForm />;
}

With Pre-selected Organization

import { CreateWorkspaceForm } from "@wacht/react-router";

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

With Callbacks

import { CreateWorkspaceForm } from "@wacht/react-router";
import { useNavigate } from "react-router";

export default function NewWorkspacePage() {
  const navigate = useNavigate();

  return (
    <CreateWorkspaceForm
      onSuccess={() => navigate("/workspaces")}
      onCancel={() => navigate(-1)}
    />
  );
}

Form Fields

  • Organization Selector - Dropdown to select organization (required if not pre-selected)
  • Workspace Logo - Image upload (max 2MB, PNG/JPEG/GIF)
  • Workspace Name - Required, 2-100 characters
  • Description - Optional, max 500 characters
The organization dropdown shows all organizations the user is a member of (with restricted ones disabled) plus a “Create new organization” option.

Params

organizationId
string
Pre-selected organization ID.
onSuccess
(workspace?: any) => void
Callback called after successful creation.
onCancel
() => void
Callback called when user cancels.
onCreateOrganization
() => void
Callback when user clicks “Create new organization”.