Search Storyblok's Documentation
  1. The Component Schema Field Object

The Component Schema Field Object

There are a few properties which are present in every field type that can be added in a component. Not every property will be used for every field type. Some may only affect specific types. We have mentioned a few fields properties here, but there can be more as well.

Properties

  • type

    string

    The type of your field

  • required

    boolean

    Is this field required? Default: false

  • description

    string

    The description is shown in the editor interface

  • tooltip

    boolean

    True if the description is set to show as a tooltip. Default: false

  • pos

    number

    Position of the field in the component.

  • translatable

    boolean

    True if the translation is enabled over the field

  • default_value

    string

    Default value for the field. Can be an escaped JSON object

  • display_name

    string

    Name that will be used in the editor interface

  • maximum

    number

    The maximum amount of components that can be added in a bloks field. Only for type: bloks

  • minimum

    number

    The minimum amount of components that should be added in a bloks field. Only for type: bloks

  • restrict_type

    string

    A string to define what type is used for restricting the components in a bloks field.
    Can tags, groups (folders), or empty string for specific components.

  • restrict_components

    boolean

    Activate restriction nestable component option. Default: false. Only for type: bloks, and richtext (for nestable bloks inside that)

  • component_whitelist

    string[]

    An array of component/content type names: ["post", "page", "product"]. Only for type: bloks, multilink, and richtext (for nestable bloks inside that)

  • component_tag_whitelist

    number[]

    An array of tag IDs. Only the components with these tags can be inserted in the bloks field. Only for type: bloks. and richtext (for nestable bloks inside that)

  • component_group_whitelist

    string[]

    An array of group UUIDs.Only the components that belong to these groups can be inserted in the bloks field. Only for type: bloks, and richtext (for nestable bloks inside that)

  • no_translate

    boolean

    Should be excluded in translation export. Only for type text and number

  • rtl

    boolean

    Enable global RTL for this field. Only for type: markdown, text, textarea

  • regex

    string

    Client Regex validation for the text field type

  • max_length

    number

    Set the max length of the input string. Only for type: text, textarea, markdown

  • style_options

    object[]

    Objects containing the data about custom CSS set inside the richtext field.

    • _uid

      string

      UUID of the style

    • name

      string

      Name of the style that is displayed in the UI

    • value

      string

      Value of the style that is used

  • customize_toolbar

    boolean

    True if customization of toolbar in a richtext or markdown field is enabled

  • toolbar

    string[]

    Array containing the value of enabled items while customizing the toolbar of richtext or markdown field

  • allow_target_blank

    boolean

    Allows links inside a richtext field to be open in a new tab and enables an option for the links field to open link in a new tab

  • allow_custom_attributes

    boolean

    For enabling custom attributes in a link. Works for links inside the richtext field and multilink field.

  • rich_markdown

    boolean

    Enable rich markdown view. Only for type: markdown

  • allow_multiline

    boolean

    Enable empty paragraphs in markdown

  • min_value

    number

    Minimum value that a number field can have

  • max_value

    number

    Maximum value that a number field can have

  • decimals

    number

    The number of decimal places that appear after the point in a number field

  • steps

    number

    The interval between numbers of a number field type

  • disable_time

    boolean

    Disables time selection from the date picker. Default: false. Only for type: datetime

  • inline_label

    boolean

    Makes the label of a boolean field inline

  • exclude_empty_option

    boolean

    Hide empty options in the UI in an option or options field

  • options

    object[]

    Array of datasource entries [{name:"", value:""}]; Effects editor only if source=undefined. For field type option.

    • _uid

      string

      UUID of the option

    • name

      string

      Name of the option

    • value

      string

      Value of the option

  • source

    enum

    Only for type: option, options, custom

    Possible values:
    undefinedSelf
    internal_storiesStories
    internalDatasource
    externalAPI Endpoint in Datasource Entries Array Format
    internal_languagesThe languages enabled in the space
  • use_uuid

    boolean

    Default: true; available in option and source=internal_stories

  • datasource_slug

    string

    Define selectable datasources string; Effects editor only if source=internal for field types option and options

  • external_datasource

    string

    Define external datasource JSON Url; Effects editor only if source=external for field types option and options

  • folder_slug

    string

    Filter on selectable stories path; Effects editor only if source=internal_stories; In case you have a multi-language folder structure you can add the '{0}' placeholder and the path will be adapted dynamically. Examples: "{0}/categories/", {0}/{1}/categories/

  • max_options

    string

    Maximum options that can be selected in an options field.

  • min_options

    string

    Minimum options that should be selected in an options field.

  • filter_content_type

    string[]

    An array of content types that can be selected in a option or options field where source is internal_stories

  • entry_appearance

    string

    The appearance type of an option inside the option or options field type when source is internal_stories
    Can be link or card, default: link

  • allow_advanced_search

    boolean

    Allow advance search that enables a separate dialogue for search. Only in option and options field type

  • is_reference_type

    boolean

    True if the options field is of type reference

  • filetypes

    string[]

    Array of file type names: ["images", "videos", "audios", "texts"]. Only for type: multiasset

  • asset_folder_id

    number

    Default asset folder numeric id to store uploaded image of that field. Only for type: asset

  • allow_external_url

    boolean

    If the asset or multiasset field allow external URLs

  • email_link_type

    boolean

    Allow emails in the multilink field type. Default: false

  • asset_link_type

    boolean

    Allow assets in the multilink field type. Default: false

  • show_anchor

    boolean

    Enable anchor field on internal links inside multilink field type. Default: false

  • restrict_content_types

    boolean

    Activate the restriction content type option. Only for type: multilink

  • force_link_scope

    boolean

    Force folder restriction on multilink field type. Default: false

  • link_scope

    string

    Filter on selectable folders when the force folder ( force_link_fields ) is in place. Default: false

  • keys

    string[]

    An array of field keys to include in this section (group field types). Only for type: section

  • field_type

    string

    Name of the custom field type plugin. Only for type: custom

  • required_fields

    string

    Comma-separated required fields. Only for type custom

  • image_crop

    boolean

    Activate force crop for images. Only for type: image

  • keep_image_size

    boolean

    Keep the original size. Only for type: image

  • image_width

    string

    Define width in px or width ratio if keep_image_size is enabled. Only for type: image

  • image_height

    string

    Define height in px or height ratio if keep_image_size is enabled. Only for type: image

  • add_https

    boolean

    Prepends https: to stop the usage of the relative protocol. Only for type: image, file

  • can_sync

    boolean

    Advanced usage to sync with the field in preview. Default: false

  • exclude_from_merge

    boolean

    Excludes a blok from being merged during a merge action (only works with the Dimensions App)

  • exclude_from_overwrite

    boolean

    Excludes a blok from being overwritten during an overwrite action (only works with the Dimensions App)

  • force_merge

    boolean

    Overwrites a blok during a merge action (only works with the Dimensions App)

  • conditional_settings

    object[]

    Array containing the object with information about conditions set on the field

Example Object
// name of the field as key eg. "field key" in schema property in your component
"title": {
  "type": "text",
  "pos": 0,
  "translatable": true,
  "required": true,
  "regex": "",
  "description": "Description for the field",
  "display_name": "",
  "default_value": "",
  "can_sync": false,
  "rtl": false,
  "no_translate": false
}