Skip to content

object

object enables you to consolidate similar options in one location.

Example usage

json
[
  {
    name: 'hero',
    title: 'Hero',
    fields: [
      {
        name: 'cta2',
        title: 'Call-to-action 2',
        type: 'object',
        fields: [
          {
            name: 'title',
            title: 'Title',
            type: 'text',
            default: 'Learn more',
            ai: true
          },
          {
            name: 'icon',
            title: 'Icon',
            type: 'icon',
            default: 'arrow-right-line'
          },
          {
            name: 'url',
            title: 'Link',
            type: 'text',
            default: '#'
          }
        ]
      }
    ]
  }
]
[
  {
    name: 'hero',
    title: 'Hero',
    fields: [
      {
        name: 'cta2',
        title: 'Call-to-action 2',
        type: 'object',
        fields: [
          {
            name: 'title',
            title: 'Title',
            type: 'text',
            default: 'Learn more',
            ai: true
          },
          {
            name: 'icon',
            title: 'Icon',
            type: 'icon',
            default: 'arrow-right-line'
          },
          {
            name: 'url',
            title: 'Link',
            type: 'text',
            default: '#'
          }
        ]
      }
    ]
  }
]
jsx
<div id="hero">
  <a
    href={hero.cta2.url}
  >
    <span>{hero.cta2.title}</span>
    <Icon name={hero.cta2.icon} />
  </a>
</div>
<div id="hero">
  <a
    href={hero.cta2.url}
  >
    <span>{hero.cta2.title}</span>
    <Icon name={hero.cta2.icon} />
  </a>
</div>

Preview

Earlybird Builder