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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@libs-ui/components-scroll-overlay

v0.2.351-0

Published

## Giới thiệu

Readme

Scroll Overlay Component

Giới thiệu

scroll-overlay là một directive mạnh mẽ giúp tuỳ biến thanh cuộn (scrollbar) cho bất kỳ phần tử nào trong ứng dụng Angular. Directive này cung cấp giao diện thanh cuộn đẹp, có thể tuỳ chỉnh màu sắc, kích thước, hiệu ứng hover, và nhiều tuỳ chọn nâng cao khác.

Tính năng

  • Tuỳ chỉnh màu sắc, chiều rộng, padding của thanh cuộn
  • Hỗ trợ cả chiều ngang (X) và dọc (Y)
  • Hiệu ứng hover cho track và thumb
  • Ẩn/hiện scrollbar khi hover hoặc theo tuỳ chọn
  • Hỗ trợ drag & drop thumb để cuộn
  • Sự kiện scroll chi tiết (top, bottom, X, Y)
  • Dễ dàng tích hợp vào bất kỳ container nào

Cài đặt

Cài đặt package qua npm hoặc yarn:

npm install @libs-ui/components-scroll-overlay

hoặc

yarn add @libs-ui/components-scroll-overlay

Sử dụng

Import directive

import { LibsUiComponentsScrollOverlayDirective } from '@libs-ui/components-scroll-overlay';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [LibsUiComponentsScrollOverlayDirective],
  template: `
    <div
      LibsUiComponentsScrollOverlayDirective
      style="width: 300px; height: 400px;">
      Nội dung dài ở đây...
    </div>
  `,
})
export class ExampleComponent {}

Ví dụ nâng cao với options

<div
  LibsUiComponentsScrollOverlayDirective
  [options]="{scrollbarWidth: 12, scrollbarColor: '#eee', scrollThumbColor: '#888', scrollYOpacity0: true}"
  style="width: 300px; height: 400px;">
  Nội dung dài ở đây...
</div>

API Reference

Inputs

| Input | Type | Mô tả | | ------------------- | --------------------- | ------------------------------------------------------------- | | options | IScrollOverlayOptions | Tuỳ chọn cấu hình thanh cuộn | | debugMode | boolean | Bật chế độ debug | | ignoreInit | boolean | Bỏ qua khởi tạo directive | | classContainer | string | Thêm class cho container bọc ngoài | | notShowScrollBarX | boolean | Không hiển thị thanh cuộn ngang | | notShowScrollBarY | boolean | Không hiển thị thanh cuộn dọc | | elementCheckScrollX | HTMLElement | Phần tử dùng để kiểm tra scroll X (mặc định là chính element) | | elementCheckScrollY | HTMLElement | Phần tử dùng để kiểm tra scroll Y (mặc định là chính element) | | elementScroll | HTMLElement | Phần tử thực hiện scroll (mặc định là chính element) |

Outputs

| Output | Type | Mô tả | | --------------- | ----- | ----------------------------------- | | outScroll | Event | Bắn ra khi scroll bất kỳ | | outScrollX | Event | Bắn ra khi scroll theo chiều ngang | | outScrollY | Event | Bắn ra khi scroll theo chiều dọc | | outScrollTop | Event | Bắn ra khi scroll tới đầu (top) | | outScrollBottom | Event | Bắn ra khi scroll tới cuối (bottom) |

Options (IScrollOverlayOptions)

| Thuộc tính | Type | Mô tả | | --------------------- | ------------------ | ----------------------------------------------- | | scrollbarWidth | number | Chiều rộng/thanh cuộn (px) | | scrollbarColor | string | Màu nền track | | scrollbarHoverColor | string | Màu nền track khi hover | | scrollThumbColor | string | Màu thumb | | scrollThumbHoverColor | string | Màu thumb khi hover | | scrollbarPadding | number | Padding của scrollbar | | scrollX | 'hidden'|'scroll' | Kiểu hiển thị scroll X ('hidden' hoặc 'scroll') | | scrollXOpacity0 | boolean | Ẩn track X khi không hover | | scrollY | 'hidden'|'scroll' | Kiểu hiển thị scroll Y ('hidden' hoặc 'scroll') | | scrollYOpacity0 | boolean | Ẩn track Y khi không hover |

Interface

export interface IScrollOverlayOptions {
  scrollbarWidth?: number;
  scrollbarColor?: string;
  scrollbarHoverColor?: string;
  scrollThumbColor?: string;
  scrollThumbHoverColor?: string;
  scrollbarPadding?: number;
  scrollX?: 'hidden' | 'scroll';
  scrollXOpacity0?: boolean;
  scrollY?: 'hidden' | 'scroll';
  scrollYOpacity0?: boolean;
}

Ví dụ sử dụng nâng cao

<!-- Scroll overlay với tuỳ chỉnh màu sắc và hiệu ứng ẩn/hiện -->
<div
  LibsUiComponentsScrollOverlayDirective
  [options]="{scrollbarWidth: 8, scrollbarColor: '#f3f4f6', scrollThumbColor: '#3b82f6', scrollThumbHoverColor: '#2563eb', scrollYOpacity0: true}"
  style="width: 250px; height: 350px;">
  <div style="height: 1000px;">Nội dung rất dài để test scroll overlay...</div>
</div>

Ghi chú

  • Directive này hoạt động tốt với mọi phần tử có overflow.
  • Có thể kết hợp nhiều options để đạt hiệu quả UI mong muốn.
  • Để tuỳ chỉnh sâu hơn, hãy xem thêm code và các sự kiện output để tích hợp logic riêng.