DefaultVisualContentContentWithFooterContentWithHeaderEventsClosableAlertGroupPositionAlignmentCrossShadowRootAnchorPositionLegacyBehaviorTrigger
<nve-toggletip id="toggletip">hello there</nve-toggletip>
<nve-button popovertarget="toggletip">button</nve-button>
Edit Example
Generic toggletip element for rendering a variety of different interactive content. MDN Popover API
<nve-toggletip anchor="toggletip-btn">hello there</nve-toggletip>
<nve-button id="toggletip-btn">button</nve-button>
Edit Example
Visual example using anchor attribute for explicit trigger-target relationship and consistent toggletip implementation across your application.
<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>
Edit Example
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.
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.
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.
<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>
Edit Example
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
<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>
Edit Example
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.
<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>
Edit Example
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 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>
Edit Example
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.
<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>
Edit Example
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.
Cross Shadow Root Anchor Position
test-case
<nve-button popovertarget="root-toggletip">document root anchor</nve-button>
<nve-toggletip id="root-toggletip">document root toggletip</nve-toggletip>
<demo-shadow-root style="visibility: visible !important">
<template shadowrootmode="open">
<nve-toggletip id="cross-root-toggletip" hidden>cross root toggletip</nve-toggletip>
<slot></slot>
</template>
</demo-shadow-root>
<nve-button popovertarget="cross-root-toggletip">cross root anchor</nve-button>
Edit Example
Toggletip anchored to elements across shadow DOM boundaries.
Legacy Behavior Trigger
test-case
<nve-toggletip behavior-trigger anchor="action-btn" trigger="action-btn" hidden>hello there</nve-toggletip>
<nve-button id="action-btn">button</nve-button>
Edit Example
Legacy behavior-trigger pattern for automatic toggletip lifecycle management. Deprecated approach with manual trigger attributes, prefer modern popovertarget API for simpler and more maintainable toggletip implementation.