# Prop Object in ui

**URL:** <https://forum.builder.io/t/prop-object-in-ui/61>\
**Category:** Technical Questions\
**Created:** [April 28, 2020, 1:19pm UTC](https://forum.builder.io/t/prop-object-in-ui/61 "2020-04-28T13:19:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igor](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@Igor](https://forum.builder.io/u/Igor)\
**Post date:** [April 28, 2020, 1:19pm UTC](https://forum.builder.io/t/prop-object-in-ui/61/1 "2020-04-28T13:19:38Z")

</div>

Hello, I have a prop that receives an object like this:  
ctaProps: t.shape({  
text: t.string.isRequired,  
url: t.string.isRequired,  
variant: t.oneOf([‘primary’, ‘info’, ‘dark’, ‘light’, ‘warning’])  
})  
is it possible to pass this via [builder.io](http://builder.io) ui?

---

<div class="post-metadata">

**Author:** ![steve](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/steve/32/78_2.png) [@steve](https://forum.builder.io/u/steve)\
**Post date:** [April 28, 2020, 3:03pm UTC](https://forum.builder.io/t/prop-object-in-ui/61/2 "2020-04-28T15:03:57Z")

</div>

Hey @Igor, welcome to the forum!

You can accomplish this using `type: 'object'`, e.g. see an example of the source code of our Carousel component using that type [here](https://github.com/BuilderIO/builder/blob/master/packages/widgets/src/components/Carousel.tsx#L420:L420)

A full example of what you are going for:

```auto
Builder.registerComponent(MyComponent, {
  name: 'MyComponent',
  inputs: [
    {
      name: 'ctaProps',
      type: 'object',
      /* Important, you will get errors if no `defaultValue` is set for objects */
      defaultValue: {},
      subFields: [
        {
          name: 'text',
          type: 'string',
          required: true,
        },
        {
          name: 'url',
          type: 'url',
          required: true,
        },
        {
          name: 'variant',
          type: 'string',
          defaultValue: 'primary',
          enum: ['primary', 'info', 'dark', 'light', 'warning'],
        },
      ],
    },
  ],
});

```

---

<div class="post-metadata">

**Author:** ![Igor](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@Igor](https://forum.builder.io/u/Igor)\
**Post date:** [April 28, 2020, 4:07pm UTC](https://forum.builder.io/t/prop-object-in-ui/61/3 "2020-04-28T16:07:50Z")

</div>

It worked, thanks, it would be interesting to update the documentation of the supported types, I was basing myself there [https://www.builder.io/c/docs/custom-react-components#input-types](https://www.builder.io/c/docs/custom-react-components#input-types)
