# 该如何提供或自定义更对节点属性配置ui。(Custom Node Properties)

**URL:** <https://discourse.nodered.org/t/ui-custom-node-properties/96882>\
**Category:** Developing Nodes\
**Created:** [4 May 2025 15:00 UTC](https://discourse.nodered.org/t/ui-custom-node-properties/96882 "2025-05-04T15:00:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![752337625](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/752337625/32/100576_2.png) [@752337625](https://discourse.nodered.org/u/752337625)\
**Post date:** [4 May 2025 15:00 UTC](https://discourse.nodered.org/t/ui-custom-node-properties/96882/1 "2025-05-04T15:00:20Z")

</div>

我该如何在创建节点后，添加属性模板设置更多属性节点UI。

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [4 May 2025 18:29 UTC](https://discourse.nodered.org/t/ui-custom-node-properties/96882/2 "2025-05-04T18:29:42Z")

</div>

For others:

> After creating a node, how can I add an attribute template to set more attribute node UI?

Welcome to the forums @752337625

If you mean attributes, as in Settings for your node??

The first thing todo, is register them in your HTML file

Example : **my\_custom\_attribute**

```auto
<script type="text/javascript">
	RED.nodes.registerType('my-node-type', {
		category: '...',
		color: '...',
		defaults: {
			name: { value: 'My Node' },
			my_custom_attribute: { value: 'Some Default Value' },
		},
		inputs: 1,
		outputs: 1,
		icon: 'some-icon.svg',
		label: function () {
			return this.name;
		}
	});

</script>

```

**Also**...

Add the HTML inputs - take note of the `id` attribute for the element  
(it must match its name, along with the prefix) - **node-input-{Attribute-Name}**

```auto
<input type="text" id="node-input-my_custom_attribute" placeholder="Enter Your Value">

```

**Finally** , you can access this value in your module...  
and utilise as you see fit

```auto
module.exports = function (RED) {

	function Init(config) {
			RED.nodes.createNode(this, config);
            const MyAttribute = config.my_custom_attribute
    }

    RED.nodes.registerType('my-node-type', Init);

}

```

If this is not what you're asking - my apologies.

---

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [4 May 2025 22:16 UTC](https://discourse.nodered.org/t/ui-custom-node-properties/96882/3 "2025-05-04T22:16:28Z")

</div>

你好嗎? Ni hao ma?

---

<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:** [3 July 2025 22:16 UTC](https://discourse.nodered.org/t/ui-custom-node-properties/96882/4 "2025-07-03T22:16:48Z")

</div>

Closed on 3 July 2025 22:16 UTC

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