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-buttons-group

v0.2.352-3

Published

## Giới thiệu

Readme

Button Group

Giới thiệu

@libs-ui/components-buttons-group là một component nhóm Button cho Angular, cho phép hiển thị nhiều nút theo hàng, hỗ trợ quản lý trạng thái active và disable cho toàn nhóm.

Tính năng

  • Hiển thị danh sách nút theo hàng ngang
  • Hỗ trợ two-way binding cho chỉ số nút đang active (indexActive)
  • Emit sự kiện khi thay đổi nút active (outChange)
  • Hỗ trợ disable toàn bộ nhóm nút
  • Tích hợp popover control event (outFunctionsControl)

Cài đặt

npm install @libs-ui/components-buttons-group

hoặc

yarn add @libs-ui/components-buttons-group

Sử dụng

Inline Template

import { Component } from '@angular/core';
import { LibsUiComponentsButtonsGroupComponent } from '@libs-ui/components-buttons-group';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [LibsUiComponentsButtonsGroupComponent],
  template: `
    <libs_ui-components-buttons-group
      [buttons]="buttons"
      [(indexActive)]="activeIndex"
      (outChange)="onChange($event)"></libs_ui-components-buttons-group>
  `,
})
export class ExampleComponent {
  buttons = [
    { key: '1', label: 'Option 1' },
    { key: '2', label: 'Option 2' },
    { key: '3', label: 'Option 3' },
  ];
  activeIndex = 0;
  onChange(button: any) {
    console.log('Changed:', button);
  }
}

File HTML riêng

import { Component } from '@angular/core';
import { LibsUiComponentsButtonsGroupComponent } from '@libs-ui/components-buttons-group';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [LibsUiComponentsButtonsGroupComponent],
  templateUrl: './example.component.html',
})
export class ExampleComponent {
  buttons = [
    /* ... */
  ];
  activeIndex = 0;
  onChange(button: any) {}
}
<libs_ui-components-buttons-group
  [buttons]="buttons"
  [(indexActive)]="activeIndex"
  (outChange)="onChange($event)"></libs_ui-components-buttons-group>

Công nghệ sử dụng

  • Angular 18 với standalone components và Signals
  • Tailwind CSS 3.x (phong cách demo)

API Reference

Inputs

| Tên | Kiểu | Mặc định | Mô tả | | ----------- | ---------------- | -------- | --------------------------------------- | | buttons | Array<IButton> | required | Mảng các nút sẽ hiển thị trong nhóm. | | indexActive | number | 0 | Chỉ số của nút đang được chọn (từ 0). | | disable | boolean | false | Nếu true: vô hiệu hóa toàn bộ nhóm nút. |

Outputs

| Tên | Kiểu | Mô tả | | ------------------- | ------------------------------ | ----------------------------------- | | outChange | (button: IButton) => void | Trả về nút vừa được chọn. | | outFunctionsControl | IPopoverFunctionControlEvent | Cung cấp API để điều khiển popover. |

Interfaces

IButton

| Property | Type | Required | Description | | -------------- | ------------------ | -------- | ----------------------------------------------- | | key | string | no | Khóa định danh của nút (unique). | | type | TYPE_BUTTON | no | Kiểu giao diện của nút (primary, secondary...). | | sizeButton | TYPE_SIZE_BUTTON | no | Kích thước của nút (nhỏ, trung, lớn). | | iconOnlyType | boolean | no | Nếu true: chỉ hiện icon, không hiện nhãn. | | label | string | no | Văn bản hiển thị trên nút. | | disable | boolean | no | Vô hiệu hóa nút khi true. | | classInclude | string | no | Class CSS thêm cho container của nút. | | classIconLeft | string | no | Class CSS thêm cho icon bên trái. | | classIconRight | string | no | Class CSS thêm cho icon bên phải. | | classLabel | string | no | Class CSS thêm cho nhãn. | | popover | IPopover | no | Cấu hình popover cho nút (nếu cần). |

IPopoverFunctionControlEvent

| Property | Type | Required | Description | | -------- | ---- | -------- | --------------------------------------------------- | | ... | ... | ... | Xem @libs-ui/components-popover để biết chi tiết. |