Next: (hygguile components feedback), Previous: (hygguile components data), Up: API
Stack several accordion-item rows into a JavaScript-free
accordion.
Because each row is a native details element, the whole accordion
expands and collapses without any scripting.
A list of accordion-item or details nodes.
List of symbols representing the wrapper CSS classes.
(accordion #:items (list (accordion-item #:summary "A" #:content (list (p "Alpha")))
(accordion-item #:summary "B" #:content (list (p "Beta")))))
Create a single accordion row backed by a native details element.
The always-visible row title.
The collapsible row body.
A boolean expanding the row by default.
(accordion-item #:summary "How do I install it?" #:content (list (p "Use Guix.")))
Create a native HTML <details> disclosure element.
The element expands and collapses with no JavaScript at all, relying on the browser’s built-in disclosure behaviour.
The collapsible body content.
The summary caption rendered in the always-visible header. Accepts a
string or a summary node.
A boolean expanding the disclosure by default.
List of symbols representing the wrapper CSS classes.
List of symbols representing the collapsible body CSS classes.
(details (list (p "Hidden details")) #:summary "Show more")
Create a modal dialog that opens with no JavaScript.
The modal is revealed by the CSS :target pseudo-class: link to it
with an anchor such as (a "Open" #:href "#my-modal") and it
appears; follow a link to "#" to dismiss it. The dialog carries
the proper role, aria-modal and aria-labelledby
attributes so assistive technology announces it, and it keeps working
with scripting disabled.
The unique element id targeted by the opening link.
The dialog title, also used as its accessible name.
The dialog body content.
An optional list of action nodes shown at the bottom.
The accessible label for the close control. Defaults to "Close".
(modal #:id "confirm" #:title "Are you sure?" #:content (list (p "This cannot be undone.")))
Create an HTML <summary> disclosure caption for details.
The summary text or inline nodes.
List of symbols representing typography CSS classes.
(summary "Advanced options")
Attach an accessible, JavaScript-free tooltip to inline content.
The tooltip is shown on both hover and keyboard focus through CSS, and
its text is exposed twice, each copy for the reader it is for. Sighted
hover is served by the data-hg-tooltip attribute the generated
::after bubble reads; assistive technology is served by a real
text node the trigger describes itself with, because generated content
is not reliably part of the exposed accessibility tree. The text node
is visually hidden rather than also drawn, so a hover still produces one
bubble and one reading, not two.
The trigger content the tooltip is attached to.
The tooltip text.
A stable HTML identifier for the hidden description, or #f for a
generated one. Give one when the page has to name it.
Where the tooltip appears: 'top (default), 'bottom,
'left or 'right.
List of additional utility CSS classes.
(tooltip (code "CARGO_HOME") #:text "Where Cargo stores downloaded crates")
Next: (hygguile components feedback), Previous: (hygguile components data), Up: API