Skip to main content

image

Function image 

Source
pub fn image(src: impl AsRef<str>, alt: impl AsRef<str>) -> Element
Expand description

An image with its src and alt: <img src="…" alt="…">.

alt is required rather than optional. An image without an alternative text is the single most common accessibility defect in generated HTML, and Winged-Swift’s own ROADMAP.md asks for a lint that catches it. Requiring it here is cheaper than linting for it later. Pass "" deliberately for a decorative image.