Next: (hygguile components navigation), Previous: (hygguile components layout), Up: API
Create a circular (or rounded) avatar image with an initials fallback.
When src is false, the initials are shown instead, which is useful for user accounts without a profile picture. Everything is plain HTML and CSS, so avatars render with JavaScript disabled.
The optional image source URL.
The alternative text describing the depicted person.
Fallback initials shown when no image source is supplied.
A size keyword: 'xs, 'sm, 'md, 'lg or
'xl.
A shape keyword: 'circle (default), 'rounded or
'square.
An optional boolean adding a subtle border ring around the avatar.
List of additional utility CSS classes.
(avatar #:src "me.png" #:alt "Josep" #:size 'lg #:ring #t)
Create an HTML <figcaption> caption element.
The caption text string or inline nodes.
List of symbols representing typography CSS classes.
(figcaption "Figure 1: the hygguile logo")
Create an HTML <figure> element with an optional caption.
The figure body, typically an img or picture node.
An optional caption rendered as a figcaption below the body.
List of symbols representing caption typography CSS classes.
A symbol controlling alignment, one of 'start, 'center or
'end.
List of symbols representing the wrapper layout CSS classes.
(figure (img #:src "logo.png" #:alt "The logo") #:caption "Figure 1")
Create a responsive, evenly spaced gallery grid for a list of image nodes.
A list of image or figure nodes to lay out.
The number of columns to request on wide viewports.
List of symbols representing gap CSS classes.
(image-gallery (list (img #:src "a.png" #:alt "A")
(img #:src "b.png" #:alt "B")))
Create an accessible HTML <img> element.
Unlike a bare image tag, alt is always rendered, even when empty, so decorative images are announced correctly by assistive technology. The image is lazy-loaded and asynchronously decoded by default.
The image source URL string.
The alternative text. Use an empty string for purely decorative images.
An optional advisory title string.
An optional responsive candidate set string, e.g. "a.png 1x,
a@2x.png 2x".
An optional source-size list describing layout widths to the browser.
An optional intrinsic width in pixels, helping avoid layout shift.
An optional intrinsic height in pixels, helping avoid layout shift.
A symbol controlling native lazy loading, either 'lazy or
'eager.
A symbol requesting 'async or 'sync image decoding.
An optional string such as "high" for above-the-fold hero images.
An optional referrer policy string.
An optional CORS setting string such as "anonymous".
An optional aspect ratio class value, e.g. 'square or
"16/9".
A symbol mapping to an object-* fit class: 'cover,
'contain, 'fill or 'none.
List of symbols representing border radius CSS classes.
List of symbols representing shadow CSS classes.
List of symbols representing base image CSS classes.
List of additional utility CSS classes.
(img #:src "avatar.png" #:alt "Portrait" #:width 320 #:height 320)
Create an HTML <picture> element for responsive images and art
direction.
The image argument must be the output of img, which acts as
the fallback for browsers that do not support picture, modern
image formats such as AVIF or WebP, or any of the supplied media
queries. Because picture is native HTML, it keeps working with
JavaScript disabled.
A list of source elements to try in order.
The fallback img node produced by (img ...).
List of symbols representing layout CSS classes for the wrapper.
(picture #:sources (list (source #:type "image/webp" #:srcset "photo.webp"))
#:image (img #:src "photo.jpg" #:alt "A photo"))
Create an HTML <source> element for use inside picture.
The candidate image set string.
An optional media query string providing art direction, e.g.
"(min-width: 800px)".
An optional MIME type string such as "image/avif".
An optional source-size list string.
An optional intrinsic width in pixels.
An optional intrinsic height in pixels.
(source #:type "image/webp" #:srcset "hero.webp")
Next: (hygguile components navigation), Previous: (hygguile components layout), Up: API