Generic toggletip element for rendering a variety of different interactive content. MDN Popover API
<nve-toggletip id="toggletip">hello there</nve-toggletip>
<nve-button popovertarget="toggletip">button</nve-button>
Installation
Learn more about native Popover APIs.
<script type="module">
import '@nvidia-elements/core/toggletip/define.js';
</script>
<nve-toggletip id="toggletip">hello there</nve-toggletip>
<nve-button popovertarget="toggletip">button</nve-button>
nve api.get nve-toggletip
Visual
Visual example using anchor attribute for explicit trigger-target relationship and consistent toggletip implementation across your application.
<nve-toggletip anchor="toggletip-btn">hello there</nve-toggletip>
<nve-button id="toggletip-btn">button</nve-button>
Position
Determines the position of an element along both inline and block axis. MDN
Position Description center Centers the popover directly over the anchor element. top Positions the popover above the anchor element. bottom Positions the popover below the anchor element. left Positions the popover to the left side of the anchor element. right Positions the popover to the right side of the anchor element.
Toggletip positioning options relative to trigger element. Choose position based on available screen space and content type, ensuring toggletips remain visible and don't extend beyond viewport boundaries.
<nve-toggletip anchor="btn" position="top">top</nve-toggletip>
<nve-toggletip anchor="btn" position="right">right</nve-toggletip>
<nve-toggletip anchor="btn" position="bottom">bottom</nve-toggletip>
<nve-toggletip anchor="btn" position="left">left</nve-toggletip>
<nve-button id="btn">button</nve-button>
Alignment
Determines the alignment of the popover relative to the provided anchor element.
Alignment Description start Aligns the popover to the beginning edge of the anchor for left or top alignment. end Aligns the popover to the ending edge of the anchor for right or bottom alignment. center Centers the popover along the anchor's edge for balanced positioning.
Precise toggletip alignment combined with positioning for optimal placement control. Use alignment to fine-tune toggletip placement relative to trigger edges, improving visual flow and reducing content overlap in dense layouts.
<nve-toggletip anchor="card" position="top" alignment="start">top start</nve-toggletip>
<nve-toggletip anchor="card" position="top">top center</nve-toggletip>
<nve-toggletip anchor="card" position="top" alignment="end">top end</nve-toggletip>
<nve-toggletip anchor="card" position="right" alignment="start">right start</nve-toggletip>
<nve-toggletip anchor="card" position="right">right center</nve-toggletip>
<nve-toggletip anchor="card" position="right" alignment="end">right end</nve-toggletip>
<nve-toggletip anchor="card" position="bottom" alignment="start">bottom start</nve-toggletip>
<nve-toggletip anchor="card" position="bottom">bottom center</nve-toggletip>
<nve-toggletip anchor="card" position="bottom" alignment="end">bottom end</nve-toggletip>
<nve-toggletip anchor="card" position="left" alignment="start">left start</nve-toggletip>
<nve-toggletip anchor="card" position="left">left center</nve-toggletip>
<nve-toggletip anchor="card" position="left" alignment="end">left end</nve-toggletip>
<nve-card id="card" style="width: 400px; height: 200px"></nve-card>
Closable
Indicates whether the user can dismiss or close the element.
Closable Description true The element displays a close control and the user can dismiss it. false The user cannot close the element and must dismiss it programmatically.
Closable toggletip with explicit close button for user control. Use when content is complex enough that users may want to dismiss it independently of clicking outside, providing clear exit paths for longer-form content.
<nve-toggletip anchor="btn" closable>
<nve-toggletip-header>Toggletip Header</nve-toggletip-header>
<p nve-text="body">some text content in a toggletip</p>
<nve-toggletip-footer>Toggletip Footer</nve-toggletip-footer>
</nve-toggletip>
<nve-button id="btn">button</nve-button>
Events
Event Description close Dispatched when the toggletip closes.
open Dispatched when the toggletip opens.
toggle Dispatched on a popover element just after showing or hiding. MDN
beforetoggle Dispatched on a popover just before showing or hiding. MDN
Event handling for toggletip lifecycle events. Useful for adding custom behavior when toggletip state changes.
<nve-toggletip id="toggletip">hello there</nve-toggletip>
<nve-button popovertarget="toggletip">button</nve-button>
<script type="module">
const toggletip = document.querySelector("nve-toggletip");
toggletip.addEventListener("beforetoggle", () => console.log("beforetoggle"));
toggletip.addEventListener("toggle", () => console.log("toggle"));
toggletip.addEventListener("close", () => console.log("close"));
toggletip.addEventListener("open", () => console.log("open"));
</script>
Toggletip with complete structure including header, content, and footer sections. Perfect for rich interactive content like quick forms, action menus, or detailed explanations that gain from organized layout.
<nve-toggletip anchor="btn">
<nve-toggletip-header>
<h3 nve-text="heading sm">Toggletip Header</h3>
</nve-toggletip-header>
<p nve-text="body">some text content in a toggletip</p>
<nve-toggletip-footer>
<p nve-text="body">Toggletip Footer</p>
</nve-toggletip-footer>
</nve-toggletip>
<nve-button id="btn">button</nve-button>
Toggletip with header for titled content sections. Use when toggletip information benefits from a clear title or heading to establish context, improving content scannability and understanding.
Toggletip with footer for action buttons or supplementary links. Use when toggletip content needs follow-up actions, navigation, or extra context links without requiring a header section.
Alert Group
Toggletip with alert header for error states or critical messaging. Perfect for displaying error details with recovery actions, combining status communication with actionable next steps in a compact format.
<nve-toggletip id="toggletip-alert-group">
<nve-toggletip-header>
<nve-alert-group status="danger" container="full" prominence="emphasis">
<nve-alert>Workflow Failed</nve-alert>
</nve-alert-group>
</nve-toggletip-header>
<p nve-text="body">some text content in a toggletip</p>
<nve-toggletip-footer>
<nve-button style="width: 100%">Retry Workflow</nve-button>
</nve-toggletip-footer>
</nve-toggletip>
<nve-button popovertarget="toggletip-alert-group">button</nve-button>
Release Status
All elements and features go through 3 phases of stability, pre-release, beta and stable.
pre-release
Docs Preview
API Documentation
Fully Themeable
beta
Robust unit test coverages
Passed API Review
Passed Designer VQA Review
Included in library package
stable
No known outstanding AA WCAG issues
No known outstanding performance issues
Adapts to different screen/container sizes
No breaking API changes for at least 90 days