Structures reference

Last modified: September 28th, 2023

Each key under the key _structures will have the following options:

style - String (modal or select)#

Defines whether the items are shown to your editors in a select menu (select, default) or a modal pop up window (modal).

id_key - String#

Defines what key should be used to detect which structure an item is. If this key is not found in the array item, a comparison of key names is used (default _type).

values - Array#

Defines what values are available when the add button is clicked. See reference below for available options.

Each array item in values will have the following options:

default - Boolean#

If set to true, this item will be considered the default type for this structure. If the type of a value within a structure cannot be inferred based on its id_key or matching fields, then it will fall back to this item.

If multiple items have default set to true, only the first item will be used.

icon - String#

An icon used when displaying the structure (defaults to either format_list_bulleted for items in arrays, or notes otherwise).

image - String#

Path to an image in your source files used when displaying the structure. Can be either a source (has priority) or output path.

label - String#

Used in the array interface to display what kind of items editors can add.

picker_preview - Object#

The preview definition to change how to display structures when choosing a new structure (both in the select and modal styles). This takes priority over preview when choosing a new structure, and does not affect structures added to the Data Editor.

All preview options are available.

See the preview options documentation for detailed information on setting this option.

preview - Object#

The preview definition to change how to display structures in the Data Editor, and when choosing a new structure (both in the select and modal styles).

All preview options are available here, although only the following options are used in the Data Editor:

  • text
  • subtext
  • icon
  • image

See the preview options documentation for detailed information on setting this option.

preview.gallery - Object#

Shows large image/icon preview per structure item. Has no default. See preview for details.

  • preview.gallery.fit defaults to contain.
  • preview.gallery.image has no default, falls back to the first top-level image-like data found.
preview.icon - Array, string or boolean#

Controls the icon shown on each structure item. Must match a Material Icon name. Has no default, falls back to icon.

If set to false, no icon is displayed.

If image is set, it will cover icon when loaded successfully.

preview.image - Array, string or boolean#

Controls the image shown per structure item. Has no default.

If set to false, no image is displayed.

If no image is found, icon is displayed instead.

preview.metadata - Array#

Shows a list of items that can contain an image, icon and text per structure item. Has no default. See preview for details.

preview.subtext - Array, string or boolean#

Controls the supporting text per structure item. Defaults to the description key, then falls back to the first text-like value found.

If set to false, no subtext is displayed.

Subtext is hidden if text and subtext is the same. If there’s no text, subtext is used instead.

preview.view - String#

Changes how the snippet is displayed once it has been added. Defaults to card, must be one of inline, gallery, or card.

preview.text - Array, string or boolean#

Controls the main text shown per structure item. Has no default, falls back to label.

If set to false, no text is displayed.

tags - Array#

Used to group and filter items when selecting from a modal.

value - Object#

The actual value used when items are added after selection

Structures now support the new preview option. Read our migration guide if you are still using the old options: text_key, subtext_key, image_key, preview_image, description, and image_size.

Related Articles

Open in a new tab