survey-creator-core
v3.2.4
Published
Framework-independent core of SurveyJS Survey Creator, an embeddable drag-and-drop form builder. Holds the editor model, design surface, toolbox, property grid, and logic/theme editors. Pair it with survey-creator-react, -angular, -vue, or -js to render.
Downloads
670,447
Keywords
Readme
SurveyJS Survey Creator — Core Model
survey-creator-core is the platform-independent model of Survey Creator, the drag-and-drop form builder for SurveyJS Form Library. It holds everything that does not depend on a rendering framework: the tab and plugin system, the design surface, the toolbox, the property grid, the logic, translation, and theme editors, undo-redo, localization, and the UI style sheets. It does not render anything on its own — pair it with one of the platform-specific UI packages below. Installing survey-creator-core alone is the most common reason the builder never appears on the page.
Survey Creator produces survey JSON schemas that SurveyJS Form Library renders in your application.
Try Survey Creator / Form Builder
Install
Install the UI package for your framework. survey-creator-core is a peer dependency of each one: npm 7 and later install it automatically; with pnpm or Yarn 1, add it explicitly:
npm install survey-creator-react # React
npm install survey-creator-angular # Angular
npm install survey-creator-vue # Vue 3
npm install survey-creator-js # HTML/CSS/JavaScriptTo add the model on its own (for example, in code shared between a UI layer and a Node.js service):
npm install survey-creator-coreLicense key
Survey Creator displays an alert banner until you activate a purchased commercial license. Activate your key with setLicenseKey from survey-core:
import { setLicenseKey } from "survey-core";
setLicenseKey("your-license-key-goes-here");Call it once during application startup, before you construct SurveyCreatorModel. Your key and step-by-step setup instructions are on the How to Remove the Alert Banner page in your SurveyJS account.
Usage
import { SurveyCreatorModel } from "survey-creator-core";
import "survey-core/survey-core.css";
import "survey-creator-core/survey-creator-core.css";
const creatorOptions = {
autoSaveEnabled: true,
collapseOnDrag: true
};
const creator = new SurveyCreatorModel(creatorOptions);
creator.saveSurveyFunc = (saveNo, callback) => {
// Save `creator.JSON` or `creator.text` to your database, then:
callback(saveNo, true);
};Pass the creator instance to the component from your UI package to render it — for example, <SurveyCreatorComponent creator={creator} /> in React. See the Get Started tutorial for your framework in the table below.
survey-creator-core also holds the model's own string table (editorLocalization), separate from survey-core's. Per-locale strings are imported from survey-creator-core/i18n.
Themes
survey-creator-core/survey-creator-core.css applies the Light UI theme; survey-creator-core.min.css is the minified build. The Dark, Contrast, and Survey Creator 2020 themes are imported from survey-creator-core/themes and applied with creator.applyCreatorTheme(theme):
import { DefaultDark } from "survey-creator-core/themes";
creator.applyCreatorTheme(DefaultDark);Because both the style sheets and applyCreatorTheme live in this package, UI theming works identically in every framework — the UI package you pair with survey-creator-core adds nothing to it.
To make a custom creator theme available for selection in the Survey Creator UI, register it with registerCreatorTheme(theme). See Dynamic UI Customization.
The UI theme styles the builder itself. The look of the forms it produces is edited in the built-in Theme tab and stored in the survey theme JSON. See Themes & Styles and Theme Editor.
Theme adapters
Themes are built on --sjs-* CSS custom properties (design tokens). A theme adapter maps an existing design system's variables onto those tokens, so a survey inherits the look of the host application instead of being restyled by hand. Survey Creator supports adapters: the form on the design surface and in the Preview tab is a real survey, so it picks up whichever adapter the page loads. Adapters ship with survey-core as plain CSS — import one after the base style sheets:
import "survey-core/survey-core.css";
import "survey-creator-core/survey-creator-core.css";
import "survey-core/themes/adapters/bootstrap-default.css";Adapters are available for Bootstrap, Material UI (mui.css), and shadcn/ui (shadcn-default.css, shadcn-new-york.css). Bootstrap additionally ships Bootswatch variants — bootstrap-darkly.css, bootstrap-flatly.css, and others. Because adapters read the host system's live variables, any Bootstrap or Bootswatch build re-skins the survey automatically. Matching icon sets are optional side-effect imports:
import "survey-core/themes/adapters/icons/lucide"; // or ".../icons/mui"Adapters are framework-independent and require no extra markup or configuration. They restyle the survey; the Survey Creator UI around it is styled by the creator UI themes described above. See Theme Adapters.
Key features
Editor Model
- Framework-independent editor model shared by every Survey Creator UI package
- Tab and plugin system, design surface, Toolbox, Property Grid, and logic, translation, and theme editors
- Undo-redo, localization, and the UI style sheets
- TypeScript support
- Client-side form editing without a required SurveyJS backend
Visual Form Editing
- Drag-and-drop form builder UI
- Multi-page forms and form wizards
- Conditional visibility, branching, validation, and calculated values
- Dedicated Logic and JSON Editor interfaces
- Form preview before publication
Customizable Editor UI
- Configure the Toolbox, Property Grid, tabs, actions, and editor behavior
- Create reusable configurations with the UI Preset Editor
- Add custom question types and reusable components
- Configure different editor experiences for roles, tenants, or subscription plans
Appearance Customization
- Built-in themes and custom branding
- Shared design token system based on CSS variables
- Theme Adapters for Bootstrap, Material UI, and shadcn/ui
- Localization and right-to-left language support
Related packages
| Framework | UI package | Get Started |
| --- | --- | --- |
| React | survey-creator-react | Tutorial |
| Angular | survey-creator-angular | Tutorial |
| Vue 3 | survey-creator-vue | Tutorial |
| HTML/CSS/JavaScript | survey-creator-js | Tutorial |
Documentation
For AI coding agents: https://surveyjs.io/llms.txt indexes the documentation. Any documentation page is also available as raw Markdown — append .md to its URL, for example https://surveyjs.io/survey-creator/documentation/get-started-react.md.
SurveyJS ecosystem
| Product | Purpose | License |
| --- | --- | --- |
| Form Library | Render dynamic forms from JSON | MIT |
| Survey Creator | Drag-and-drop form builder UI (this package) | Commercial |
| Dashboard | Visualize and analyze collected results | Commercial |
| PDF Generator | Render forms and responses as PDF | Commercial |
| AI Form Response Extractor | Extract responses from paper forms, PDFs, and images into a SurveyJS schema (ai-form-response-extractor) | MIT |
Build from sources
This monorepo does not use npm workspaces — each package installs and builds independently, but a root install is still required for the shared tooling (linting, Playwright).
Build
survey-librarySurvey Creator resolves
survey-coreand the framework renderers from the siblingsurvey-libraryrepository, so clone it into the same parent directory assurvey-creatorand build it first. Follow Build from sources in thesurvey-coreREADME.Clone the repo and install shared dependencies
git clone https://github.com/surveyjs/survey-creator.git cd survey-creator npm installNOTE: Make sure that the folders with the cloned
survey-libraryandsurvey-creatorrepositories are in the same directory.Install and build
survey-creator-corecd packages/survey-creator-core npm install npm run build:allBuild output goes to the
builddirectory.npm run buildproduces the JS bundle, the SCSS-compiled styles, and the UI presets;npm run build:alladds i18n and the API documentation. Usenpm run watch:devwhile developing.Every UI package resolves
survey-creator-corefrom../survey-creator-core/build, so survey-creator-core must be built before you build or test any UI package.Run unit tests
Unit tests use Vitest in a jsdom environment and live in
packages/survey-creator-core/tests. They are split into two Vitest projects:coreandpresets.npm run test # whole suite npm run test:watch # watch mode npm run test:core # only the "core" project npm run test:presets # only the "presets" project npx vitest run tests/creator-base-1.tests.ts # a single file npx vitest run -t "toolbox" # tests whose name matches a substringRun end-to-end tests
E2E, visual-regression, and accessibility tests are Playwright suites shared by all UI packages and run from a UI package directory (after
survey-creator-coreis built). Do not start an HTTP server yourself — the Playwright config starts its own.cd packages/survey-creator-react npm install npm run e2e:ci # e2e npm run e2e:ci -- --grep "TestName" # a single test npm run test:scr:ci # visual regression npm run test:a11y:ci # accessibilityBuild a UI package
Licensing
You can install Survey Creator and evaluate its full functionality right away — no license is needed to prototype, test, or build a proof of concept. Production use requires a commercial license for each developer who works with the SurveyJS APIs or implements the integration, and activating a license key removes the alert banner. The forms Survey Creator produces are rendered by SurveyJS Form Library, which is MIT-licensed and runs free of charge.
