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

@phila/phila-ui-text-field

v1.2.1

Published

A text field is a versatile component that allows users to input text. In a search context, it enables users to enter keywords or phrases to find specific content

Readme

Phila TextField Component

Status: Stable

A text input with an optional label, leading/trailing icons, a built-in clear button, supporting text, and error messaging. Supports both v-model (controlled) and uncontrolled use, plus optional input masking via imaskProps.

Features

  • 🎨 Customizable label, placeholder, and supporting text
  • 🔄 Optional leading and trailing icons
  • 🧹 Built-in clear button (icon-only) when input has content
  • 📏 Dynamic error handling with customizable messages
  • ♿ Accessibility features: focus states, disabled state

Installation

pnpm add @phila/phila-ui-text-field @phila/phila-ui-core @phila/phila-ui-button
# or
npm install @phila/phila-ui-text-field @phila/phila-ui-core @phila/phila-ui-button

Import core styles in your main entry file (e.g., main.js|ts):

import "@phila/phila-ui-core/styles/template-light.css";

Usage

Use the TextField component with the appropriate props. You can customize the label, placeholder, icons, and error messages.

<script setup lang="ts">
import { ref } from "vue";
import { TextField } from "@phila/phila-ui-text-field";
import { IconMagnifyingGlass, IconPhone } from "@phila/phila-ui-core/icons";

const name = ref("");
</script>

<template>
  <TextField
    v-model="name"
    label="Your Name"
    placeholder="Enter your name"
    supporting-text="This is a required field"
    :leading-icon="IconMagnifyingGlass"
    :trailing-icon="IconPhone"
    :error="['Name is required']"
    required
  />
</template>

Masked input

Pass an imask mask via imaskProps to constrain/format input as the user types (e.g. a phone number), and listen for complete when the mask is fully satisfied:

<TextField label="Phone" :imask-props="{ mask: '(000) 000-0000' }" @complete="onComplete" />

Props

| Prop | Type | Default | Description | | ---------------- | ------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | modelValue | string | undefined | Bound value (v-model). Works uncontrolled too — omit it and the field manages its own value internally. | | label | string | "" | Label text for the input field | | placeholder | string | "" | Placeholder text when the input is empty | | supportingText | string | "" | Helper text shown below the input | | leadingIcon | IconComponent | undefined | Icon shown before the input, from @phila/phila-ui-core/icons. | | trailingIcon | IconComponent | undefined | Icon shown after the input, from @phila/phila-ui-core/icons. | | error | string \| string[] | [] | Error message(s). Only the first is displayed, even if an array with several entries is passed. | | imaskProps | Record<string, unknown> | undefined | imask options (e.g. { mask: '(000) 000-0000' }). A mask key switches to a masked input and enables the complete event. | | id | string | auto-generated | ID for the input element | | className | string | "" | Additional CSS classes | | disabled | boolean | false | Not a declared prop — passed through as a native HTML attribute and detected via useAttrs() for styling. | | required | boolean | false | Same as disabled — a native attribute, not a declared prop. |

Note: The TextField component automatically displays a clear button (icon-only Button component) when the input has content.

Slots

| Slot | Description | | ----------------- | -------------------------------------------------------------------------- | | trailing-action | Extra content after the trailing icon/clear button (e.g. a custom action). |

Events

| Event | Payload | Description | | ------------------- | -------- | ------------------------------------------------------------------------------------- | | update:modelValue | string | Emitted on input, for v-model. | | complete | string | Masked input only (imaskProps.mask set) — emitted when the mask is fully satisfied. |

Exposed

Access via a template ref on TextField:

| Property | Type | Description | | ---------- | ------------------------------- | ---------------------------------------- | | inputRef | Ref<HTMLInputElement \| null> | The underlying native <input> element. |

Development

Install Dependencies

pnpm install

Run Demo

pnpm dev

Run lint

pnpm lint

Create Production Build

pnpm build

Test locally in your development environment

npm pack
cp ./dist/*.tgz ~/path/to/your/local/npm/repo
cd ~/path/to/your/local/npm/repo
npm install *.tgz

Publishing to NPM

Follow the release instructions using changesets.

License

MIT