app/client/packages/design-system/ads/src/Popover/Popover.mdx
import { Canvas, Meta } from "@storybook/blocks";
import * as PopoverStories from "./Popover.stories";
<Meta of={PopoverStories} />A Popover is a page overlay triggered by a button that displays additional interactive content.
<Canvas of={PopoverStories.PopoverStory} />Esc key.Consider that the close icon and title are not mandatory and might not be needed in every scenario. The inclusion and implementation of these features could differ based on the requirements of the use case.
Small popovers are best suited for providing quick information or simple actions. They are ideal for presenting concise content or single-line actions. They are suitable for cases where a brief description or small set of options needs to be displayed.
Example: Action selector.
<Canvas of={PopoverStories.PopoverContentStory} />Medium popovers are suitable for more detailed content and actions. They work well for scenarios where users need to interact with more content, such as selecting from a verbose list of options or filling out a form.
Example: Add JS libraries, Git branch
<Canvas of={PopoverStories.MediumPopoverContentStory} />Triggers for a popover can be a button, icon, icon-button, action-list.
Ensure that the content area of the popover is scrollable to accommodate longer content.
List of options: When presenting a list of options, items, or actions that wouldn't fit entirely within the popover's visible area, scrolling lets users explore the full list without enlarging the popover itself. However, the header of the popover should remain sticky as the user scrolls through the content. This has been done in this component by default, but should be implemented for any secondary headings within the popover content.
| ✅ Do | ❌ Don’t |
|---|---|
| Use Popover when you need to display supplemental interactive content over the top of your UI. It should have at least one focusable element. | Don’t present critical information or required inputs in Popovers, use the Modal instead. |
| Popovers should be triggered by a button. | Don’t place more than one primary action in a Popover. |
| Consider the best size for the Popover container, based on its content. | Don’t use a Popover to guide users through a complex workflow with a series of steps or for presenting critical information. Use a Modal for workflows. |