Next: (hygguile components typography), Previous: (hygguile components tokens), Up: API
Create the pair of buttons that open or close every disclosure of a tray.
selector is any CSS selector, so the pair works for a grid of
expandable-cards, for a stack of accordions, or for the
plain details elements of a page. Each disclosure is still an
ordinary disclosure that opens and closes on its own; these two buttons
only save a reader the clicking.
A CSS selector matching the elements to open or close.
The label of the button that opens them all.
The label of the button that closes them all.
List of CSS classes for the pair.
(disclosure-controls #:selector "details.hg-expandable-card")
Create a group of buttons that puts a tray in one of several orders.
The tray is the container whose identifier is target; its items
are ordered by the data-* attribute each of them carries under
the name of the mode asked for. The ordering is done in the browser by
tray.js, which every build already ships, and it is the sort of a
handful of rendered cards rather than of a data set: a page that has a
real question to ask a server asks it with sortable-table and a
URL instead.
A mode no item carries is the tray’s own order – the items return to the order the page wrote them in – so the button that restores it needs no attribute anywhere:
(sort-control #:target "cards"
#:modes '((page . "Page order")
(title . "A to Z")))
The identifier of the container to reorder.
A list of (mode . label) pairs, in the order the buttons should
appear. Each mode names the data-* attribute to order by,
and the first pair is the order the tray opens in.
The word shown before the buttons.
The accessible name of the group of buttons.
List of CSS classes for the group.
List of CSS classes for the label.
Next: (hygguile components typography), Previous: (hygguile components tokens), Up: API