miniBill/elm-picture/1.0.0

Html.Source

type Source kind

A source set of images, used to build a source tag.

Building

single : String -> Source Single

Build a Source from a single image.

type Single

A source comprised of a single image.

List
{ url : String
, width : Maybe Int
}

Build a Source from a set of images with given widths.

A source defined using widths (like 300w).

List
{ url : String
, density : Maybe Int
}

Build a Source from a set of images with given densities.

A source defined using densities (like 2x).

Properties

List ( Expression, Value Length )
-> Maybe (Value Length)

Set the sizes attribute. The second argument is the (optional) default size.

withType : ImageType -> Source kind -> Source kind

Set the type attribute.

= APNG
| AVIF
| BMP
| GIF
| ICO
| JPEG
| JPEG_XL
| PNG
| SVG
| TIFF
| WebP

Image types supported

Using

toHtml : Source kind -> Html msg

Convert a Source to the corresponding source html tag.

Equivalent to Html.source (Html.Source.toAttributes source) [].