Skip to content
KajayDocs
CreatorTypeScript SDKReact

Configure a Creator deployment

Restrict tabs, question types, editing, and property-grid presentation for one deployment.

Configure the default assembly

Use tabs to choose the visible views and their order. Use configuration for deployment restrictions that must apply beyond the visible controls.

A restricted deployment
import type { SurveyCreatorProps } from '@kajay/creator-react';

const deployment = {
  tabs: ['design', 'preview', 'logic'],
  configuration: {
    allowedTypes: ['text', 'comment', 'radiogroup'],
    blockedTypes: ['file'],
    grid: {
      hidden: ['visibleIf', 'enableIf'],
      titles: { colCount: 'Columns' },
      order: ['title', 'name', 'isRequired'],
    },
  },
} satisfies Pick<SurveyCreatorProps, 'tabs' | 'configuration'>;

<SurveyCreator
  value={definition}
  onChange={setDefinition}
  {...deployment}
/>

Allowed and blocked types affect the toolbox, conversion, paste, and other edit paths. They are enforcement rules, not merely a hidden button. An empty allowedTypes list means no types may be added.

Configure the property grid

Grid configuration can hide properties, change their labels or categories, and move selected rows earlier in their existing sections. Hiding a row affects the editor only; it does not remove an existing value from the definition.

  • hidden removes named rows and collections from the grid.
  • titles replaces derived labels by property name.
  • categories moves properties into named sections.
  • categoryOrder and order control presentation order.

Workspace lifetime

Registry, configuration, and session seams are initialization options. A changed survey document goes through the controlled-value contract; a changed deployment creates a different workspace.

Keep one deployment per workspace
import { useCreatorWorkspace } from '@kajay/creator-react';

function RestrictedCreator({ definition, tenantId }) {
  const workspace = useCreatorWorkspace({
    definition,
    configuration: {
      allowedTypes: ['text', 'comment'],
      isReadOnly: false,
    },
  });

  return <MyCreatorLayout workspace={workspace} />;
}

// Configuration is fixed for a workspace lifetime. If the tenant's
// deployment changes, remount it as a different workspace:
<RestrictedCreator key={tenantId} tenantId={tenantId} definition={definition} />