Skip to content

Installation

GolemUI is a blazing fast JavaScript library for building dynamic forms from JSON files. It provides a free set of UI widgets with support for React, Angular, Lit, Vue, and Vanilla JS.

This guide walks you from an empty directory to a rendered form in five steps.

  1. Use Vite (or your favourite scaffolder) to create a fresh project for your framework. For example, with Vite:

    Terminal window
    npm create vite@latest my-form -- --template react-ts
    cd my-form && npm install
  2. Install @golemui/core, @golemui/gui-shared, and the .

    Terminal window
    npm i @golemui/core @golemui/gui-shared @golemui/react @golemui/gui-react --save

    The adapter still pulls in @golemui/gui-components and @golemui/gui-validators as peer dependencies — you won’t import from those directly.

  3. Load the CSS file directly in your HTML or import it in your Sass/CSS file.

    @import '@golemui/gui-components/index.css';
  4. The easiest way to define a form is through the Programmatic API, using an array of gui.* shortcuts. Alternatively, the same form can be defined using the JSON API if you prefer.

    import { gui } from '@golemui/gui-shared';
    import { GuiForm } from '@golemui/gui-react';
    const formDef = [gui.inputs.textInput('username')];
    const formData = { username: 'golemui' };
    const config = { formDef, data: formData };
    export function FormPage() {
    return (
    <div>
    <GuiForm config={config} />
    </div>
    );
    }

    Create a JSON file with your form definition and pass it to the form component:

    {
    "form": [
    { "kind": "input", "type": "textinput", "path": "username" }
    ]
    }

    Then load and render it in your framework. See the Integration section for framework-specific setup.

  5. Run your dev server and you’ll see your form rendered in the browser.

Ready for something more substantial? Walk through the Rent a Car form tutorial, where you’ll build a real, multi-field form with conditional logic, custom item renderers, async data loading, and form submission.

For framework-specific configuration (React, Angular, Lit, Vue), see the Integration section.