lightdarkdefaultcompact
Getting StartedInstallationChangelogSupportGithubFrameworksAngularVueReactDemosFoundationThemesTypographyIconsPopoversInternationalizationDrag and DropKeyboard NavigationLayoutGetting StartedBlockInlineGridComponentsAccordionAlertAlert GroupBadgeBreadcrumbButtonButton GroupButton ExpandButton HandleButton IconButton ResizeButton SortCardChatCheckboxColorData GridDateDialogDividerDrawerDropdownFileFormat DatetimeFormat NumberFormsForm InteractionsForm ValidationHeaderInputMenuMonthNavPaginationPasswordProgress BarProgress CircleProgress DotRadioRangeRatingSearchSelectStepperSwitchTabsTagTextareaTimeToastToggletipTooltipTreeData GridGetting StartedFooterPlaceholderAsyncResponsiveHeightPaginationBordersHoverLayerRange SelectionCSVColumn AlignmentColumn WidthColumn FixedColumn StickyColumn VisibilityColumn GroupsColumn SpanColumn ResizeDraggable ColumnsDraggable RowsRow HeaderRow Multi SelectRow Single SelectRow HeightRow ActionRow Action BulkRow StickyRow StripeRow FixedRow SortRow Groups

The tooltip component is used to provide additional information to the user when they hover over a specific element. It can be used to provide explanations, definitions, or supplementary information that is not critical to the main content.

Example

hello there
code
<div bp-layout="block center" style="height: 250px">
  <bp-button-icon popovertarget="tooltip-example" id="tooltip-btn" action="flat" shape="info" aria-label="open tooltip"></bp-button-icon>
  <bp-tooltip id="tooltip-example" anchor="tooltip-btn" position="top">hello there</bp-tooltip>
</div>
<script type="module">
  import '@blueprintui/components/include/tooltip.js';
  import '@blueprintui/components/include/button-icon.js';
  import '@blueprintui/icons/shapes/info.js';
</script>

Position

tooltip righttooltip lefttooltip bottomtooltip top
code
<div bp-layout="grid gap:md cols:6 block:stretch center" style="padding-top: 100px; max-height: 95vh; min-height: 340px">
  <bp-button-icon popovertarget="tooltip-1" id="tooltip-action-1" action="flat" shape="info" aria-label="open tooltip"></bp-button-icon>
  <bp-tooltip id="tooltip-1" anchor="tooltip-action-1" position="right">tooltip right</bp-tooltip>
  <bp-button-icon popovertarget="tooltip-2" id="tooltip-action-2" action="flat" shape="info" aria-label="open tooltip"></bp-button-icon>
  <bp-tooltip id="tooltip-2" anchor="tooltip-action-2" position="left">tooltip left</bp-tooltip>
  <bp-button-icon popovertarget="tooltip-3" id="tooltip-action-3" action="flat" shape="info" aria-label="open tooltip"></bp-button-icon>
  <bp-tooltip id="tooltip-3" anchor="tooltip-action-3" position="bottom">tooltip bottom</bp-tooltip>
  <bp-button-icon popovertarget="tooltip-4" id="tooltip-action-4" action="flat" shape="info" aria-label="open tooltip"></bp-button-icon>
  <bp-tooltip id="tooltip-4" anchor="tooltip-action-4" position="top">tooltip top</bp-tooltip>
</div>
<script type="module">
  import '@blueprintui/components/include/tooltip.js';
  import '@blueprintui/components/include/button-icon.js';
  import '@blueprintui/icons/shapes/info.js';
</script>

Install

NPM

// npm package
import '@blueprintui/components/include/tooltip.js';

CDN

<script type="module">
  import 'https://cdn.jsdelivr.net/npm/@blueprintui/components/include/tooltip.js/+esm';
</script>

Accessibility

  • The component should be fully navigable using only the keyboard, allowing users to easily move between different tooltips.
  • The component should also provide a clear visual indication of focus for keyboard only users.

bp-tooltip

Events

NameTypesDescription
opendispatched when the tooltip is opened
closedispatched when the tooltip is closed

Properties

NameTypesDescription
closablebooleandetermine user closable state
openbooleandefault popover to open on intialization
positionPositiondetermine the position relative to the anchor
anchorHTMLElement | stringanchor element popover will positiion relative to
triggerHTMLElement | stringthe triggering element that opens the popover
i18nset default aria/i18n strings

Attributes

NameTypesDescription
closablebooleandetermine user closable state
openbooleandefault popover to open on intialization
positionPositiondetermine the position relative to the anchor
anchorHTMLElement | stringanchor element popover will positiion relative to
triggerHTMLElement | stringthe triggering element that opens the popover
i18nset default aria/i18n strings

CSS Properties

NameTypesDescription
--padding
--filter
--background
--color
--width
--height
--min-width
--min-height
--font-size

Slots

NameTypesDescription
defaultcontent