From 1ea3efc9798f906e5eedb599a9415690f1ab0811 Mon Sep 17 00:00:00 2001 From: Jane Date: Tue, 29 Jul 2025 16:10:20 +0300 Subject: [PATCH 1/4] Save the theme --- .../local-first-form-builder/index.html | 127 +++++++++++++----- 1 file changed, 90 insertions(+), 37 deletions(-) diff --git a/blogpost-apps/local-first-form-builder/index.html b/blogpost-apps/local-first-form-builder/index.html index ae9446ff..7c7bacd0 100644 --- a/blogpost-apps/local-first-form-builder/index.html +++ b/blogpost-apps/local-first-form-builder/index.html @@ -21,52 +21,105 @@
- + - creator.render("surveyCreatorContainer"); - From 66b6fb45ec52939abc7203eccfa286f3a00b680c Mon Sep 17 00:00:00 2001 From: Jane Date: Tue, 29 Jul 2025 16:12:32 +0300 Subject: [PATCH 2/4] Update page title --- blogpost-apps/local-first-form-builder/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blogpost-apps/local-first-form-builder/index.html b/blogpost-apps/local-first-form-builder/index.html index 7c7bacd0..832e91d8 100644 --- a/blogpost-apps/local-first-form-builder/index.html +++ b/blogpost-apps/local-first-form-builder/index.html @@ -3,7 +3,7 @@ - SurveyJS Creator V2 (pReact version) + SurveyJS Form Builder (pReact version) From 83322812e96b2088bcb251bd251b9e40189faa57 Mon Sep 17 00:00:00 2001 From: Jane Date: Tue, 29 Jul 2025 17:02:10 +0300 Subject: [PATCH 3/4] Add some comments --- blogpost-apps/local-first-form-builder/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blogpost-apps/local-first-form-builder/index.html b/blogpost-apps/local-first-form-builder/index.html index 832e91d8..586f117e 100644 --- a/blogpost-apps/local-first-form-builder/index.html +++ b/blogpost-apps/local-first-form-builder/index.html @@ -69,6 +69,7 @@ } } + // Persist a survey JSON creator.saveSurveyFunc = (saveNo, callback) => { try { const currentJSON = creator.JSON; @@ -82,7 +83,8 @@ markSyncedIfBothSaved(); callback(saveNo, true); }; - + + // Persist a survey theme creator.saveThemeFunc = (saveNo, callback) => { try { const currentTheme = creator.theme; From 39a33e19cff1afc469c95dabb88318b88ae54f1f Mon Sep 17 00:00:00 2001 From: Jane Date: Tue, 29 Jul 2025 17:04:52 +0300 Subject: [PATCH 4/4] Add Readme --- .../local-first-form-builder/README.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 blogpost-apps/local-first-form-builder/README.md diff --git a/blogpost-apps/local-first-form-builder/README.md b/blogpost-apps/local-first-form-builder/README.md new file mode 100644 index 00000000..e66fb348 --- /dev/null +++ b/blogpost-apps/local-first-form-builder/README.md @@ -0,0 +1,26 @@ +# SurveyJS Form Builder – Offline Preact Demo + +This is a lightweight demo showcasing how to use the [SurveyJS Form Builder](https://surveyjs.io/open-source) in an **offline-first Preact** setup. + +## Features + +- How to self-host the SurveyJS Form Builder +- How to work completely offline (no internet required) +- How to save/load survey JSON and theme to/from `localStorage` +- How to sync survey data manually when needed + +## Related Blog Post +Read the full tutorial here: [Build Truly Offline Web Forms with SurveyJS](https://surveyjs.io/stay-updated/blog/local-fist-form-builder#try-the-demo-offline-surveyjs-creator). + +## Tech Stack + +- Preact +- SurveyJS Form Library +- LocalStorage API + +## How to Run + +1. Clone this repository +2. Open `index.html` directly in a browser — no server required + +This demo is static and runs 100% in the browser.