Popover, also known as Popover, is a container component that can overlay other components on page.
Popover is accessed via its ref and visibility is controlled using toggle, show and hide functions with an event of the target.
In this sample, data is retrieved from the content inside the popover.
Place the Popover outside of the data iteration components to avoid rendering it multiple times.
Id | Code | Name | Price | Image | Details |
---|---|---|---|---|---|
1000 | f230fh0g3 | Bamboo Watch | $ 65 | ![]() | |
1001 | nvklal433 | Black Watch | $ 72 | ![]() | |
1002 | zz21cz3c1 | Blue Band | $ 79 | ![]() | |
1003 | 244wgerg2 | Blue T-Shirt | $ 29 | ![]() | |
1004 | h456wer53 | Bracelet | $ 15 | ![]() |
Popover component uses dialog role and since any attribute is passed to the root element you may define attributes like aria-label or aria-labelledby to describe the popup contents. In addition aria-modal is added since focus is kept within the popup.
Popover adds aria-expanded state attribute and aria-controls to the trigger so that the relation between the trigger and the popup is defined.
When the popup gets opened, the first focusable element receives the focus and this can be customized by adding autofocus to an element within the popup.
Key | Function |
---|---|
tab | Moves focus to the next the focusable element within the popup. |
shift + tab | Moves focus to the previous the focusable element within the popup. |
escape | Closes the popup and moves focus to the trigger. |