-
-
Notifications
You must be signed in to change notification settings - Fork 1
Component: Menu
TryHardDood edited this page Jan 8, 2021
·
1 revision
The Menu component and related child components are used to quickly build custom dropdown components that are fully accessible out of the box, including correct ARIA attribute management and robust keyboard navigation support.
Menus are built using the Menu
, MenuButton
, MenuItems
, and MenuItem
components.
<div Menu>
<button type="button" MenuButton>Toggle</button>
<ul *MenuItems>
<li MenuItem>Item #1</li>
</ul>
</div>
-
isOpened()
- boolean - Returntrue
if the menu is opened, returnsfalse
otherwise.
-
static
- boolean - Whether theMenuItems
should render by default.
The MenuButton
will automatically open/close the MenuItems when clicked, and when the menu is open, the list of items receives focus and is automatically navigable via the keyboard.
-
disabled
- boolean - Disabled the element.
Nothing
-
disabled
- boolean - Disabled the element, skipping when navigating with keyboards.
<li MenuItem>
<ng-template let-active="active">
<a href="#" [class.bg-gray-100]="active" class="hover:bg-gray-100 hover:text-gray-900 block px-4 py-2 text-sm text-gray-700">
Delete
</a>
</ng-template>
</li>