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

v0.2.352-3

Published

## Giới thiệu

Readme

Button Status

Giới thiệu

@libs-ui/components-buttons-status là một component hiển thị trạng thái dưới dạng button, hỗ trợ nhiều kiểu màu khác nhau và tuỳ chỉnh thông tin popover.

Tính năng

  • Hiển thị nhãn và icon status (nếu cấu hình)
  • Hỗ trợ nhiều kiểu màu trạng thái qua input type (blue, green, red, orange, yellow, cyan, purple, brown, other)
  • Cho phép cấu hình màu và background riêng cho type other
  • Hỗ trợ popover cho icon bên trái hoặc phải qua popoverIconLeft/popoverIconRight
  • Tuỳ chỉnh CSS classes: classInclude, classLabelInclude, classIconLeft, classIconRight
  • Kích thước tự động phù hợp với nội dung

Cài đặt

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

hoặc

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

Sử dụng

Inline Template

import { Component } from '@angular/core';
import { LibsUiComponentsButtonsStatusComponent, IButtonStatus, TYPE_BUTTON_STATUS } from '@libs-ui/components-buttons-status';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [LibsUiComponentsButtonsStatusComponent],
  template: `
    <libs_ui-components-buttons-status [config]="statusConfig"></libs_ui-components-buttons-status>
  `,
})
export class ExampleComponent {
  statusConfig: IButtonStatus = {
    label: 'Đang hoạt động',
    type: 'green',
  };
}

File HTML riêng

import { Component } from '@angular/core';
import { LibsUiComponentsButtonsStatusComponent, IButtonStatus } from '@libs-ui/components-buttons-status';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [LibsUiComponentsButtonsStatusComponent],
  templateUrl: './example.component.html',
})
export class ExampleComponent {
  statusConfig: IButtonStatus = { label: 'Đang chờ', type: 'yellow' };
}
<libs_ui-components-buttons-status [config]="statusConfig"></libs_ui-components-buttons-status>

Công nghệ sử dụng

  • Angular 18 standalone component, Signals
  • Tailwind CSS 3.x

API Reference

Inputs

| Tên | Kiểu | Mặc định | Mô tả | | ------ | --------------- | -------- | ------------------------------------------------------------- | | config | IButtonStatus | required | Thông tin cấu hình cho trạng thái (nhãn, màu, icon, popover). |

Outputs

Không có

Interfaces

IButtonStatus

export interface IButtonStatus {
  label?: string;
  type: TYPE_BUTTON_STATUS;
  otherConfig?: {
    color: string;
    background?: string;
  };
  classInclude?: string;
  classLabelInclude?: string;
  classIconLeft?: string;
  popoverIconLeft?: IPopover;
  classIconRight?: string;
  popoverIconRight?: IPopover;
}

Mô tả:

  • label: Nhãn hiển thị của trạng thái.
  • type: Kiểu màu/trạng thái (TYPE_BUTTON_STATUS).
  • otherConfig: Cấu hình màu chữ và nền khi typeother.
  • classInclude: CSS class thêm cho container của status.
  • classLabelInclude: CSS class thêm cho nhãn.
  • classIconLeft: CSS class thêm cho icon bên trái.
  • popoverIconLeft: Cấu hình popover cho icon bên trái.
  • classIconRight: CSS class thêm cho icon bên phải.
  • popoverIconRight: Cấu hình popover cho icon bên phải.

TYPE_BUTTON_STATUS

export type TYPE_BUTTON_STATUS = 'blue' | 'green' | 'red' | 'orange' | 'yellow' | 'cyan' | 'purple' | 'brown' | 'other';

Mô tả:

  • blue: Màu xanh dương (thông tin chung).
  • green: Màu xanh lá cây (thành công).
  • red: Màu đỏ (lỗi hoặc cảnh báo).
  • orange: Màu cam (cảnh báo).
  • yellow: Màu vàng (đang chờ, thông tin).
  • cyan: Màu xanh da trời (thông tin phụ trợ).
  • purple: Màu tím (nhấn mạnh, nổi bật).
  • brown: Màu nâu (trung tính).
  • other: Chủ đề tuỳ chỉnh; cấu hình qua otherConfig.