Toloka documentation

ImageViewV1

toloka.client.project.template_builder.view.ImageViewV1 | Source code

ImageViewV1(
    self,
    url: Optional[Any] = None,
    *,
    full_height: Optional[Union[BaseComponent, bool]] = None,
    max_width: Optional[Union[BaseComponent, float]] = None,
    min_width: Optional[Union[BaseComponent, float]] = None,
    no_border: Optional[Union[BaseComponent, bool]] = None,
    no_lazy_load: Optional[Union[BaseComponent, bool]] = None,
    popup: Optional[Union[BaseComponent, bool]] = None,
    ratio: Optional[Union[BaseComponent, List[Union[BaseComponent, float]]]] = None,
    rotatable: Optional[Union[BaseComponent, bool]] = None,
    scrollable: Optional[Union[BaseComponent, bool]] = None,
    hint: Optional[Any] = None,
    label: Optional[Any] = None,
    validation: Optional[BaseComponent] = None,
    version: Optional[str] = '1.0.0'
)

Displays an image.

Parameters Description

Parameters Type Description
url Optional[Any]

Image link.

full_height Optional[Union[BaseComponent, bool]]

If true, the element takes up all the vertical free space. The element is set to a minimum height of 400 pixels.

max_width Optional[Union[BaseComponent, float]]

Maximum width of the element in pixels, must be greater than min_width.

min_width Optional[Union[BaseComponent, float]]

Minimum width of the element in pixels. Takes priority over max_width.

no_border Optional[Union[BaseComponent, bool]]

Controls the display of a frame around an image. By default, true (the frame is hidden). Set false to display the frame.

no_lazy_load Optional[Union[BaseComponent, bool]]

Disables lazy loading. If true, images start loading immediately, even if they aren't in the viewport. Useful for icons. By default, false (lazy loading is enabled). In this mode, images start loading only when a Toloker scrolls to them.

popup Optional[Union[BaseComponent, bool]]

Specifies whether opening a full-size image with a click is allowed. By default, it is true (allowed).

ratio Optional[Union[BaseComponent, List[Union[BaseComponent, float]]]]

An array of two numbers that sets the relative dimensions of the sides: width (first number) to height (second number). Not valid if full_height=true.

scrollable Optional[Union[BaseComponent, bool]]

When set to true, an image has scroll bars if it doesn't fit in the parent element. If false, the image fits in the parent element and, when clicked, opens in its original size in the module window. Images in SVG format with no size specified always fit in their parent elements.

hint Optional[Any]

Hint text.

label Optional[Any]

Label above the component.

validation Optional[BaseComponent]

Validation based on condition.