Angular Popover - Overview
The Popover is a UI component that shows notifications within a box with an arrow pointing to a specified UI element.
The following code creates a simple Popover on your page and attaches it to another element (in this example, to an image).
jQuery
<img id="image" src="https://url/to/an/image" />
<div id="popoverContainer">
<p>Popover content</p>
</div>
$(function() { $("#popoverContainer").dxPopover({ target: "#image", showEvent: 'dxhoverstart', hideEvent: 'dxhoverend' }); });
Angular
<img id="image" src="https://url/to/an/image" />
<dx-popover
target="#image"
showEvent="dxhoverstart"
hideEvent="dxhoverend">
<div *dxTemplate="let data of 'content'">
<p>Popover content</p>
</div>
</dx-popover>
import { DxPopoverModule } from "devextreme-angular"; // ... export class AppComponent { // ... } @NgModule({ imports: [ // ... DxPopoverModule ], // ... })
Vue
<template>
<div>
<img id="image" src="https://url/to/an/image" />
<DxPopover
target="#image"
show-event="dxhoverstart"
hide-event="dxhoverend">
<template #content>
<p>Popover content</p>
</template>
</DxPopover>
</div>
</template>
<script>
import 'devextreme/dist/css/dx.light.css';
import { DxPopover } from 'devextreme-vue/popover';
export default {
components: {
DxPopover
}
}
</script>
React
import React from 'react';
import 'devextreme/dist/css/dx.light.css';
import { Popover } from 'devextreme-react/popover';
const renderContent = () => {
return (
<p>Popover content</p>
);
};
class App extends React.Component {
render() {
return (
<div>
<img id="image" src="https://url/to/an/image" />
<Popover
target="#image"
showEvent="dxhoverstart"
hideEvent="dxhoverend"
contentRender={renderContent}
/>
</div>
);
}
}
export default App;
ASP.NET MVC Controls
@(Html.DevExtreme().Popover()
.Target("#image")
.ShowEvent("dxhoverstart")
.HideEvent("dxhoverend")
.ContentTemplate(@<text>
<p>Popover content</p>
</text>)
)
<img id="image" src="https://url/to/an/image" />
The component may affect the page layout when used inside a flex container with other elements. For example, the following parent CSS styles can cause this issue:
.flex { display: flex; justify-content: space-between; }
To avoid changes to the page layout, implement the following CSS styles for the Popover container:
.dx-popover { display: none !important; }
There are several ways to specify the content of the Popover. Learn more in the Customize the Content article. The Popover can also be displayed with a title and toolbars. For detailed information, see the Customize the Title and Specify Toolbar Items topics.
See Also
jQuery
Angular
Vue
React
If you have technical questions, please create a support ticket in the DevExpress Support Center.