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

@fvc/label

v1.0.3

Published

`@fvc/label` provides a form label primitive for FE-VIS applications. It handles required indicators, disabled styling, inline error display, and rendering as any HTML element — covering the full range of label use cases in a form system without requiring

Downloads

2,372

Readme

@fvc/label

@fvc/label provides a form label primitive for FE-VIS applications. It handles required indicators, disabled styling, inline error display, and rendering as any HTML element — covering the full range of label use cases in a form system without requiring additional wrapper components.

Installation

bun add @fvc/label

Peer Dependencies

bun add react antd

Import

import { Label } from '@fvc/label';

Quick Start

import { Label } from '@fvc/label';

export function EmailField() {
  return (
    <>
      <Label htmlFor="email" required>
        Email address
      </Label>
      <input id="email" type="email" />
    </>
  );
}

States

| State | Prop | Visual effect | | --- | --- | --- | | Default | — | Black text (--black-1000), 14px Roboto medium | | Required | required | Appends * after the label text | | Disabled | disabled | Muted colour (--blue-gray-300), not-allowed cursor | | Error | error="message" | Replaces children with the error string; red text (--warning-text-color-800) |

Common Usage

Required field

<Label htmlFor="name" required>Full name</Label>

Disabled

<Label htmlFor="name" disabled>Full name</Label>

Error state

error replaces children. The same element serves as both the label and the inline error message — no separate error component needed.

<Label htmlFor="email" error="Enter a valid email address" />

Combined required and error

<Label htmlFor="email" required error="This field is required" />

Custom element type

When the label is not semantically a <label> element, pass elementType. The htmlFor attribute is omitted automatically when elementType is not 'label'.

<Label elementType="span">Section heading</Label>
<Label elementType="p">Description text</Label>

Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | children | ReactNode | — | Label text. Replaced by error when error is provided. | | htmlFor | string | — | Native htmlFor attribute. Only applied when elementType is 'label'. | | for | string | — | Alias for htmlFor. | | required | boolean | false | Appends a * indicator after the content. | | disabled | boolean | false | Applies disabled styling. | | error | string | — | Replaces children and applies error colour when set. | | elementType | ElementType | 'label' | Renders the label as any HTML or React element. | | testId | string | — | Maps to data-testid. | | className | string | — | Additional CSS class names. |

All standard HTMLAttributes<HTMLElement> are accepted and forwarded to the root element.

Consumer Example

import { Label } from '@fvc/label';
import { Input } from 'antd';
import { ReactNode } from 'react';

interface FormFieldProps {
  id: string;
  label: string;
  required?: boolean;
  disabled?: boolean;
  error?: string;
  children: ReactNode;
}

export function FormField({
  id,
  label,
  required,
  disabled,
  error,
  children,
}: FormFieldProps) {
  return (
    <div>
      <Label htmlFor={id} required={required} disabled={disabled} error={error}>
        {label}
      </Label>
      {children}
    </div>
  );
}

Testing

Use testId when a stable test selector is needed.

<Label testId="email-label" htmlFor="email">Email address</Label>
screen.getByTestId('email-label');

CSS Classes

| Class | Applied when | | --- | --- | | .fvc-label | Always — base class | | .fvc-label-error | error prop is a non-empty string | | .fvc-label-disabled | disabled is true |

Customisation

@fvc/label exposes a CSS-customisation API via CSS custom properties declared in variables.scss. Override any variable in your own stylesheet to re-style the component without touching source or shipping a fork.

:root {
  --label-default-color: #1a1a2e;
  --label-error-color: #dc2626;
  --label-disabled-color: #94a3b8;
  --label-md-size-fz: 13px;
  --label-font-family: 'Inter', sans-serif;
}

Variables

| Variable | Default | Description | | --- | --- | --- | | --label-font-family | 'Roboto', sans-serif | Font family for all label states | | --label-md-size-fz | 14px | Font size | | --label-md-size-fw | 500 | Font weight | | --label-md-size-lh | 16px | Line height | | --label-md-size-margin | 6px | Bottom margin (space between label and the field below) | | --label-default-color | var(--black-1000) | Text color in the default state | | --label-error-color | var(--warning-text-color-800) | Text color in the error state | | --label-disabled-color | var(--blue-gray-300) | Text color in the disabled state |

Development

bun run lint
bun run type-check
bun run test