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

@mfp-design-system/form-field

v7.0.0

Published

FormField wrapper providing label/hint/error around an arbitrary control.

Readme

@mfp-design-system/form-field

A Lit-based <mfp-form-field> wrapper that provides label, hint, error, and required-indicator around an arbitrary form control.

When to use this

Use <mfp-form-field> when the control inside doesn't ship its own label — most often:

  • A bare <input type="checkbox"> or <input type="radio">
  • A <textarea>
  • A native <input type="date"> (or any other native input you want to pair with a label)
  • A custom control or third-party widget

Components like <mfp-input> and <mfp-select> already have built-in label, hint, and error props, so you typically don't need a FormField around them. Use it if you want one consistent composition style across every row of a form.

Install

npm install @mfp-design-system/form-field @mfp-design-system/tokens

Usage

import '@mfp-design-system/form-field';
import '@mfp-design-system/tokens/css';
<mfp-form-field label="Subscribe" hint="We'll email twice a week." orientation="horizontal">
    <input type="checkbox" />
</mfp-form-field>

<mfp-form-field label="Birthday" required error="Please pick a date.">
    <input type="date" />
</mfp-form-field>

<mfp-form-field label="Notification preference" required>
    <div role="radiogroup">
        <label><input type="radio" name="notify" value="email" /> Email</label>
        <label><input type="radio" name="notify" value="sms" /> SMS</label>
    </div>
</mfp-form-field>

The wrapper automatically wires:

  • for/id association between its label and the first slotted control (the control's id is set to a generated value if missing)
  • aria-describedby on the control pointing at the hint or error
  • aria-invalid on the control when an error is present

API

| Attribute | Type | Default | Description | | ------------- | ---------------------------- | ------------ | ------------------------------------------------------------------------------------------- | | label | string | '' | Visible label | | hint | string | '' | Helper text shown below | | error | string | '' | Error message — also sets aria-invalid on the slotted control | | required | boolean | false | Adds a red * to the label | | orientation | 'vertical' \| 'horizontal' | 'vertical' | horizontal puts the control to the left of the label (useful for checkboxes and switches) |

Shadow parts

label, control, hint, error.

Framework notes

Same as the rest of the suite — Vue/Nuxt need isCustomElement, Angular needs CUSTOM_ELEMENTS_SCHEMA.