# Wrapping (or newline) in Node with Long Title

**URL:** <https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068>\
**Category:** Developing Nodes\
**Created:** [10 October 2020 19:18 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068 "2020-10-10T19:18:11Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![cburkins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cburkins/32/30054_2.png) [@cburkins](https://discourse.nodered.org/u/cburkins)\
**Post date:** [10 October 2020 19:18 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/1 "2020-10-10T19:18:11Z")

</div>

I'd prefer to give my nodes longer title. For example "Only Office Lamp button single/double output". That certainly works fine, but the node ends of physically long on the canvas. I'd much prefer Node-RED to wrap the title into two or three lines, which would give me a taller (but less wide) node, which makes a longer flow more compact. I'd be happy with either an auto-wrap, or perhaps a newline character that I could use within the Node title

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [10 October 2020 19:53 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/2 "2020-10-10T19:53:57Z")

</div>

Welcome to the forum.  
\n is your friend! put \n at the end of each line of the name of your node.

```auto
[{"id":"f357dd80.704a","type":"inject","z":"cff6b188.f8ac2","name":"This is a node name\\n with multiple\\n lines","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":360,"wires":[[]]}]

```

---

<div class="post-metadata">

**Author:** ![cburkins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cburkins/32/30054_2.png) [@cburkins](https://discourse.nodered.org/u/cburkins)\
**Post date:** [10 October 2020 20:09 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/3 "2020-10-10T20:09:16Z")

</div>

Hmm, that's encouraging !

Just tried it, no joy. Exported so I could see a view similar to yours, and have now discovered that the GUI seems to be escaping my line returns for me, which I guess is polite of it 🙂

```auto
[{"id":"574cddf.aa6db24","type":"switch","z":"209e3a96.199a46","name":"Only\\n\"Office Desk Lamp\"\\nButton","property":"payload.event.device_ieee","propertyType":"msg","rules":[{"t":"eq","v":"00:15:8d:00:02:8f:47:ea","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":440,"y":220,"wires":[["89bc184e.bec558"]]}]

```

---

<div class="post-metadata">

**Author:** ![cburkins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cburkins/32/30054_2.png) [@cburkins](https://discourse.nodered.org/u/cburkins)\
**Post date:** [10 October 2020 20:09 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/4 "2020-10-10T20:09:58Z")

</div>

Maybe I have to edit via CLI ? Unsure how to do that in Node-Red, still getting the hang of it, my first day

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [10 October 2020 20:11 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/5 "2020-10-10T20:11:06Z")

</div>

> [@cburkins](#):
>
> Maybe I have to edit via CLI ?

What do you mean CLI?

You have quotes in your name, you don't need quotes!

Like this:  
First line \n Second line \n

---

<div class="post-metadata">

**Author:** ![cburkins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cburkins/32/30054_2.png) [@cburkins](https://discourse.nodered.org/u/cburkins)\
**Post date:** [10 October 2020 20:14 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/6 "2020-10-10T20:14:27Z")

</div>

Yup, sorry for confusion, was just adding quotes for convenience, let me post an example without it...

---

<div class="post-metadata">

**Author:** ![cburkins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cburkins/32/30054_2.png) [@cburkins](https://discourse.nodered.org/u/cburkins)\
**Post date:** [10 October 2020 20:16 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/7 "2020-10-10T20:16:17Z")

</div>

Here's a simpler example, just took inject node, and gave it a name with \n in it. Node-Red GUI seems to be escaping it.

```auto
[{"id":"f27e47fa.343358","type":"inject","z":"a94fa564.915bb8","name":"First line of Name\\nSecond line of name","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":600,"y":1040,"wires":[[]]}]

```

---

<div class="post-metadata">

**Author:** ![cburkins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cburkins/32/30054_2.png) [@cburkins](https://discourse.nodered.org/u/cburkins)\
**Post date:** [10 October 2020 20:16 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/8 "2020-10-10T20:16:59Z")

</div>

Here's what the GUI actually looks like:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/d/fd38bc391ab6584518ed1a65d5c6d9a45bcd8449.png)

---

<div class="post-metadata">

**Author:** ![cburkins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cburkins/32/30054_2.png) [@cburkins](https://discourse.nodered.org/u/cburkins)\
**Post date:** [10 October 2020 20:17 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/9 "2020-10-10T20:17:36Z")

</div>

If it's meaningful, I'm using Node-Red as an Add-on to Home Assistant

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [10 October 2020 20:17 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/10 "2020-10-10T20:17:37Z")

</div>

Put a space after /n

---

<div class="post-metadata">

**Author:** ![cburkins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cburkins/32/30054_2.png) [@cburkins](https://discourse.nodered.org/u/cburkins)\
**Post date:** [10 October 2020 20:19 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/11 "2020-10-10T20:19:09Z")

</div>

Hazaahh !!! That works 🙂 Thanks @ghayne (weird, but works)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/4/a43aaa077cd97c3961a11b8a1cd69f91e3c7be63.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [10 October 2020 21:03 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/12 "2020-10-10T21:03:16Z")

</div>

We had to add the requirement for the space otherwise too many nodes with names like c:\node-red\foo would break lines when you didn’t want them to.

---

<div class="post-metadata">

**Author:** ![cburkins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cburkins/32/30054_2.png) [@cburkins](https://discourse.nodered.org/u/cburkins)\
**Post date:** [10 October 2020 21:34 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/13 "2020-10-10T21:34:14Z")

</div>

Ahhh, makes sense ! Experience is a wonderful teacher, thanks for sharing your experience 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 October 2020 21:34 UTC](https://discourse.nodered.org/t/wrapping-or-newline-in-node-with-long-title/34068/14 "2020-10-24T21:34:21Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
