Skip to main content

text-input

Add text input fields for user data entry on the dashboard.

Overview

The text-input node adds input fields to your dashboard. Supports various types: text, password, email, number, color picker, and more. Features validation, auto-completion, and custom formatting.

Text
Input
Number
Input
Email
Validated
Password
Hidden

Properties

Property Type Default Description
group string - Dashboard group
label string "Input" Label text
mode string "text" text, number, email, password, color, time, date
placeholder string "" Placeholder text
sendOnEnter boolean true Send on Enter key
delay number 300 Debounce delay (ms)

Input Types

text

number

email

password

Example: Device Configuration

Set device name via dashboard input.

// Text Input node configuration:
{
  "label": "Device Name",
  "mode": "text",
  "placeholder": "Enter device name",
  "topic": "config/device_name",
  "sendOnEnter": true
}

// User types "Sensor-Living-Room" and presses Enter
// Output: { payload: "Sensor-Living-Room", topic: "config/device_name" }

// Store in flow context:
flow.set("deviceName", msg.payload);

Example: Threshold Configuration

Set alert threshold with numeric validation.

// Text Input node configuration:
{
  "label": "Alert Threshold",
  "mode": "number",
  "topic": "config/threshold"
}

// Output is automatically a number
// { payload: 75 }  not { payload: "75" }

// Function node: Validate range
if (msg.payload < 0 || msg.payload > 100) {
    node.warn("Threshold must be 0-100");
    return null;
}
flow.set("alertThreshold", msg.payload);
return msg;

Control Messages

// Set input value
msg.payload = "New Value";
// Input field shows "New Value"

// Clear input field
msg.payload = "";

// Disable input
msg.ui_control = { "disabled": true };

// Enable input
msg.ui_control = { "disabled": false };

// Change placeholder
msg.ui_control = { "placeholder": "New placeholder..." };

// Focus on input
msg.ui_control = { "focus": true };

Related Nodes