Macaw.Builtin.Accordion (macaw v0.6.0)

Copy Markdown View Source

The built-in accordion (spec/05 §5.8), "macaw.accordion": a container of one or more panes, one open at a time, of kind :container, :pure: the WAI-ARIA accordion pattern.

  • parameters: label (text, "Sections"), its name; open (text, "", bindable), the pane open, "" for none;
  • declarations: no slots; the event "open" with its default action setting open from the event's value (spec/05 §5.3); it observes :activate;
  • panes: one or more; it shows the one open names, else none;
  • markup: a named group; per pane a heading at the context's level holding a button, aria-expanded whether its pane shows and aria-controls its panel, emitting open with the pane when closed and "" when open, or, given a link for it, an <a href> to that view; then its panel, a region named by the button, holding the pane's markup when shown and empty and hidden when not. Buttons, not <details>, since a closed pane isn't rendered and the server must know which opens; in :print and :neutral every panel shows;
  • stylesheet: stylesheet/0, served at stylesheet_path/0, its content address.

Summary

Functions

The accordion's one static stylesheet: its headings, buttons and panels, every color a theme custom property with the default theme's value as its fallback. It loads and imports nothing.

The stylesheet's path, its content address (Macaw.Component.Stylesheet.path/1).

Functions

stylesheet()

@spec stylesheet() :: String.t()

The accordion's one static stylesheet: its headings, buttons and panels, every color a theme custom property with the default theme's value as its fallback. It loads and imports nothing.

stylesheet_path()

@spec stylesheet_path() :: String.t()

The stylesheet's path, its content address (Macaw.Component.Stylesheet.path/1).