Skip to content

Schema: Example Component

Dan Morse edited this page Jun 30, 2021 · 5 revisions

Code

"Example" Component

module.exports = {
  $schema: 'http://json-schema.org/draft-04/schema#',
  title: 'Example',
  description: 'A brief description of Example goes here.',
  type: 'object',
  required: ['title', 'content'],
  not: {
    anyOf: [
      {
        required: ['fullBleed'],
      },
    ],
  },
  properties: {
    attributes: {
      type: 'object',
      description:
        'A Drupal attributes object. Applies extra HTML attributes to the outer <bolt-example> tag.',
    },
    title: {
      type: 'any',
      description: 'Title of Example.',
    },
    content: {
      type: 'any',
      description: 'The main Example content.',
    },
    spacing: {
      type: 'string',
      description: 'Sets the spacing around the Example.',
      default: 'medium',
      enum: ['small', 'medium', 'large'],
    },
    borderless: {
      type: 'boolean',
      description: 'Hides the default border around Example.',
      default: false,
    },
    full_bleed: {
      type: 'boolean',
      description: 'Example spans full width of viewport.',
      default: false,
    },
    fullBleed: {
      type: 'any',
      title: 'DEPRECATED',
      description: 'This prop is deprecated. Use `full_bleed` instead.',
    },
  },
};
Clone this wiki locally