Pular para o conteúdo principal

Image

Import

import { Image } from '@resultadosdigitais/tangram-components'

Properties

src 📍

Concerns
📍 Required
Typestring

Description

Sets the image source.

alt 📍

Concerns
📍 Required
Typestring

Description

Sets the image alt.

width

Typestring

Description

Sets the image width.

height

Typestring

Description

Sets the image height.

rounded

Typebool
Defaultfalse

Description

Makes image rounded.

fluid

Typebool
Defaultfalse

Description

Makes image full-width.

fit

Type
Enum of:
  • Image.fit.none
  • Image.fit.fill
  • Image.fit.contain
  • Image.fit.cover
  • Image.fit.scaleDown

Description

Determines how the image should be resized to fit its container.

For more informations: https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit.

as

TypeelementType | string

Description

Sets the element type to be rendered as wrapper. By default, it will render a figure element.

errorLoadingImage

Typestring
DefaultImage.translations.en.loadingError

Description

Custom text to inform that there was an error on loading the image. It is also used as title for the icon that is displayed.

Preset values for English, Brazilian Portuguese and Spanish are available in Image.translations.en.loadingError, Image.translations.ptBR.loadingError, and Image.translations.es.loadingError.

onError

Typefunc
Paramevent React.SyntheticEvent - The event source of the callback.

Description

Callback fired when the image is not loaded.

Feedback

Para reportar algum problema ou sugerir alterações, use nosso formulário de melhorias ou, se preferir, abra uma issue no nosso Github.