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-modal

v0.2.355-15

Published

> Component Modal mạnh mẽ và linh hoạt hỗ trợ hiển thị nội dung trên một lớp phủ, giúp tập trung sự chú ý của người dùng vào một tác vụ cụ thể.

Readme

@libs-ui/components-modal

Component Modal mạnh mẽ và linh hoạt hỗ trợ hiển thị nội dung trên một lớp phủ, giúp tập trung sự chú ý của người dùng vào một tác vụ cụ thể.

Giới thiệu

LibsUiComponentsModalComponent là một standalone component cung cấp giải pháp hiển thị modal chuyên nghiệp với các tính năng:

  • Đa dạng Mode: Hỗ trợ hiển thị ở giữa màn hình (center) hoặc trượt từ bên phải (offset-right).
  • Cấu trúc linh hoạt: Tích hợp sẵn Header, Body, Footer với khả năng tùy biến nội dung cao qua cả @Input và content projection.
  • Quản lý trạng thái: Hỗ trợ đóng modal qua phím Escape, backdrop, hoặc các nút điều khiển.
  • Signals Ready: Sử dụng Angular Signals cho việc quản lý hiển thị và cấu hình.
  • Hiệu ứng mượt mà: Tích hợp các animation chuyển cảnh hiện đại.

Khi nào sử dụng

  • Khi cần xác nhận một hành động quan trọng từ người dùng (Confirm dialog).
  • Khi hiển thị form nhập liệu hoặc chi tiết thông tin mà không muốn rời khỏi trang hiện tại.
  • Khi cần thông báo kết quả thao tác (Success/Error/Warning messages).
  • Khi hiển thị các tài liệu, hướng dẫn hoặc nội dung phụ trợ.

Cài đặt

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

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

Import

import { LibsUiComponentsModalComponent } from '@libs-ui/components-modal';

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

Ví dụ

Basic Modal (Center)

<libs_ui-components-modal
  [(show)]="isVisible"
  mode="center"
  title="Tiêu đề Modal"
  [bodyConfig]="{
    lines: [{ text: 'Nội dung thông báo đơn giản ở đây.' }]
  }"
  (outEvent)="onModalEvent($event)"></libs_ui-components-modal>

Advanced (Offset Right with Custom Content)

<libs_ui-components-modal
  [(show)]="isDetailOpen"
  mode="offset-right"
  width="600px"
  title="Chi tiết đơn hàng"
  (outEvent)="handlerEvent($event)">
  <div class="libs-ui-modal-body-custom p-4">
    <!-- Nội dung phức tạp của bạn ở đây -->
    <app-order-detail [data]="currentOrder"></app-order-detail>
  </div>

  <div class="libs-ui-modal-footer-custom px-4 py-3 flex justify-end gap-2">
    <button (click)="isDetailOpen = false">Đóng</button>
    <button (click)="save()">Lưu thay đổi</button>
  </div>
</libs_ui-components-modal>

API

libs_ui-components-modal

Inputs

| Property | Type | Default | Description | | ---------------------------- | ---------------------------- | ---------------- | ----------------------------------------------------------- | | [(show)] | boolean | true | Điều khiển trạng thái hiển thị của modal (Two-way binding). | | [mode] | 'center' \| 'offset-right' | 'offset-right' | Chế độ hiển thị của modal. | | [width] | string | undefined | Chiều rộng của modal (ví dụ: '500px', '50%'). | | [height] | string | undefined | Chiều cao của modal. | | [title] | string | '' | Tiêu đề hiển thị trên header. | | [zIndex] | number | 1200 | Thứ tự hiển thị lớp phủ. | | [isFullScreen] | boolean | false | Bật chế độ hiển thị toàn màn hình. | | [disable] | boolean | false | Vô hiệu hóa các tương tác trong modal. | | [headerConfig] | IModalHeaderConfig | {} | Cấu hình chi tiết cho phần Header. | | [bodyConfig] | IModalBodyConfig | {} | Cấu hình nội dung mặc định phần Body. | | [footerConfig] | IModalFooterConfig | {} | Cấu hình phần Footer. | | [buttonsFooter] | Array<IButton> | undefined | Danh sách các nút ở Footer (nếu dùng mặc định). | | [escapeKeyboardCloseModal] | boolean | false | Cho phép đóng modal khi nhấn phím Escape. |

Outputs

| Property | Type | Description | | ---------------------- | -------------------------------------- | ---------------------------------------------------------------------------------- | | (outEvent) | EventEmitter<TYPE_MODAL_EVENT> | Phát ra các sự kiện khi người dùng tương tác (close, back, agree, cancel). | | (outScrollContent) | EventEmitter<Event> | Phát ra khi người dùng cuộn nội dung bên trong modal. | | (outFunctionControl) | EventEmitter<IModalFunctionsControl> | Cung cấp bộ hàm điều khiển modal từ bên ngoài. |

Methods (via Controls)

| Method | Parameters | Description | | ------------------------ | ---------- | -------------------------------------- | | show() | - | Mở hiển thị modal. | | hide() | - | Đóng ẩn modal. | | setStateDisable(state) | boolean | Cập nhật trạng thái disable của modal. |

Types & Interfaces

export interface IModalHeaderConfig {
  hasBackButton?: boolean;
  removeButtonClose?: boolean;
  hidden?: boolean;
  classTitle?: string;
  // ...
}

export interface IModalBodyConfig {
  lines?: Array<{ text: string; class?: string }>;
  iconType?: 'warning' | 'success' | 'fail' | 'information';
  // ...
}

Công nghệ

| Technology | Purpose | | --------------- | --------------------------------------------- | | Angular 18+ | Framework chính | | Angular Signals | Quản lý state reactive (model, input, signal) | | RxJS | Xử lý sự kiện (timer, scroll, keyup) | | Standard CSS | Hệ thống layout và animation |

License

MIT