# Popover Popover displays additional information or actions in a lightweight overlay triggered by user interaction. It can contain interactive content such as buttons, links, and form controls. **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-popover--introduction ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Popover. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Customization — Customization HTML: ```html ``` React: ```jsx import React from 'react'; const PopoverExample1Demo = () => ( <> {/* Variant: No Arrow */} > ); export default PopoverExample1Demo; ``` Angular: ```html ``` ### 2. Introduction — Introduction HTML: ```html
Popover displays additional information or actions in a lightweight overlay triggered by user interaction. It can contain interactive content such as buttons, links, and form controls.
Explore the key popover trigger patterns used most often across product surfaces, from directional placement to richer overlay content and minimal presentation tweaks.
Key CSS classes used across popover triggers and content patterns. Click any class name to copy it.
| Class | Purpose |
|---|---|
ux4g-btn | Base trigger button shell |
ux4g-btn-primary | Prominent rich-content trigger |
ux4g-btn-secondary | Alternative trigger emphasis |
ux4g-btn-outline-primary | Neutral outline trigger treatment |
| Attribute | Purpose |
|---|---|
data-ux-toggle="popover" | Enables popover behavior on the trigger |
data-ux-placement="top-start" | Align overlay above the trigger start edge |
data-ux-placement="right" | Centers overlay on the right side |
data-ux-placement="bottom-end" | Align overlay below the trigger end edge |
| Attribute | Purpose |
|---|---|
data-ux-title | Sets the popover heading |
data-ux-subtitle | Adds supporting metadata under the title |
data-ux-label | Shows a contextual badge-style label |
data-ux-icon | Displays a leading icon inside the overlay |
| Attribute | Purpose |
|---|---|
data-ux-content | Defines the main body copy or HTML payload |
data-ux-html="true" | Allows HTML rendering inside content |
data-ux-action-html | Injects action markup such as overflow menus |
data-ux-arrow="false" | Removes the default directional arrow |
A Popover is a small overlay UI component that appears floating above the page content, anchored to a trigger element.
Link `; const PopoverExample2Demo = () => ( <>Popover displays additional information or actions in a lightweight overlay triggered by user interaction. It can contain interactive content such as buttons, links, and form controls.
Explore the key popover trigger patterns used most often across product surfaces, from directional placement to richer overlay content and minimal presentation tweaks.
Key CSS classes used across popover triggers and content patterns. Click any class name to copy it.
| Class | Purpose |
|---|---|
ux4g-btn
|
Base trigger button shell |
ux4g-btn-primary
|
Prominent rich-content trigger |
ux4g-btn-secondary
|
Alternative trigger emphasis |
ux4g-btn-outline-primary
|
Neutral outline trigger treatment |
| Attribute | Purpose |
|---|---|
data-ux-toggle="popover"
|
Enables popover behavior on the trigger |
data-ux-placement="top-start"
|
Align overlay above the trigger start edge |
data-ux-placement="right"
|
Centers overlay on the right side |
data-ux-placement="bottom-end"
|
Align overlay below the trigger end edge |
| Attribute | Purpose |
|---|---|
data-ux-title
|
Sets the popover heading |
data-ux-subtitle
|
Adds supporting metadata under the title |
data-ux-label
|
Shows a contextual badge-style label |
data-ux-icon
|
Displays a leading icon inside the overlay |
| Attribute | Purpose |
|---|---|
data-ux-content
|
Defines the main body copy or HTML payload |
data-ux-html="true"
|
Allows HTML rendering inside content |
data-ux-action-html
|
Injects action markup such as overflow menus |
data-ux-arrow="false"
|
Removes the default directional arrow |
Popover displays additional information or actions in a lightweight overlay triggered by user interaction. It can contain interactive content such as buttons, links, and form controls.
Explore the key popover trigger patterns used most often across product surfaces, from directional placement to richer overlay content and minimal presentation tweaks.
Key CSS classes used across popover triggers and content patterns. Click any class name to copy it.
| Class | Purpose |
|---|---|
ux4g-btn | Base trigger button shell |
ux4g-btn-primary | Prominent rich-content trigger |
ux4g-btn-secondary | Alternative trigger emphasis |
ux4g-btn-outline-primary | Neutral outline trigger treatment |
| Attribute | Purpose |
|---|---|
data-ux-toggle="popover" | Enables popover behavior on the trigger |
data-ux-placement="top-start" | Align overlay above the trigger start edge |
data-ux-placement="right" | Centers overlay on the right side |
data-ux-placement="bottom-end" | Align overlay below the trigger end edge |
| Attribute | Purpose |
|---|---|
data-ux-title | Sets the popover heading |
data-ux-subtitle | Adds supporting metadata under the title |
data-ux-label | Shows a contextual badge-style label |
data-ux-icon | Displays a leading icon inside the overlay |
| Attribute | Purpose |
|---|---|
data-ux-content | Defines the main body copy or HTML payload |
data-ux-html="true" | Allows HTML rendering inside content |
data-ux-action-html | Injects action markup such as overflow menus |
data-ux-arrow="false" | Removes the default directional arrow |
A Popover is a small overlay UI component that appears floating above the page content, anchored to a trigger element (like a button).
Link `; const PopoverExample4Demo = () => ( <> {/* Variant: Rich Content */}A Popover is a small overlay UI component that appears floating above the page content, anchored to a trigger element (like a button).
Link" data-ux-html="true" data-ux-icon="grid_view" data-ux-label="Label" data-ux-placement="right" data-ux-subtitle="This is a subtitle text" data-ux-title="Popover Title" data-ux-toggle="popover">Complex Popover