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

v0.2.355-15

Published

`@libs-ui/components-label` là một component cơ bản nhưng đa năng dùng để hiển thị nhãn (label) cho các thành phần UI khác. Nó hỗ trợ tooltip, văn bản phụ, nút bấm điều khiển và cả công tắc (toggle switch).

Downloads

2,749

Readme

Label Component

@libs-ui/components-label là một component cơ bản nhưng đa năng dùng để hiển thị nhãn (label) cho các thành phần UI khác. Nó hỗ trợ tooltip, văn bản phụ, nút bấm điều khiển và cả công tắc (toggle switch).

Tính năng nổi bật

  • 🌍 Đa ngôn ngữ: Hỗ trợ tích hợp sẵn TranslateModule.
  • 🛠️ Cấu hình phong phú:
    • Hỗ trợ văn bản bên trái (labelLeft) và bên phải (labelRight).
    • Đánh dấu bắt buộc (required).
    • Hỗ trợ Tooltip (popover) với biểu tượng tùy chỉnh.
    • Tích hợp công tắc (hasToggle).
  • 🔘 Điều khiển linh hoạt:
    • Cho phép thêm mảng các nút bấm (IButton) vào bên trái, bên phải hoặc trong phần mô tả.
    • Xử lý các sự kiện click nút và chuyển đổi trạng thái công tắc.
  • 📝 Mô tả & Đếm số:
    • Hiển thị văn bản mô tả phụ bên dưới nhãn chính.
    • Tích hợp bộ đếm ký tự (countlimitLength) thường dùng cho các ô nhập liệu.

Cài đặt

Sử dụng npm hoặc yarn để cài đặt:

npm install @libs-ui/components-label

Cách sử dụng

Import Module

import { LibsUiComponentsLabelComponent } from '@libs-ui/components-label';

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

Ví dụ cơ bản

<libs_ui-components-label
  [labelLeft]="'Họ và tên'"
  [required]="true"
  [popover]="{ content: 'Vui lòng nhập đầy đủ tên tiếng Việt có dấu' }"></libs_ui-components-label>

Ví dụ nâng cao (Có Toggle và Buttons)

<libs_ui-components-label
  [labelLeft]="'Thông báo qua Email'"
  [hasToggle]="true"
  [toggleActive]="true"
  [buttonsRight]="[{ icon: 'libs-ui-icon-edit', key: 'edit' }]"
  [description]="'Gửi bản tin hàng tuần về các sản phẩm mới nhất.'"></libs_ui-components-label>

API Reference

Inputs

| Thuộc tính | Kiểu dữ liệu | Mặc định | Mô tả | | :----------------------------- | :----------- | :---------- | :---------------------------------------------------------- | | labelLeft | string | undefined | Văn bản nhãn bên trái. | | required | boolean | false | Hiển thị dấu sao đỏ đánh dấu bắt buộc. | | popover | IPopover | undefined | Cấu hình cho tooltip hiển thị khi hover vào icon thông tin. | | buttonsLeft / buttonsRight | IButton[] | [] | Danh sách các nút bấm ở hai bên nhãn. | | hasToggle | boolean | false | Hiển thị công tắc chuyển đổi (switch). | | toggleActive | boolean | false | Trạng thái của công tắc. | | description | string | undefined | Văn bản mô tả phía dưới nhãn. | | count | number | 0 | Số lượng ký tự hiện tại (để hiển thị bộ đếm). | | limitLength | number | 0 | Giới hạn ký tự tối đa. |

Outputs

| Sự kiện | Kiểu dữ liệu | Mô tả | | :------------------- | :------------- | :--------------------------------------------------------------- | | outClickButton | IButton | Phát ra khi người dùng click vào bất kỳ nút nào trong component. | | outSwitchEvent | ISwitchEvent | Phát ra khi trạng thái công tắc thay đổi. | | outLabelRightClick | boolean | Phát ra khi click vào phần văn bản bên phải. |

Tech Stack

  • Core: Angular 18+, Signals
  • Dependencies: @libs-ui/components-popover, @libs-ui/components-buttons-button, @libs-ui/components-switch.

License

MIT