Each key under the key _structures
will have the following options:
Defines whether the items are shown to your editors in a select menu (select
, default) or a modal pop up window (modal
).
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
).
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:
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.
An icon used when displaying the structure (defaults to either format_list_bulleted
for items in arrays, or notes
otherwise).
Path to an image in your source files used when displaying the structure. Can be either a source (has priority) or output path.
Used in the array interface to display what kind of items editors can add.
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.
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.
Shows large image/icon preview per structure item. Has no default. See preview
for details.
preview.gallery.fit
defaults tocontain
.preview.gallery.image
has no default, falls back to the first top-level image-like data found.
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.
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.
Shows a list of items that can contain an image, icon and text per structure item. Has no default. See preview
for details.
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.
Changes how the snippet is displayed once it has been added. Defaults to card
, must be one of inline
, gallery
, or card
.
Controls the main text shown per structure item. Has no default, falls back to label
.
If set to false
, no text is displayed.
Used to group and filter items when selecting from a modal.
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
.