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

v0.2.356-1

Published

> Version: `0.2.355-14` > > Component hiển thị status dạng pill, hỗ trợ icon trái/phải, translate label và tuỳ biến màu theo type hoặc `otherConfig`.

Readme

Buttons Status Component

Version: 0.2.355-14

Component hiển thị status dạng pill, hỗ trợ icon trái/phải, translate label và tuỳ biến màu theo type hoặc otherConfig.

Giới thiệu

LibsUiComponentsButtonsStatusComponent là standalone Angular component để hiển thị trạng thái ngắn gọn (pill/badge) trong UI. Component nhận một object cấu hình config để quyết định label, type màu, icon và popover cho icon.

Tính năng

  • ✅ Hiển thị status dạng pill gọn nhẹ
  • ✅ Hỗ trợ nhiều type màu: blue/green/red/orange/yellow/cyan/purple/brown
  • ✅ Tuỳ biến màu với type other + otherConfig
  • ✅ Hỗ trợ icon trái/phải qua classIconLeft / classIconRight
  • ✅ Hỗ trợ popover cho icon (thông qua IPopover)
  • ✅ Translate label qua @ngx-translate/core
  • ✅ OnPush Change Detection
  • ✅ Angular Signals

Cài đặt

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

Import

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

@Component({
  standalone: true,
  imports: [LibsUiComponentsButtonsStatusComponent],
  template: '',
})
export class ExampleComponent {}

Cách sử dụng

1. Ví dụ inline template

<libs_ui-components-buttons-status
  [config]="statusConfig"
/>
import { Component } from '@angular/core';
import { LibsUiComponentsButtonsStatusComponent, IButtonStatus } from '@libs-ui/components-buttons-status';

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

2. Ví dụ với file HTML riêng

example.component.html

<libs_ui-components-buttons-status [config]="config" />

example.component.ts

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

@Component({
  standalone: true,
  imports: [LibsUiComponentsButtonsStatusComponent],
  templateUrl: './example.component.html',
})
export class HtmlFileExampleComponent {
  readonly config: IButtonStatus = {
    label: 'Custom',
    type: 'other',
    otherConfig: {
      color: '#0ea5e9',
      background: '#e0f2fe',
    },
    classIconLeft: 'libs-ui-icon-info-circle',
    classIconRight: 'libs-ui-icon-chevron-right',
  };
}

Công nghệ

| Technology | Version | Purpose | |------------|---------|---------| | Angular | 18+ | Framework | | Angular Signals | - | State management | | TailwindCSS | 3.x | Styling (demo) | | OnPush | - | Change Detection | | ngx-translate | 15+ | Translate label |

API

libs_ui-components-buttons-status

Inputs

| Property | Type | Default | Description | |----------|------|---------|-------------| | [config] | IButtonStatus | required | Cấu hình hiển thị status: label/type/icon/popover/classes... |

Outputs

Component này hiện không có outputs public.

Types & Interfaces

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;
}

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

Mô tả Types

  • IButtonStatus: Interface cấu hình status: label, type, tuỳ biến màu (otherConfig) và icon/popover.
  • TYPE_BUTTON_STATUS: Danh sách type status có sẵn. Dùng other + otherConfig khi cần màu tuỳ biến.

Demo

npx nx serve core-ui

Truy cập: http://localhost:4500/buttons/status