DEV Community

Cover image for πŸš€ BuilderUI: Create Delphi Interfaces Dynamically from JSON
JoΓ£o Bosco
JoΓ£o Bosco

Posted on

πŸš€ BuilderUI: Create Delphi Interfaces Dynamically from JSON

Have you ever found yourself copying and pasting the same UI code across multiple Delphi forms? I did β€” and that’s exactly why I created BuilderUI.

BuilderUI is a dynamic UI generator for Delphi that allows you to define components using JSON and render them at runtime. It’s perfect for scenarios where flexibility, rapid prototyping, or low-code customization is needed.

πŸ”§ What is BuilderUI?

BuilderUI is a Delphi engine that reads a JSON file and builds a fully working VCL form with components like:

  • TEdit, TLabel, TButton, TCheckBox, TComboBox
  • Containers like TPanel
  • Event support like OnClick

βœ… Main Features:

  • JSON-driven UI generation
  • Component positioning (Top, Left, Width, Height)
  • Runtime event handling
  • Clean and extensible architecture

πŸ§ͺ Example JSON Input

{
  "Name": "FrmLoginScreen",
  "Type": "TForm",
  "Caption": "Login Screen",
  "Width": 400,
  "Height": 300,
  "Components": [
    {
      "Type": "TLabel",
      "Name": "lblUser",
      "Caption": "Username",
      "Top": 20,
      "Left": 20
    },
    {
      "Type": "TEdit",
      "Name": "edtUser",
      "Top": 40,
      "Left": 20,
      "Width": 200
    },
    {
      "Type": "TButton",
      "Name": "btnLogin",
      "Caption": "Login",
      "Top": 80,
      "Left": 20
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

🧠 How It Works (Under the Hood) BuilderUI uses:

πŸ—οΈ Builder + Factory pattern to create UI elements
πŸ” RTTI to dynamically instantiate and set component properties
πŸ”Ž System.JSON for JSON parsing
πŸ§ͺ In-progress unit tests using DUnitX

πŸ’‘ Why BuilderUI?

Use cases:
Generate dynamic admin panels from metadata
Let clients define UI layouts via config
Create low-code solutions inside Delphi
Replace boilerplate screen generation with flexible runtime forms

🧭 Roadmap

Grouping and tabs with TPageControl
Data-aware components with binding
Drag-and-drop form designer
Integration with 3rd-party components (DevExpress, TMS)
JSON schema validation and autocomplete

βš™οΈ How to Use

Want a quick demo? Just clone the repo and run the example project.

  1. Clone the repository: git clone https://github.com/boscobecker/BuilderUI.git
  2. Open in Delphi (tested on Delphi 10.4 and 11+)
  3. Load a JSON file with layout
  4. Run the project and see the form created at runtime

πŸ™Œ Contribute or Give Feedback

This project is under active development.
If you're passionate about runtime UI, low-code, or just love Delphi β€” I'd love your feedback, ideas or contributions.
⭐ Star the project on GitHub
πŸ’¬ Comment here or open an issue
🀝 Connect with me on LinkedIn :https://www.linkedin.com/in/boscobecker/
πŸ”— GitHub Repo: https://github.com/boscobecker/BuilderUI

🧠 Follow me for more Delphi & .NET content!

Top comments (0)