Use Image
to render images.
Accessibility
Always provide a meaningful alt
.
Arguments
Name | Type | Default | Description |
---|
src | String | N/A | The source url of the image. |
alt | String | N/A | Specifies an alternate text for the image. |
lazy | Boolean | false | Whether or not to lazily load the image. |
system_arguments | Hash | N/A | System arguments |
Examples
Default
<%= render(Primer::Image.new(src: "https://github.com/github.png", alt: "GitHub")) %>
Helper
<%= primer_image(src: "https://github.com/github.png", alt: "GitHub") %>
Lazy loading
<%= render(Primer::Image.new(src: "https://github.com/github.png", alt: "GitHub", lazy: true)) %>
Custom size
<%= render(Primer::Image.new(src: "https://github.com/github.png", alt: "GitHub", height: 100, width: 100)) %>