npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@libs-ui/components-popover

v0.2.355-15

Published

> Component hiển thị nội dung nổi (popover/tooltip) gắn liền với một phần tử gốc, hỗ trợ nhiều hướng và chế độ kích hoạt.

Readme

@libs-ui/components-popover

Component hiển thị nội dung nổi (popover/tooltip) gắn liền với một phần tử gốc, hỗ trợ nhiều hướng và chế độ kích hoạt.

Giới thiệu

Bộ công cụ Popover cung cấp giải pháp hiển thị thông tin ngữ cảnh linh hoạt. Bạn có thể sử dụng nó dưới dạng Directive để tiết kiệm DOM hoặc Component Selector khi cần bọc nhiều phần tử phức tạp.

Tính năng

  • Linh hoạt cách dùng: Hỗ trợ cả Directive và Component Selector.
  • Định vị thông minh: Tự động tính toán hướng để không bị tràn khung nhìn (viewport).
  • Template Support: Hỗ trợ hiển thị nội dung từ string đơn giản đến ng-template phức tạp.
  • Event Handling: Quản lý tốt các sự kiện hover, click và click-outside.
  • Customizable: Dễ dàng tùy chỉnh chiều rộng, class CSS và hướng hiển thị.
  • OnPush Change Detection
  • Angular Signals

Khi nào sử dụng

  • Hiển thị thông tin bổ sung (Tooltips) khi di chuột qua phần tử.
  • Hiển thị menu hoặc nội dung chi tiết khi nhấn vào nút.
  • Thông báo trạng thái hoặc hướng dẫn người dùng tại chỗ.

Cài đặt

# npm
npm install @libs-ui/components-popover

# yarn
yarn add @libs-ui/components-popover

Import

import { LibsUiComponentsPopoverModule } from '@libs-ui/components-popover';

@Component({
  standalone: true,
  imports: [LibsUiComponentsPopoverModule],
  // ...
})
export class YourComponent {}

Ví dụ

Directive (Sử dụng phổ biến)

<div
  LibsUiComponentsPopoverDirective
  [config]="{ content: 'Nội dung thông báo' }">
  Hover me
</div>

Component Selector

<libs_ui-components-popover [config]="{ content: 'Nội dung thông báo', direction: 'top' }">
  <button>Action</button>
</libs_ui-components-popover>

API

LibsUiComponentsPopoverDirective / LibsUiComponentsPopoverComponent

Inputs

| Property | Type | Default | Description | | ------------------------------------ | ------------------------------ | ------------ | -------------------------------------------------------- | | [config] | IPopoverConfig | Bắt buộc | Cấu hình nội dung, hướng và kích thước của popover. | | [mode] | 'hover' \| 'click' \| 'none' | 'hover' | Chế độ kích hoạt hiển thị. | | [ignoreCursorPointerModeLikeClick] | boolean | false | Bỏ qua việc đổi cursor thành pointer trong chế độ click. | | [ignoreStopPropagationEvent] | boolean | false | Cho phép sự kiện click lan truyền ra lớp cha. | | [initEventInElementRefCustom] | ElementRef | undefined | Gắn sự kiện vào một element khác thay vì host element. |

Outputs

| Property | Type | Description | | --------------- | --------- | --------------------------------------- | | (outExpanded) | boolean | Phát ra trạng thái đóng/mở của popover. |

Types & Interfaces

export interface IPopoverConfig {
  content?: string;
  template?: TemplateRef<any>;
  direction?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
  width?: number;
  classCustom?: string;
  context?: any;
}

Styling

CSS Classes

| Class | Description | | ---------------------------- | ----------------------------------- | | .libs-ui-popover-container | Lớp bao ngoài của nội dung popover. | | .libs-ui-popover-arrow | Mũi tên chỉ hướng của popover. |

Công nghệ

| Technology | Version | Purpose | | --------------- | ------- | ------------------ | | Angular | 18+ | Framework | | CDK Overlay | 18+ | Positioning engine | | Angular Signals | - | State management | | TailwindCSS | 3.x | Styling |

Demo

npx nx serve core-ui

Truy cập: http://localhost:4200/popover

Unit Tests

# Chạy tests
npx nx test components-popover

# Coverage
npx nx test components-popover --coverage

License

MIT