Skip to main content
Version: 1.0.8

Input

A single-line text field. Bound to a writable tag it reads and writes it; bound inside a Form it becomes a field of that form.

The Input component as it renders with its default settings.The Input component as it renders with its default settings.

Reach for it when you need:

  • Operator-entered setpoints and identifiers
  • A field inside a Form

Component name: Input · Category: Input

In the palette: Text input field

Properties​

Any property can be bound to a tag, another component's property, or a query.

PropertyTypeDefaultDescription
valuestring""—
placeholderstringType here...—
typeenumtextOptions: text · number · password · email · tel · url.
titlestringInput Field—
showTitlebooleantrue—
titleSizenumber0Title font size (px). 0 = follows the size. 1.0.8
sizeenuminheritField height, padding, text and title size. Project default = the project's Control size (Project settings → Theme). Use md or larger on touch panels. Options: inherit · xs · sm · md · lg · xl. 1.0.8
shadowbooleantrueShow a subtle drop-shadow on the input box. Turn off for a flat look.
clearablebooleanfalseShow an × button to clear the value while there is one. Works in text and number mode.
disabledbooleanfalse—
stylestyle{}Custom CSS properties

Events​

Attach event actions to these in the Event Manager.

EventLabelGroupPayload
clickClickMouseThe DOM event.
dblclickDouble clickMouseThe DOM event.
contextmenuRight clickMouseThe DOM event.
mouseenterMouse enterMouseThe DOM event.
mouseleaveMouse leaveMouseThe DOM event.
changeChangeInputThe DOM event.
submitSubmitInputThe DOM event.
focusFocusInputThe DOM event.
blurBlurInputThe DOM event.
Right-click behaves differently in the Designer

contextmenu fires your configured actions at runtime only — in LiveView and in preview. On the Designer canvas the right-click is captured to open the Event Manager, so testing it there will not run your actions. Test right-click in preview.

Notes​

Validate before writing. A value typed by a human is untrusted input like any other — check the range in a script action, or use a Form, which validates before it submits.

clearable works on a number field. Changed in 1.0.7 The property was offered for every input and saved happily, but on a number field the × was never drawn. It now sits just before the stepper rather than on top of it, and a clear reaches bindings and scripts at once instead of after the 200 ms typing debounce. The button keeps its space while the field is empty, so it appearing on the first keystroke never shifts the text you are typing. The same fix reaches the number and password fields of a Form.

On a number field, the keyboard focus ring now stays visible while the stepper arrows are hovered or used. Changed in 1.0.8

Size New in 1.0.8​

size sets the field's height, padding, text and title on one scale shared by every field widget:

sizexssmmdlgxl
Field height28 px36 px44 px52 px64 px
Text12 px13 px14 px16 px18 px

The default, Project default (inherit), follows the project's Control size (Project settings → Theme), so one setting resizes every field on every screen. Set size on a widget only where it has to differ. A field, a dropdown and a button at the same size line up exactly, side by side.

titleSize now defaults to 0, which follows the size. A number you set still wins.

Fields, buttons and menus draw smaller after upgrading to 1.0.8

Before 1.0.8 these widgets had one size, what is now md (a 44 px field). The project's Control size defaults to sm (36 px), sized for desktop dashboards, and every widget whose size is Project default follows it — which is every widget in an upgraded project. On a touch panel, set Project settings → Theme → Control size to md or larger: 44 px is the touch-target minimum.