node-red-dashboard-2-ui-barcode-input 1.0.1
A Node-RED Dashboard 2.0 widget that supports input via USB barcode scanners
Barcode Input Widget for Node-RED Dashboard 2.0
A specialized input widget for Node-RED Dashboard 2.0 designed specifically for USB barcode scanner integration in industrial IoT and automation applications.

Key Features
🎯 Persistent Focus Management
The widget automatically maintains focus on the input field, ensuring that barcode scanner input is always captured regardless of user interactions with other dashboard elements. This eliminates the common problem of "lost scans" when operators inadvertently click elsewhere on the dashboard.
⚡ Optimized for USB Scanners
- Universal HID Support: Works with all USB HID barcode scanners
- Multiple Symbologies: Supports EAN, Code 128, QR Code, Data Matrix, and more
- Instant Output: Enter key automatically triggers message output
- Configurable Auto-clear: Optionally clears input field after each scan
🎨 Professional Appearance
- Material Design icon integration
- Customizable label and placeholder text
- Rounded input field with subtle shadow effect
- Fully responsive and consistent with Dashboard 2.0 design language
Installation
Via Node-RED Palette Manager (Recommended)
- Open Node-RED editor
- Click Menu (☰) → Manage palette
- Switch to "Install" tab
- Search for
@crismancich/node-red-dashboard-2-ui-barcode-input - Click "Install"
Via npm
cd ~/.node-red
npm install @crismancich/node-red-dashboard-2-ui-barcode-input
Restart Node-RED after installation.
Quick Start
- Drag the Barcode Input node from the Dashboard 2.0 palette onto your flow
- Double-click to configure
- Select a Dashboard group
- Configure label and placeholder text (optional)
- Connect the output to your processing logic
- Deploy and navigate to your Dashboard
The widget will automatically capture barcode scanner input and send the scanned value as msg.payload.
Configuration
Node Properties
| Property | Type | Default | Description |
|---|---|---|---|
| Name | string | - | Optional node name for identification in Node-RED |
| Group | ui-group | - | Dashboard group where widget will be displayed (required) |
| Size | object | auto | Width and height in grid units |
| Label | string | "Barcode" | Text label displayed with input field |
| Placeholder | string | "Scan barcode..." | Hint text shown when input is empty |
| Icon | string | "barcode" | Material Design icon name (without "mdi-" prefix) |
| Icon Position | string | "left" | Icon position relative to label: "left" or "right" |
| Icon Inner Position | string | "inside" | Icon position relative to input box: "inside" or "outside" |
| Clear on Send | boolean | true | Automatically clear input after sending message |
Icon Examples
The widget supports all Material Design Icons. Some popular choices for barcode applications:
barcode- Standard barcode icon (default)barcode-scan- Barcode with scan lineqrcode- QR code iconqrcode-scan- QR code with scan framepackage-variant- Package/box icon
Note: Do not include the "mdi-" prefix when specifying icons.
Output Format
When a barcode is scanned (Enter key pressed), the widget outputs:
{
payload: "scanned_barcode_value" // String, trimmed of whitespace
}
Usage Examples
Basic Inventory Tracking
[Barcode Input] → [Function: Lookup Item] → [Database Query] → [Display Result]
Quality Control Station
[Barcode Input] → [Switch: Route by Product Type] → [Product-Specific Tests]
↓
[Store Results] → [Dashboard Display]
Warehouse Picking System
[Barcode Input] → [Validate Against Order] → [Update Pick List] → [Send to WMS]
Technical Details
Focus Management Mechanism
The widget employs three complementary techniques to maintain persistent focus:
- Initial Auto-focus: Focus is set immediately when the component mounts
- Blur Event Handler: Automatically refocuses if focus is lost
- Global Click Handler: Intercepts all page clicks and refocuses the input field
This triple-redundant approach ensures reliable operation in production environments where operators may inadvertently interact with other dashboard elements.
Browser Compatibility
The widget is built on Vue 3 and Vuetify 3, providing excellent cross-browser compatibility:
- Chrome/Edge (Chromium) 90+
- Firefox 88+
- Safari 14+
Scanner Compatibility
Compatible with all USB HID barcode scanners that emulate keyboard input, including:
- Handheld barcode scanners
- Fixed-mount industrial scanners
- 2D imagers
- Omnidirectional presentation scanners
- Wireless scanners with USB dongles
Typical Applications
- Manufacturing: Production line tracking, work-in-progress monitoring
- Warehousing: Inventory management, picking and packing operations
- Retail: Point-of-sale systems, inventory audits
- Healthcare: Patient identification, medication tracking
- Logistics: Shipment tracking, proof of delivery
- Asset Management: Equipment tracking, maintenance logging
Development
Building from Source
git clone https://github.com/flowfuse/node-red-dashboard-2-ui-barcode-input.git
cd node-red-dashboard-2-ui-barcode-input
npm install
npm run build
Development Mode
npm run dev
This starts Vite in watch mode, automatically rebuilding when source files change.
Local Testing
cd ~/.node-red
npm install /path/to/node-red-dashboard-2-ui-barcode-input
Restart Node-RED to load the updated widget.
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add/update tests if applicable
- Submit a pull request
Support
- Issues: GitHub Issues
- Discussions: Node-RED Forum
- Documentation: Node-RED Dashboard 2.0 Docs
License
Apache License 2.0 - See LICENSE file for details
Author
Boris Crismancich
- GitHub: @crismancich
- Company: KUNBUS GmbH
Acknowledgments
Built for the Node-RED Dashboard 2.0 framework by FlowFuse.
Made with ❤️ for the Node-RED community