Skip to content

Behaviours

The attributes a page writes to wire up the platform’s one controller, read off what that controller looks for. Served over MCP as vizitka://docs/behaviors, and by describe_vocabulary with topic=behaviors.

data-controller="disclosure" data-action="keydown.esc@window->disclosure#closeOnEscape"

A div is not focusable and not a button, so a control that is one has to say so — otherwise the menu is mouse-only.

role="button" tabindex="0" aria-expanded="false" data-disclosure-target="control" data-action="click->disclosure#toggle keydown.enter->disclosure#toggle keydown.space->disclosure#toggle"
hidden data-disclosure-target="panel" data-action="click->disclosure#closeOnLink"
hidden data-disclosure-target="backdrop" data-action="click->disclosure#close"