# How to add a button to a custom node similar to the Inject node?

**URL:** https://discourse.nodered.org/t/how-to-add-a-button-to-a-custom-node-similar-to-the-inject-node/74874
**Category:** Developing Nodes
**Created:** [8 February 2023 06:59 UTC](https://discourse.nodered.org/t/how-to-add-a-button-to-a-custom-node-similar-to-the-inject-node/74874 "2023-02-08T06:59:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kakyoism](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kakyoism/32/46283_2.png) [@kakyoism](https://discourse.nodered.org/u/kakyoism)
#### Post date: [8 February 2023 06:59 UTC](https://discourse.nodered.org/t/how-to-add-a-button-to-a-custom-node-similar-to-the-inject-node/74874/1 "2023-02-08T06:59:03Z")

</div>

I thought that my node would automatically have a button to its left end by giving it no input port. But it turns out that it just becomes non-interactable.

How to make it interactable like Inject?

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [8 February 2023 07:18 UTC](https://discourse.nodered.org/t/how-to-add-a-button-to-a-custom-node-similar-to-the-inject-node/74874/2 "2023-02-08T07:18:41Z")

</div>

> [@kakyoism](#):
>
> How to make it interactable like Inject?

As soon as you have a template, you already got the solution ... by checking the source code:

You may add a button by defining a `button` property in the nodes `registerType` function (html file) ... like it's [done for the inject node](https://github.com/node-red/node-red/blob/adfc5b3e98ea98e5c6c5da0660becbc6bc67fec3/packages/node_modules/%40node-red/nodes/core/common/20-inject.html#L709).

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [8 February 2023 07:20 UTC](https://discourse.nodered.org/t/how-to-add-a-button-to-a-custom-node-similar-to-the-inject-node/74874/3 "2023-02-08T07:20:38Z")

</div>

Also covered in the docs here [Node appearance : Node-RED](https://nodered.org/docs/creating-nodes/appearance#buttons)

---

<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: [22 February 2023 07:20 UTC](https://discourse.nodered.org/t/how-to-add-a-button-to-a-custom-node-similar-to-the-inject-node/74874/4 "2023-02-22T07:20:51Z")

</div>

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