๐ŸŒ UIBUILDER FAQ: The simplest possible way to show some Node-RED data on a page

No code needed, just a default uibuilder node and an input message.


All of UIBUILDER's front-end templates including the default, all have the following in the HTML:

<div id="more" uib-topic="more"></div>

Even if you don't know any HTML at all, this should still give you some clues.

Now send a message to your uibuilder node with the msg.topic set to more and the msg.payload set to "Hi there".


Not very exciting? Well, it is the start. :smiley:

From there, you can update the page title and copy/paste the "more" line to get other updates (just change the topic and the id).

If you want to make the page look a bit nicer, try replacing everything between the <body> and </body> tags with this:

    <header>
        <h1 class="with-subtitle">Not Quite Blank Template</h1>
        <div role="doc-subtitle">Using UIBUILDER for Node-RED</div>
    </header>

    <main>
        <article>
            <h2>This is more ๐Ÿ˜บ</h2>
            <div id="more" uib-topic="more">Waiting for a message ...</div>
        </article>
    </main>

We've wrapped the heading with <header> and the content with <main> which centres the page output and limits its width to something readable. And we wrapped the data inside an <article> which creates a "card" style box. Finally, we added a card heading and a default message which is shown until you send something more useful.

From these simple starts, you can begin to build up more complex pages if you need to.

So next, try out some of the example flows and templates that UIBUILDER includes.

1 Like