Popover
Examples
Popover with custom content
Popovers can be used to display any kind of custom content (even other components).
Web Component
JavaScript
This component accepts options to configure its behavior.
Methods
.setContent()
Use this method to change the content of the popover. It discards any previously attached content, so any resources attached to the content should be removed to prevent memory leaks. This method accepts a string or an HTML DOM Element as a parameter.
Events
Event | Description |
---|---|
chiPopoverShow | Popover show has been triggered, but the showing animation has not started yet. |
chiPopoverHide | Popover hide has been triggered, but the closing animation has not started yet. |
chiPopoverShown | Popover has been shown to the user and is fully visible. The animation has completed. |
chiPopoverHidden | Popover has been hidden to the user. The animation has completed. |
Preventing memory leaks
Popover components have a dispose function to free all resources attached to the element, such as event listeners and object data. You must call this method when you want to remove the component.
It is safe to call the popover
method more than once, as it will return any previously created popover component associated with the trigger.
Accessibility
Accessibility guidelines coming soon