Skip to content

Input Widgets Overview

Input widgets are the workhorses of any form. Each one binds to a path in the form data, supports validators, tracks touched state, and emits onChange / onBlur events as the user interacts with it.

import { gui } from '@golemui/gui-shared';
const formDef = [
gui.inputs.textInput('user.firstName', {
label: 'First name',
validator: { required: true, minLength: 2 },
}),
gui.inputs.numberInput('user.age', { validator: { minimum: 0 } }),
gui.inputs.dropdown('user.country', { items: [/* ... */] }),
gui.inputs.repeater('contacts', { template: [/* ... */] }),
];

The first argument is always the data path. The optional second argument is the props object — flat for typed inputs (no nested props: {} like the JSON shape requires).

For the full per-widget signature list, see gui.inputs reference.

The same widget in JSON, with props nested:

{
"form": [
{
"kind": "input",
"type": "textinput",
"path": "user.firstName",
"label": "First name",
"validator": { "type": "string", "required": true, "minLength": 2 }
}
]
}
PropertyDescription
uidOptional unique id; one is generated if absent.
kindMANDATORY. Always 'input'.
typeMANDATORY. The widget type (textinput, dropdown, etc.).
pathMANDATORY. Dot-separated path in the form data (e.g. user.firstName).
labelVisible label text. Accepts a Localizable ({ key, default }) for i18n.
validatorValidation rules. See Features / Validators.
propsWidget-specific configuration. See each widget’s reference page.
WidgetDX shortcutReference
Textinputgui.inputs.textInputTextinput
Numbergui.inputs.numberInputNumber Input
Togglegui.inputs.booleanInputToggle
Passwordgui.inputs.passwordPassword
Currencygui.inputs.currencyCurrency
Checkboxgui.inputs.checkboxCheckbox
Radio Groupgui.inputs.radiogroupRadio Group
Selectgui.inputs.selectSelect
Dropdowngui.inputs.dropdownDropdown
Listgui.inputs.listList
Textareagui.inputs.textareaTextarea
Markdowngui.inputs.markdownMarkdown
Calendargui.inputs.calendarCalendar
Date Inputgui.inputs.dateInputDate Input
Date Pickergui.inputs.datePickerDate Picker
Range Calendargui.inputs.rangeCalendarRange Calendar
Range Date Inputgui.inputs.rangeDateInputRange Date Input
Range Date Pickergui.inputs.rangeDatePickerRange Date Picker
Repeatergui.inputs.repeaterRepeater
Customgui.inputs.customCustom Widgets