> For the complete documentation index, see [llms.txt](https://voit.gitbook.io/voitdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://voit.gitbook.io/voitdocs/components/popover.md).

# Popover

Popovers are floating containers that display additional information or options in context with a trigger element. They are used to provide contextual actions or information.

<figure><img src="https://1456965416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHrijNlCiWxhWuZ7eBdg%2Fuploads%2FOgB65KxTSQEytpj5evfb%2FFrame%2045.png?alt=media&amp;token=ab4ed46d-41b1-41c2-9bbb-54addc0787e5" alt=""><figcaption></figcaption></figure>

## Overview

Popovers are activated by hovering or clicking on a trigger element, providing a non-modal way to display extra information or options.

{% embed url="<https://www.figma.com/design/4NwKhd4dwRhRF5Zpiooi69/Components?node-id=2-234998&t=0Thv0LIO2gFzE3eo-4>" %}

## When to use

* Use a popover to present quick actions, such as options or settings related to a specific element or task.&#x20;
* Use a popover for selecting options that relate to a specific task or element, such as editing or filtering settings.&#x20;
* When the information displayed is transient and doesn’t need to remain on screen, popovers can efficiently communicate this.&#x20;
* Use a popover to keep your page uncluttered by hiding supplementary actions or information behind a trigger.

## When not to use

* Avoid popovers when the information is essential or needs to be always visible.&#x20;
* Don't use popovers for workflows that require significant interaction or decision-making; opt for more structured components like dialogs.&#x20;
* Avoid using popovers to navigate between views or pages. Popovers should maintain users in the same context.&#x20;
* If a user needs to repeatedly interact with the content, don't use a popover as it might frustrate the experience.&#x20;
* Use inline or always-visible elements. Popovers should not be used to display large blocks of text or complex layouts.

## Types

<figure><img src="https://1456965416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHrijNlCiWxhWuZ7eBdg%2Fuploads%2FveBsygrCDqQ3wwKetYa1%2FVariants.png?alt=media&amp;token=c52b3f62-fa55-40e3-99ba-209ad37932f6" alt=""><figcaption></figcaption></figure>

## Anatomy

1. **Pointer:** A small triangle connecting the popover to its trigger element, visually indicating the relationship.&#x20;
2. **Container:** The main frame that holds the content of the popover, styled to float above other elements.&#x20;
3. **Dismiss Icon:** A close icon (often an 'X') that allows users to dismiss the popover quickly.&#x20;
4. **Title:** The heading of the popover that provides context to the content.&#x20;
5. **Description:** The text within the popover that elaborates additional information about the context or actions.&#x20;
6. **Actions (Button Group):** Buttons at the bottom of the popover that allow the user to perform related actions.

<figure><img src="https://1456965416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHrijNlCiWxhWuZ7eBdg%2Fuploads%2F8dOY3PLzA4JqgzUJRAwo%2FAnatomy.png?alt=media&amp;token=d2662131-1b56-4653-8e97-57ed7c04ee7e" alt=""><figcaption></figcaption></figure>

## Alignment

<figure><img src="https://1456965416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHrijNlCiWxhWuZ7eBdg%2Fuploads%2F6IkCFCQcfYGEJGuuhfve%2FAlignment.png?alt=media&amp;token=f712cd55-fd59-4a40-a999-5d444c295fec" alt=""><figcaption></figcaption></figure>

## Size

<figure><img src="https://1456965416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHrijNlCiWxhWuZ7eBdg%2Fuploads%2Fi3hRtwnjDq4HFeaJEa1d%2FSize.png?alt=media&amp;token=a97ac43a-4401-4b00-b26c-504e7e46e20a" alt=""><figcaption></figcaption></figure>

| Size    | Title (px) | Description (px) | Icon (px) | Corner (px) | Container Height (px) |
| ------- | ---------- | ---------------- | --------- | ----------- | --------------------- |
| Default | 16         | 14               | 16        | 16          | 48                    |

## Accessibility

* **Keyboard Navigation:** Ensure popovers are fully navigable using the keyboard, allowing users to open, interact with, and close them without needing a mouse.&#x20;
* **Maintain Focus Control:** When the popover is active, ensure that focus is trapped inside the popover until it is dismissed. Focus should return to the trigger element when the popover closes.&#x20;
* **Dismissible with ESC Key:** Popovers should always be dismissible with the Escape key. This is critical for accessibility as it gives users control over closing transient content.

## Example

* **Action Options:** A popover for selecting quick settings, such as filtering options on a search page.&#x20;
* **Inline Help:** Hovering over a question mark icon displays a popover with helpful tips or explanations about form fields.&#x20;
* **Profile Preview:** Clicking on a username opens a popover showing a brief user profile with quick action buttons like "Message" or "Follow."&#x20;
* **Notification Settings:** A popover provides easy-to-reach options for configuring notifications when interacting with the notifications icon.
