๐Ÿš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more โ†’
Socket
Book a DemoInstallSign in
Socket

dlink-tooltip

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dlink-tooltip

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.1.6.

1.0.3
latest
npm
Version published
Weekly downloads
171K
70988.8%
Maintainers
1
Weekly downloads
ย 
Created
Source

dLinkTooltip

This library was generated with Angular CLI version 15.1.6.

dlink-tooltip is a lightweight, highly customizable Angular tooltip library designed to enhance UX without relying on heavy CSS hacks. Ideal for enterprise-level applications where UI clarity and control matter.

๐Ÿงช Beta Features

  • Live Tooltip Updates Tooltip content now updates in real-time, ensuring the latest data is always displayed.

  • Responsive Tooltip Positioning Tooltips now dynamically adjust their position during screen zoom or scroll events for improved visibility and user experience.

๐Ÿ”— Live Demo

Experience the new tooltip features in action: ๐Ÿ‘‰ View D-Link Tooltip Live Demo

Hardcoded CSS tooltips are:

  • โŒ Difficult to maintain
  • โŒ Not reusable
  • โŒ Often break on responsive layouts
  • โŒ Limited in positioning and interactivity

dLink offers:

  • โœ… Smart positioning to avoid clipping
  • โœ… Multiple trigger types (hover, click, focus, manual)
  • โœ… Rich content support (HTML, templates)
  • โœ… Built-in theme system (dark, light, custom)
  • โœ… Advanced animation system (fade, slide, scale)
  • โœ… Event callbacks and manual control(in future updates)
  • โœ… Accessibility features (ARIA, keyboard navigation)
  • โœ… Touch gesture support for mobile
  • โœ… Auto-hide and persistent tooltip options
  • โœ… Adjustable gap, size, alignment, delay, offset
  • โœ… Configurable animations and custom styles
  • โœ… No external dependencies, built natively with Angular
npm install dlink-tooltip

โš ๏ธ We recommend using a dLink LTS version to avoid dependency conflicts or bugs and ensure smoother integration.

๐Ÿ” Import the Module

import { DLinkModule } from 'dlink-tooltip';

@NgModule({
  imports: [ DLinkModule ]
})
export class YourModule { }

๐ŸŒ Angular Compatibility

dLink VersionAngular Version
Latest(beta)15.1.6

๐Ÿงช Latest Version 1.0.3(beta) tested up to Angular 15.1.6 (LTS)

โš™๏ธ Tooltip Directive Usage

Basic Usage

<!-- Simple tooltip -->
<button dLinkTooltip="This is a tooltip">Hover me</button>

Advanced Usage

<button
  dLinkTooltip="<strong>Rich HTML</strong> content"
  [tooltipHtml]="true"
  tooltipTheme="light"
  tooltipAnimation="scale"
  tooltipTrigger="click"
  [tooltipPosition]="'top-right'"
  [tooltipFontSize]="'14px'"
  [tooltipGap]="8"
  [tooltipAlign]="'left'"
  [tooltipMaxWidth]="'200px'"
  [tooltipClass]="'custom-tooltip'"
  [tooltipSmartPosition]="true"
  [tooltipSpeed]="'fast'"
  [tooltipShowDelay]="200"
  [tooltipHideDelay]="100"
  [tooltipAutoHide]="3000"
  [tooltipPersistent]="false"
  [tooltipShowOnLoad]="false"
  [tooltipOffset]="{x: 10, y: 5}"
  [tooltipTouchGestures]="true"
  tooltipAriaLabel="Additional info"
  (tooltipShow)="onShow()" //Info: In future updates 
  (tooltipHide)="onHide()" //Info: In future updates 
>
  Advanced Tooltip
</button>

๐Ÿ“ฅ Directive Inputs / Properties

Core Properties

InputTypeDefaultDescription
dLinkTooltipstring''The text/content shown in the tooltip
tooltipPosition'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right''top'Tooltip placement
tooltipTrigger'hover' | 'click' | 'focus''hover'How tooltip is triggered
tooltipTheme'dark' | 'light' | 'custom''dark'Built-in theme or custom styling
tooltipAnimation'fade' | 'slide' | 'scale' | 'none''fade'Animation type for show/hide
tooltipSpeed'fast' | 'medium' | 'slow''medium'Animation speed

Content & Styling

InputTypeDefaultDescription
tooltipHtmlbooleanfalseEnable HTML content rendering
tooltipFontSizestring'14px'Font size of tooltip content
tooltipMaxWidthstring'200px'Max width of the tooltip
tooltipAlign'center' | 'left' | 'right''center'Tooltip alignment relative to element
tooltipClassstring''Custom CSS class for additional styling

Positioning & Layout

InputTypeDefaultDescription
tooltipGapnumber8Distance between tooltip and element
tooltipOffset{x: number, y: number}{x:0, y:0}Additional X/Y offset for fine positioning
tooltipSmartPositionbooleantrueAuto-adjust if tooltip goes out of viewport

Timing & Behavior

InputTypeDefaultDescription
tooltipShowDelaynumber0Delay before showing tooltip (ms)
tooltipHideDelaynumber0Delay before hiding tooltip (ms)
tooltipAutoHidenumber0Auto-hide after milliseconds (0 = disabled)
tooltipPersistentbooleanfalseKeeps tooltip visible until manually hidden
tooltipShowOnLoadbooleanfalseShows tooltip as soon as component loads

Accessibility & Touch

InputTypeDefaultDescription
tooltipTouchGesturesbooleantrueEnable touch gesture support
tooltipRolestring'tooltip'ARIA role attribute
tooltipAriaLabelstring''ARIA label for accessibility

Output Events

EventTypeDescription
tooltipShowEventEmitter<void>Emitted when tooltip is shown
tooltipHideEventEmitter<void>Emitted when tooltip is hidden

Public Methods (In Future Updates - currently not available)

MethodDescription
showTooltip()Programmatically show the tooltip
hideTooltip()Programmatically hide the tooltip
toggleTooltip()Toggle tooltip visibility

๐ŸŽฏ Feature Examples

Trigger Types

<!-- Hover trigger (default) -->
<button dLinkTooltip="Hover tooltip" tooltipTrigger="hover">Hover me</button>

<!-- Click trigger -->
<button dLinkTooltip="Click tooltip" tooltipTrigger="click">Click me</button>

<!-- Focus trigger -->
<input dLinkTooltip="Focus tooltip" tooltipTrigger="focus" placeholder="Focus me">

Themes

<!-- Dark theme (default) -->
<button dLinkTooltip="Dark theme tooltip" tooltipTheme="dark">Dark</button>

<!-- Light theme -->
<button dLinkTooltip="Light theme tooltip" tooltipTheme="light">Light</button>

<!-- Custom theme -->
<button dLinkTooltip="Custom theme tooltip" tooltipTheme="custom" tooltipClass="my-custom-tooltip">Custom</button>

Animations

<!-- Fade animation (default) -->
<button dLinkTooltip="Fade animation" tooltipAnimation="fade">Fade</button>

<!-- Slide animation -->
<button dLinkTooltip="Slide animation" tooltipAnimation="slide">Slide</button>

<!-- Scale animation -->
<button dLinkTooltip="Scale animation" tooltipAnimation="scale">Scale</button>

<!-- No animation -->
<button dLinkTooltip="No animation" tooltipAnimation="none">None</button>

HTML Content

<!-- Plain text -->
<button dLinkTooltip="Plain text tooltip">Plain Text</button>

<!-- HTML content -->
<button dLinkTooltip="<strong>Bold</strong> and <em>italic</em> text" [tooltipHtml]="true">HTML Content</button>

<!-- Rich HTML -->
<button dLinkTooltip="<div style='color: #ff6b6b;'>๐ŸŽจ Styled HTML</div><br><small>With line breaks</small>" 
        [tooltipHtml]="true">Rich HTML</button>

Event Handling

export class MyComponent {
  onTooltipShow() {
    console.log('Tooltip shown!');
  }

  onTooltipHide() {
    console.log('Tooltip hidden!');
  }
}
<!-- Info: In future updates currently not available  -->
<button dLinkTooltip="Event tooltip" 
        (tooltipShow)="onTooltipShow()" 
        (tooltipHide)="onTooltipHide()"> 
  Events Tooltip
</button>

Persistent & Auto-hide

<!-- Persistent tooltip -->
<div dLinkTooltip="This tooltip stays visible!" 
     [tooltipPersistent]="true" 
     [tooltipShowOnLoad]="true" 
     tooltipPosition="right">
  Persistent tooltip
</div>

<!-- Auto-hide tooltip -->
<button dLinkTooltip="Auto-hide after 3 seconds" 
        [tooltipAutoHide]="3000">
  Auto Hide
</button>

Positioning & Offset

<!-- All position options -->
<button dLinkTooltip="Top tooltip" tooltipPosition="top">Top</button>
<button dLinkTooltip="Top-left tooltip" tooltipPosition="top-left">Top-Left</button>
<button dLinkTooltip="Top-right tooltip" tooltipPosition="top-right">Top-Right</button>
<button dLinkTooltip="Bottom tooltip" tooltipPosition="bottom">Bottom</button>
<button dLinkTooltip="Bottom-left tooltip" tooltipPosition="bottom-left">Bottom-Left</button>
<button dLinkTooltip="Bottom-right tooltip" tooltipPosition="bottom-right">Bottom-Right</button>
<button dLinkTooltip="Left tooltip" tooltipPosition="left">Left</button>
<button dLinkTooltip="Right tooltip" tooltipPosition="right">Right</button>

<!-- With offset -->
<button dLinkTooltip="Offset tooltip" [tooltipOffset]="{x: 20, y: 10}">Offset</button>

Accessibility

<button dLinkTooltip="Accessible tooltip" 
        tooltipAriaLabel="Additional accessibility information"
        tooltipRole="tooltip">
  Accessible Tooltip
</button>

Complex Example

<button 
  dLinkTooltip="<div style='text-align: center;'><strong>๐Ÿš€ Advanced Tooltip</strong><br><em>Multiple features combined</em><br><small style='color: #888;'>HTML + Theme + Animation</small></div>"
  [tooltipHtml]="true"
  tooltipTheme="light"
  tooltipAnimation="scale"
  tooltipSpeed="slow"
  tooltipPosition="top"
  [tooltipShowDelay]="300"
  [tooltipHideDelay]="200"
  tooltipMaxWidth="250px"
  [tooltipOffset]="{x: 0, y: -5}">
  ๐ŸŽฏ Complex Tooltip
</button>

Custom Styling

// Custom theme CSS
.my-custom-tooltip {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  border: 2px solid #fff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  font-weight: 600 !important;
}

๐Ÿ›  Development Commands

Generate Components

ng generate component component-name --project rx-tooltip

Always use --project rx-tooltip to scope to the library

Build the Library

ng build rx-tooltip

Publish to npm

cd dist/rx-tooltip
npm publish

Run Unit Tests

ng test rx-tooltip

๐Ÿ”— Additional Resources

FAQs

Package last updated on 06 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts