Skip to content

Image - Web Component โ€‹

The Image component can be used imported from:

Playground โ€‹

Parameters โ€‹

The Web component uses the <z-image> tag:

By default, all the parameters are optional or can be set in different, except for the ones marked as required

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescriptionSlotA11y
image-src
[required]
stringDefines the image source URL.
image-altstringDefines the alternative text of the image๐ŸŸฉ
configstring

Defines the aspect ratio for the image. Possible values are: full-width, 3:2, 1:1, 4:3, 16:9.

Also you can insert the value 1:1:round to get a rounded image only for 1:1 aspect ratio.

sizenumber

Defines the image column size. Possible values are: 2, 3, 4, 5, 6.

copyrightstringDefines the copyright text of the image
captionstringDefines the caption text of the image

Parameters use โ€‹

Image โ€‹

image-src โ€‹

The image-src parameter is used to define the image URL to be displayed.

image-alt โ€‹

The alt attribute of teh image for accessibility

config โ€‹

The config parameter is used to define the aspect ratio for the image. Possible values are: full-width, 3:2, 1:1, 4:3, 16:9.

The 1:1 aspect ratio can be rounded by adding the round value to the config or by simply use round value (e.g. config="1:1:round" or config="round").

size โ€‹

The size parameter is used to define the image column size. Possible values are: 2, 3, 4, 5, 6. Check the size section for more information.

The copyright parameter is used to add a short copiright text information, if necessary.

You can customize the color of the copyright text using the --z-image--copyright-color CSS custom property.

caption โ€‹

The caption parameter is used to add a short caption and concise description of the image or topic.

Browser support โ€‹

Detected engine: ย 

  • Chromium

  • Webkit

  • Gecko

HTML Examples โ€‹

CodeSandbox example โ€‹