# Adding an object to an array of props

**URL:** <https://forum.inductiveautomation.com/t/adding-an-object-to-an-array-of-props/107234>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [June 10, 2025, 3:42pm UTC](https://forum.inductiveautomation.com/t/adding-an-object-to-an-array-of-props/107234 "2025-06-10T15:42:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronrai24](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/aaronrai24/32/87248_2.png) [@aaronrai24](https://forum.inductiveautomation.com/u/aaronrai24)\
**Post date:** [June 10, 2025, 3:42pm UTC](https://forum.inductiveautomation.com/t/adding-an-object-to-an-array-of-props/107234/1 "2025-06-10T15:42:27Z")

</div>

I am working on integrating a custom component into perspective and was trying to figure out how to add an object when the user clicks the "+" on array of props, similar to how the flex repeater automatically adds an object when you click the "+".

My components props, only shows the Value, Object Array menu where I would like to mimic the flex repeaters behavior:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/a/8ab29b589ac16ce5245e6c69ff78776fed128e4e.png)

The flex repeater, adds an instance when you click +.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/f/bf98c428f4c414a59c3f7cb3ecacf740224f8d22.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 10, 2025, 4:53pm UTC](https://forum.inductiveautomation.com/t/adding-an-object-to-an-array-of-props/107234/2 "2025-06-10T16:53:17Z")

</div>

You need to declare the properties correctly in your component's json schema; see this post for more:

> [@Questions regarding style props and how they behave when they are nested](https://forum.inductiveautomation.com/t/questions-regarding-style-props-and-how-they-behave-when-they-are-nested/92195/2):
>
> You need to use the items property [(Json-Schema Array Reference)](https://json-schema.org/understanding-json-schema/reference/array). // The multistate button schema probably looks something like this... { "properties": { "states": { "type": "array", "items": { "type": "object", "default": { "text": "", "value": "", "selectedStyle": {}, "unselectedStyle": {} }, "properties": { …
