Specifying toggle and menu IDs. By default, Rivet auto-generates toggle and menu IDs. If you’d like the toggle and menu to have a specific ID, you can explicitly set the data-rvt-dropdown-toggle and data-rvt-dropdown-menu attribute values in your markup. The data-rvt-dropdown-toggle attribute value must match the data-rvt-dropdown-menu attribute value.
Use a dropdown with links for navigation menus. When using a dropdown to present the user with a list of pages they can navigate to, use a elements as the menu items rather than buttons. Most of the code examples on this page use links for menu items.
Use a dropdown with buttons for application menus. When using a dropdown to present the user with a list of actions they can take or settings they can toggle, use button elements as the menu items rather than links. See the “Dropdown with buttons” code example on this page for guidance.
Do
Use to present a list of pages the user can navigate to
Use to present a menu of actions the user can take or settings they can toggle
If button elements are used as menu items, this attribute marks that menu item as enabled and highlights it visually
aria-current="page"
If a elements are used as menu items, this attribute marks that menu item as the current page and highlights it visually
aria-expanded
Added to the button element with the data-rvt-dropdown-toggle attribute by the component’s JavaScript. Set to true if the dropdown menu is open; false otherwise.
aria-haspopup="menu"
Added to the button element with the data-rvt-dropdown-toggle attribute by the component’s JavaScript if the dropdown contains button elements