div-container

Container. It contains other elements and is responsible for their location. It is used to arrange elements vertically, horizontally, and with an overlay in a certain order, simulating the third dimension.

Parameters

Parameters Description
type

string

Required parameter.

The value must always be container.

accessibility

object

Accessibility settings.

The value has the type div-accessibility.

Available platforms: Android, iOS, web.

action

object

One action when clicking on an element. Not used if the actions parameter is set.

The value has the type div-action.

action_animation

object

Click animation. The web only supports the following values: fade, scale, native, no_animation and set.

The value has the type div-animation.

Default value: {"name": "fade", "start_value": 1, "end_value": 0.6, "duration": 100 }.

Available platforms: Android, iOS, web.

actions

array

Multiple actions when clicking on an element.

alignment_horizontal

string

Horizontal alignment of an element inside the parent element.

Possible values: left, center, right, start, end.

alignment_vertical

string

Vertical alignment of an element inside the parent element.

Possible values: top, center, bottom, baseline.

alpha

number

Transparency of whole element: 0 — completely transparent, 1 — opaque.

Restriction for the value x: x >= 0.0 && x <= 1.0.

Default value: 1.0.

animators

array

Declaration of animators that can be used to change the value of variables over time.

Functionality is under development.

List of possible values:

  • div-color-animator
  • div-number-animator
  • aspect

    object

    Fixed aspect ratio of the container. The element's height is calculated based on the width, ignoring the height parameter's value.

    On the web, support for the aspect-ratio CSS property is required to use this parameter.

    The value has the type div-aspect.

    background

    array

    Element background. It can contain multiple layers.

    List of possible values:

  • div-linear-gradient
  • div-radial-gradient
  • div-image-background
  • div-solid-background
  • div-nine-patch-background
  • border

    object

    Element stroke.

    The value has the type div-border.

    clip_to_bounds

    bool_int

    Enables the bounding of child elements by the parent's borders.

    Default value: true.

    Available platforms: Android, iOS, web.

    column_span

    int

    Merges cells in a column of the grid element.

    Restriction for the value x: x >= 0.

    Available platforms: Android, iOS, web.

    content_alignment_horizontal

    string

    Horizontal element alignment. For child elements, it can be redefined using the alignment_horizontal property.

    Possible values: left, center, right, start, end, space-between, space-around, space-evenly.

    Default value: start.

    content_alignment_vertical

    string

    Vertical element alignment. The baseline value aligns elements along their own specified baseline (for text and other elements that have a baseline). Elements that don't have their baseline value specified are aligned along the top edge. For child elements, it can be redefined using the alignment_vertical property.

    Possible values: top, center, bottom, baseline, space-between, space-around, space-evenly.

    Default value: top.

    disappear_actions

    array

    Actions when an element disappears from the screen.

    Available platforms: Android, iOS, web.

    doubletap_actions

    array

    Action when double-clicking on an element.

    Available platforms: Android, iOS, web.

    extensions

    array

    Extensions for additional processing of an element. The list of extensions is given in DivExtension.

    Available platforms: Android, iOS, web.

    focus

    object

    Parameters when focusing on an element or losing focus.

    The value has the type div-focus.

    height

    object

    Element height. For Android: if there is text in this or in a child element, specify height in sp to scale the element together with the text. To learn more about units of size measurement, see Layout inside the card.

    The value has the type div-size.

    Default value: {"type": "wrap_content"}.

    List of possible values:

  • div-fixed-size
  • div-match-parent-size
  • div-wrap-content-size
  • id

    string

    Element ID. It must be unique within the root element. It is used as accessibilityIdentifier on iOS.

    item_builder

    object

    Sets collection elements dynamically using data and prototypes.

    The value has the type div-collection-item-builder.

    Available platforms: Android, iOS, web.

    items

    array

    Nested elements.

    List of possible values:

  • div-image
  • div-gif-image
  • div-text
  • div-separator
  • div-container
  • div-grid
  • div-gallery
  • div-pager
  • div-tabs
  • div-state
  • div-custom
  • div-indicator
  • div-slider
  • div-input
  • div-select
  • div-video
  • layout_mode

    string

    Element placement method. The wrap value transfers elements to the next line if they don't fit in the previous one. If the wrap value is set:

  • A separate line is allocated for each element along the main axis with the size value set to match_parent.
  • Elements along the cross axis with the size value match_parent are ignored.
  • Possible values: no_wrap, wrap.

    Default value: no_wrap.

    layout_provider

    object

    Provides element real size values after a layout cycle.

    The value has the type div-layout-provider.

    Available platforms: Android, iOS.

    line_separator

    object

    Separator between elements along the cross axis. Not used if the layout_mode parameter is set to no_wrap. Only new browsers are supported on the web (the gap property must be supported for flex blocks).

    The value has the type separator.

    Available platforms: Android, iOS, web.

    longtap_actions

    array

    Action when long-clicking an element. Doesn't work on devices that don't support touch gestures.

    Available platforms: Android, iOS, web.

    margins

    object

    External margins from the element stroke.

    The value has the type div-edge-insets.

    orientation

    string

    Location of elements. overlap value overlays elements on top of each other in the order of enumeration. The lowest is the zero element of an array.

    Possible values: vertical, horizontal, overlap.

    Default value: vertical.

    paddings

    object

    Internal margins from the element stroke.

    The value has the type div-edge-insets.

    reuse_id

    string

    Id for the div structure. Used for more optimal reuse of blocks. See reusing blocks

    Available platforms: Android, iOS.

    row_span

    int

    Merges cells in a string of the grid element.

    Restriction for the value x: x >= 0.

    Available platforms: Android, iOS, web.

    selected_actions

    array

    List of actions to be executed when selecting an element in pager.

    Available platforms: Android, iOS, web.

    separator

    object

    Separator between elements along the main axis. Not used if the orientation parameter is set to overlap. Only new browsers are supported on the web (the gap property must be supported for flex blocks).

    The value has the type separator.

    Available platforms: Android, iOS, web.

    tooltips

    array

    Tooltips linked to an element. A tooltip can be shown by div-action://show_tooltip?id=, hidden by div-action://hide_tooltip?id= where id — tooltip id.

    Available platforms: Android, iOS, web.

    transform

    object

    Applies the passed transformation to the element. Content that doesn't fit into the original view area is cut off.

    The value has the type div-transform.

    Available platforms: Android, iOS, web.

    transition_change

    object

    Change animation. It is played when the position or size of an element changes in the new layout.

    The value has the type div-change-transition.

    Available platforms: Android, iOS, web.

    List of possible values:

  • div-change-set-transition
  • div-change-bounds-transition
  • transition_in

    object

    Appearance animation. It is played when an element with a new ID appears. To learn more about the concept of transitions, see Animated transitions.

    The value has the type div-appearance-transition.

    Available platforms: Android, iOS, web.

    List of possible values:

  • div-appearance-set-transition
  • div-fade-transition
  • div-scale-transition
  • div-slide-transition
  • transition_out

    object

    Disappearance animation. It is played when an element disappears in the new layout.

    The value has the type div-appearance-transition.

    Available platforms: Android, iOS, web.

    List of possible values:

  • div-appearance-set-transition
  • div-fade-transition
  • div-scale-transition
  • div-slide-transition
  • transition_triggers

    array

    Animation starting triggers. Default value: [state_change, visibility_change].

    An array must not be empty.

    Available platforms: Android, iOS, web.

    variable_triggers

    array

    Triggers for changing variables within an element.

    Available platforms: iOS.

    variables

    array

    Definition of variables that can be used within this element. These variables, defined in the array, can only be used inside this element and its children.

    Available platforms: iOS.

    List of possible values:

  • string_variable
  • number_variable
  • integer_variable
  • boolean_variable
  • color_variable
  • url_variable
  • dict_variable
  • array_variable
  • visibility

    string

    Element visibility.

    Possible values: visible, invisible, gone.

    Default value: visible.

    visibility_action

    object

    Tracking visibility of a single element. Not used if the visibility_actions parameter is set.

    The value has the type div-visibility-action.

    Available platforms: Android, iOS, web.

    visibility_actions

    array

    Actions when an element appears on the screen.

    Available platforms: Android, iOS, web.

    width

    object

    Element width.

    The value has the type div-size.

    Default value: {"type": "match_parent"}.

    List of possible values:

  • div-fixed-size
  • div-match-parent-size
  • div-wrap-content-size
  • separator

    Parameters Description
    style

    object

    Required parameter.

    Separator style.

    The value has the type div-drawable.

    Available platforms: Android, iOS, web.

    List of possible values:

  • div-shape-drawable
  • margins

    object

    External margins from the element stroke.

    The value has the type div-edge-insets.

    Available platforms: Android, iOS, web.

    show_at_end

    bool_int

    Enables displaying the separator after the last item.

    Default value: false.

    Available platforms: Android, iOS, web.

    show_at_start

    bool_int

    Enables displaying the separator before the first item.

    Default value: false.

    Available platforms: Android, iOS, web.

    show_between

    bool_int

    Enables displaying the separator between items.

    Default value: true.

    Available platforms: Android, iOS, web.

    JSON
    {
      type*: "container",
      accessibility: {
        description: "string",
        hint: "string",
        mode: "string",
        mute_after_action: "bool_int",
        state_description: "string",
        type: "string"
      },
      action: {
        download_callbacks: {
          on_fail_actions: [ div-action, ... ],
          on_success_actions: [ div-action, ... ]
        },
        is_enabled: "bool_int",
        log_id*: "string",
        log_url: "string",
        menu_items: [
          {
            action: div-action,
            actions: [ div-action, ... ],
            text*: "string"
          },
          ...
        ],
        payload: "object",
        referer: "string",
        target: "string",
        typed: div-action-typed,
        url: "string"
      },
      action_animation: {
        duration: "int",
        end_value: "number",
        interpolator: "string",
        items: [ div-animation, ... ],
        name*: "string",
        repeat: div-count,
        start_delay: "int",
        start_value: "number"
      },
      actions: [
        {
          download_callbacks: {
            on_fail_actions: [ div-action, ... ],
            on_success_actions: [ div-action, ... ]
          },
          is_enabled: "bool_int",
          log_id*: "string",
          log_url: "string",
          menu_items: [
            {
              action: div-action,
              actions: [ div-action, ... ],
              text*: "string"
            },
            ...
          ],
          payload: "object",
          referer: "string",
          target: "string",
          typed: div-action-typed,
          url: "string"
        },
        ...
      ],
      alignment_horizontal: "string",
      alignment_vertical: "string",
      alpha: "number",
      animators: [ div-animator, ... ],
      aspect: {
        ratio*: "number"
      },
      background: [ div-background, ... ],
      border: {
        corner_radius: "int",
        corners_radius: {
          bottom-left: "int",
          bottom-right: "int",
          top-left: "int",
          top-right: "int"
        },
        has_shadow: "bool_int",
        shadow: {
          alpha: "number",
          blur: "int",
          color: "string",
          offset*: {
            x*: {
              unit: "string",
              value*: "number"
            },
            y*: {
              unit: "string",
              value*: "number"
            }
          }
        },
        stroke: {
          color*: "string",
          unit: "string",
          width: "number"
        }
      },
      clip_to_bounds: "bool_int",
      column_span: "int",
      content_alignment_horizontal: "string",
      content_alignment_vertical: "string",
      disappear_actions: [
        {
          disappear_duration: "int",
          download_callbacks: {
            on_fail_actions: [
              {
                download_callbacks: div-download-callbacks,
                is_enabled: "bool_int",
                log_id*: "string",
                log_url: "string",
                menu_items: [
                  {
                    action: div-action,
                    actions: [ div-action, ... ],
                    text*: "string"
                  },
                  ...
                ],
                payload: "object",
                referer: "string",
                target: "string",
                typed: div-action-typed,
                url: "string"
              },
              ...
            ],
            on_success_actions: [
              {
                download_callbacks: div-download-callbacks,
                is_enabled: "bool_int",
                log_id*: "string",
                log_url: "string",
                menu_items: [
                  {
                    action: div-action,
                    actions: [ div-action, ... ],
                    text*: "string"
                  },
                  ...
                ],
                payload: "object",
                referer: "string",
                target: "string",
                typed: div-action-typed,
                url: "string"
              },
              ...
            ]
          },
          is_enabled: "bool_int",
          log_id*: "string",
          log_limit: "int",
          payload: "object",
          referer: "string",
          typed: div-action-typed,
          url: "string",
          visibility_percentage: "int"
        },
        ...
      ],
      doubletap_actions: [
        {
          download_callbacks: {
            on_fail_actions: [ div-action, ... ],
            on_success_actions: [ div-action, ... ]
          },
          is_enabled: "bool_int",
          log_id*: "string",
          log_url: "string",
          menu_items: [
            {
              action: div-action,
              actions: [ div-action, ... ],
              text*: "string"
            },
            ...
          ],
          payload: "object",
          referer: "string",
          target: "string",
          typed: div-action-typed,
          url: "string"
        },
        ...
      ],
      extensions: [
        {
          id*: "string",
          params: "object"
        },
        ...
      ],
      focus: {
        background: [ div-background, ... ],
        border: {
          corner_radius: "int",
          corners_radius: {
            bottom-left: "int",
            bottom-right: "int",
            top-left: "int",
            top-right: "int"
          },
          has_shadow: "bool_int",
          shadow: {
            alpha: "number",
            blur: "int",
            color: "string",
            offset*: {
              x*: {
                unit: "string",
                value*: "number"
              },
              y*: {
                unit: "string",
                value*: "number"
              }
            }
          },
          stroke: {
            color*: "string",
            unit: "string",
            width: "number"
          }
        },
        next_focus_ids: {
          down: "string",
          forward: "string",
          left: "string",
          right: "string",
          up: "string"
        },
        on_blur: [
          {
            download_callbacks: {
              on_fail_actions: [ div-action, ... ],
              on_success_actions: [ div-action, ... ]
            },
            is_enabled: "bool_int",
            log_id*: "string",
            log_url: "string",
            menu_items: [
              {
                action: div-action,
                actions: [ div-action, ... ],
                text*: "string"
              },
              ...
            ],
            payload: "object",
            referer: "string",
            target: "string",
            typed: div-action-typed,
            url: "string"
          },
          ...
        ],
        on_focus: [
          {
            download_callbacks: {
              on_fail_actions: [ div-action, ... ],
              on_success_actions: [ div-action, ... ]
            },
            is_enabled: "bool_int",
            log_id*: "string",
            log_url: "string",
            menu_items: [
              {
                action: div-action,
                actions: [ div-action, ... ],
                text*: "string"
              },
              ...
            ],
            payload: "object",
            referer: "string",
            target: "string",
            typed: div-action-typed,
            url: "string"
          },
          ...
        ]
      },
      height: div-size,
      id: "string",
      item_builder: {
        data*: "raw_array",
        data_element_name: "string",
        prototypes*: [
          {
            div*: div,
            id: "string",
            selector: "bool_int"
          },
          ...
        ]
      },
      items: [ div, ... ],
      layout_mode: "string",
      layout_provider: {
        height_variable_name: "string",
        width_variable_name: "string"
      },
      line_separator: {
        margins: {
          bottom: "int",
          end: "int",
          left: "int",
          right: "int",
          start: "int",
          top: "int",
          unit: "string"
        },
        show_at_end: "bool_int",
        show_at_start: "bool_int",
        show_between: "bool_int",
        style*: div-drawable
      },
      longtap_actions: [
        {
          download_callbacks: {
            on_fail_actions: [ div-action, ... ],
            on_success_actions: [ div-action, ... ]
          },
          is_enabled: "bool_int",
          log_id*: "string",
          log_url: "string",
          menu_items: [
            {
              action: div-action,
              actions: [ div-action, ... ],
              text*: "string"
            },
            ...
          ],
          payload: "object",
          referer: "string",
          target: "string",
          typed: div-action-typed,
          url: "string"
        },
        ...
      ],
      margins: {
        bottom: "int",
        end: "int",
        left: "int",
        right: "int",
        start: "int",
        top: "int",
        unit: "string"
      },
      orientation: "string",
      paddings: {
        bottom: "int",
        end: "int",
        left: "int",
        right: "int",
        start: "int",
        top: "int",
        unit: "string"
      },
      reuse_id: "string",
      row_span: "int",
      selected_actions: [
        {
          download_callbacks: {
            on_fail_actions: [ div-action, ... ],
            on_success_actions: [ div-action, ... ]
          },
          is_enabled: "bool_int",
          log_id*: "string",
          log_url: "string",
          menu_items: [
            {
              action: div-action,
              actions: [ div-action, ... ],
              text*: "string"
            },
            ...
          ],
          payload: "object",
          referer: "string",
          target: "string",
          typed: div-action-typed,
          url: "string"
        },
        ...
      ],
      separator: {
        margins: {
          bottom: "int",
          end: "int",
          left: "int",
          right: "int",
          start: "int",
          top: "int",
          unit: "string"
        },
        show_at_end: "bool_int",
        show_at_start: "bool_int",
        show_between: "bool_int",
        style*: div-drawable
      },
      tooltips: [
        {
          animation_in: {
            duration: "int",
            end_value: "number",
            interpolator: "string",
            items: [ div-animation, ... ],
            name*: "string",
            repeat: div-count,
            start_delay: "int",
            start_value: "number"
          },
          animation_out: {
            duration: "int",
            end_value: "number",
            interpolator: "string",
            items: [ div-animation, ... ],
            name*: "string",
            repeat: div-count,
            start_delay: "int",
            start_value: "number"
          },
          div*: div,
          duration: "int",
          id*: "string",
          offset: {
            x*: {
              unit: "string",
              value*: "number"
            },
            y*: {
              unit: "string",
              value*: "number"
            }
          },
          position*: "string"
        },
        ...
      ],
      transform: {
        pivot_x: div-pivot,
        pivot_y: div-pivot,
        rotation: "number"
      },
      transition_change: div-change-transition,
      transition_in: div-appearance-transition,
      transition_out: div-appearance-transition,
      transition_triggers: [ "string", ... ],
      variable_triggers: [
        {
          actions*: [
            {
              download_callbacks: {
                on_fail_actions: [ div-action, ... ],
                on_success_actions: [ div-action, ... ]
              },
              is_enabled: "bool_int",
              log_id*: "string",
              log_url: "string",
              menu_items: [
                {
                  action: div-action,
                  actions: [ div-action, ... ],
                  text*: "string"
                },
                ...
              ],
              payload: "object",
              referer: "string",
              target: "string",
              typed: div-action-typed,
              url: "string"
            },
            ...
          ],
          condition*: "bool_int",
          mode: "string"
        },
        ...
      ],
      variables: [ div-variable, ... ],
      visibility: "string",
      visibility_action: {
        download_callbacks: {
          on_fail_actions: [
            {
              download_callbacks: div-download-callbacks,
              is_enabled: "bool_int",
              log_id*: "string",
              log_url: "string",
              menu_items: [
                {
                  action: div-action,
                  actions: [ div-action, ... ],
                  text*: "string"
                },
                ...
              ],
              payload: "object",
              referer: "string",
              target: "string",
              typed: div-action-typed,
              url: "string"
            },
            ...
          ],
          on_success_actions: [
            {
              download_callbacks: div-download-callbacks,
              is_enabled: "bool_int",
              log_id*: "string",
              log_url: "string",
              menu_items: [
                {
                  action: div-action,
                  actions: [ div-action, ... ],
                  text*: "string"
                },
                ...
              ],
              payload: "object",
              referer: "string",
              target: "string",
              typed: div-action-typed,
              url: "string"
            },
            ...
          ]
        },
        is_enabled: "bool_int",
        log_id*: "string",
        log_limit: "int",
        payload: "object",
        referer: "string",
        typed: div-action-typed,
        url: "string",
        visibility_duration: "int",
        visibility_percentage: "int"
      },
      visibility_actions: [
        {
          download_callbacks: {
            on_fail_actions: [
              {
                download_callbacks: div-download-callbacks,
                is_enabled: "bool_int",
                log_id*: "string",
                log_url: "string",
                menu_items: [
                  {
                    action: div-action,
                    actions: [ div-action, ... ],
                    text*: "string"
                  },
                  ...
                ],
                payload: "object",
                referer: "string",
                target: "string",
                typed: div-action-typed,
                url: "string"
              },
              ...
            ],
            on_success_actions: [
              {
                download_callbacks: div-download-callbacks,
                is_enabled: "bool_int",
                log_id*: "string",
                log_url: "string",
                menu_items: [
                  {
                    action: div-action,
                    actions: [ div-action, ... ],
                    text*: "string"
                  },
                  ...
                ],
                payload: "object",
                referer: "string",
                target: "string",
                typed: div-action-typed,
                url: "string"
              },
              ...
            ]
          },
          is_enabled: "bool_int",
          log_id*: "string",
          log_limit: "int",
          payload: "object",
          referer: "string",
          typed: div-action-typed,
          url: "string",
          visibility_duration: "int",
          visibility_percentage: "int"
        },
        ...
      ],
      width: div-size
    }