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.

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).

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: [
/* ... */
],
}),
];

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

Same outcome in JSON — props are nested under props, and every validator carries an explicit type discriminator:

{
"form": [
{
"kind": "input",
"type": "textinput",
"path": "user.firstName",
"label": "First name",
"validator": { "type": "string", "required": true, "minLength": 2 }
},
{
"kind": "input",
"type": "number",
"path": "user.age",
"validator": { "type": "number", "minimum": 0 }
},
{
"kind": "input",
"type": "dropdown",
"path": "user.country",
"props": { "items": [] }
},
{
"kind": "input",
"type": "repeater",
"path": "contacts",
"props": { "template": [] }
}
]
}
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
Calendargui.inputs.calendarCalendar
Checkboxgui.inputs.checkboxCheckbox
Currencygui.inputs.currencyCurrency
Customgui.inputs.customCustom Widgets
Date Inputgui.inputs.dateInputDate Input
Date Pickergui.inputs.datePickerDate Picker
Date Time Calendargui.inputs.dateTimeCalendarDate Time Calendar
Date Time Inputgui.inputs.dateTimeInputDate Time Input
Date Time Pickergui.inputs.dateTimePickerDate Time Picker
Dropdowngui.inputs.dropdownDropdown
Listgui.inputs.listList
Markdowngui.inputs.markdownMarkdown
Numbergui.inputs.numberInputNumber Input
Passwordgui.inputs.passwordPassword
Radio Groupgui.inputs.radiogroupRadio Group
Range Calendargui.inputs.rangeCalendarRange Calendar
Range Date Inputgui.inputs.rangeDateInputRange Date Input
Range Date Pickergui.inputs.rangeDatePickerRange Date Picker
Range Date Time Calendargui.inputs.rangeDateTimeCalendarRange Date Time Calendar
Range Date Time Inputgui.inputs.rangeDateTimeInputRange Date Time Input
Range Date Time Pickergui.inputs.rangeDateTimePickerRange Date Time Picker
Range Time Inputgui.inputs.rangeTimeInputRange Time Input
Range Time Pickergui.inputs.rangeTimePickerRange Time Picker
Repeatergui.inputs.repeaterRepeater
Selectgui.inputs.selectSelect
Tagsgui.inputs.tagsTags
Textareagui.inputs.textareaTextarea
Textinputgui.inputs.textInputTextinput
Time Inputgui.inputs.timeInputTime Input
Time Pickergui.inputs.timePickerTime Picker
Togglegui.inputs.booleanInputToggle