Hover shows a tooltip with your help text; you can also handle clicks, set different positions and use themes.

Good for
- Quickly adding inline help to e.g. inputs, textareas, and selects
- Keeping forms clean while still offering guidance
- You add a nu-help-icon-text attribute to any form object.
- Optionally add nu-help-icon-position to override tooltip position per element.
- Help icons appear automatically when the form loads - no JavaScript required!
- An icon appears to the right; hover to see a custom tooltip with precise arrow positioning. (Click support is optional.)
Automatic initialisation
The system runs automatically when forms are loaded, so you typically don't need any JavaScript. Just add the attributes to your form fields and you're done!
Refreshing (dynamic forms)
If you add or remove fields later, call:
Code: Select all
nuAttachHelpIconsToObjects(); // to attach to any new fields
nuAttachHelpIconsToObjects.refresh(); // to reposition existing icons
What to put in nu-help-icon-text
- Short, actionable guidance (HTML allowed).
- Keep it concise; the tooltip wraps at ~250px width.
Code: Select all
nu-help-icon-text="<b>Username</b>: 4–20 chars, letters & digits only."
- Icon color defaults to #53a1c4. Override via CSS on .nuHelpOverlay i.
- Tooltip is a lightweight custom element (.nuHelpToolTip) with a dark theme; override with CSS.
- The overlay (.nuHelpOverlay) and tooltip are created once per page.
- Tooltip arrows always point directly to the help icon regardless of tooltip size or position.
- Icons automatically reposition on window scroll and resize.
- Each field is watched with ResizeObserver to keep alignment accurate.
- Changing nu-help-icon-text or nu-help-icon-position updates the tooltip on next hover.
- Removing a field cleans up its observers and icon automatically.
- Tooltips are viewport-aware and adjust position to stay on screen while maintaining arrow alignment.
Override icon settings
In the form's Custom Code field:
Code: Select all
function nuOnAddHelpIcon(element, settings) {
// custom tooltip settings for object with element ID 'critical_input'
if (element.id === 'critical_input') {
settings.theme = 'red';
settings.iconSize = 20;
settings.gapRight = 12;
settings.tooltipPosition = 'top';
settings.animationDuration = 300;
settings.iconClasses = 'fa-solid fa-exclamation-triangle';
settings.onClick = function(el, text) {
alert('Critical field help: ' + text);
};
}
};
Options
- gapRight: Pixels to place the icon to the right of the field. Default: 8.
- iconSize: Icon size in pixels. Default: 16.
- zIndex: Base stacking context for the overlay (tooltip is +1). Default: 50.
- iconClasses: Classes for the help icon. Default: 'fa-solid fa-circle-question'.
- tooltipPosition: Default tooltip position for all elements. Can be overridden per element. Options: 'top', 'bottom', 'left', 'right'. Default: 'top'.
- onClick: Optional handler to run when the icon is clicked. Receives:
- el: the field element
- helpText: the help text from nu-help-icon-text