gbr/ui/theme/lustre/image
GBR: UI Theme Image Module
Formatos como WebP e AVIF são recomendados, pois apresentam um desempenho muito superior ao de PNG, JPEG e GIF, tanto para imagens estáticas quanto imagens animadas.
Types
Dados de controle da imagem
pub type UIImage {
UIImage(
src: String,
alt: String,
height: option.Option(Int),
width: option.Option(Int),
)
}
Constructors
-
UIImage( src: String, alt: String, height: option.Option(Int), width: option.Option(Int), )
Values
pub fn new(src: String, alt: String) -> UIImage
Cria nova imagem contendo os atributos obrigatórios.
pub fn view(
image: UIImage,
theme: theme.UITheme(lustre.UILustre),
a: List(attribute.Attribute(a)),
) -> element.Element(a)
Visualiza a imagem com o tema passado.
pub fn with_alt(image: UIImage, alt: String) -> UIImage
Altera o texto alternativo da imagem, para a11y.
pub fn with_height(image: UIImage, height: Int) -> UIImage
Altera o tamanho original da altura da imagem.