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

fn-label

v0.0.16

Published

`FNLabel` is a reusable Angular standalone component library for rendering labels with optional translation support using **@ngx-translate/core**.

Downloads

149

Readme

FNLabel

FNLabel is a reusable Angular standalone component library for rendering labels with optional translation support using @ngx-translate/core.


📦 Installation

Install the library in your Angular project:

npm install fn-label

🛠️ Required Dependencies

This component internally uses @ngx-translate/core for label translations. Therefore, the host application must install the following packages:

npm install @ngx-translate/core @ngx-translate/http-loader

⚙️ Configuration

Add the translation configuration in your main.ts or app.config.ts.

import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import { importProvidersFrom } from '@angular/core';
import { provideHttpClient } from '@angular/common/http';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpClient } from '@angular/common/http';

export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

bootstrapApplication(AppComponent, {
  providers: [
    provideHttpClient(),
    importProvidersFrom(
      TranslateModule.forRoot({
        loader: {
          provide: TranslateLoader,
          useFactory: HttpLoaderFactory,
          deps: [HttpClient],
        },
      })
    ),
  ],
});

[!CAUTION] If the translation module is not configured, Angular will throw: NullInjectorError: No provider for TranslateService


🚀 Usage

Use the component in your template:

<fn-label label="FORM.NAME" [required]="true"></fn-label>

Example Translation File (src/assets/i18n/en.json)

{
  "FORM": {
    "NAME": "Name"
  }
}

📄 Component Inputs

| Input | Type | Default | Description | | :--- | :--- | :--- | :--- | | label | string | '' | Label text or translation key. Supports :: delimiter for multiple keys. | | required | boolean | true | Displays optional indicator if set to false. | | className | string | '' | Custom CSS classes to apply to the label. | | variant | string | 'p1' | Typography variant (e.g., h1, h2, p1, p1Bold). | | statusLabel| string | undefined| Status style (e.g., Success, Warning, Hot). | | color | string | '' | Custom color (hex, rgb, or CSS variable). | | hideOptional | boolean | false | Force hide the (Optional) indicator. | | for | string | '' | The for attribute for the label. | | field | FNLabelProps| undefined| Full configuration object for the label. |