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 🙏

© 2025 – Pkg Stats / Ryan Hefner

yc-input-component

v2.0.2

Published

An Input component coded by Yuri Cruger

Downloads

23

Readme

Input React Component

Installation

To install the component, use the following command:

npm i yc-input-component

This component depends on Tailwind CSS and tailwind-merge. Make sure both are installed in your project.

After installation, manually move the input.tsx file to your project's components folder. You can do this manually or use the following command:

cp node_modules/yc-input-component/src/input.tsx /*your/folder/components*/

Usage Example

Here is a simple example of how to use the component:

<Input.Root>
  <Input.FormField
    value={emailValue}
    hasError={!!errors.email?.message}
    initialBorderColor="white"
    focusedBorderColor="sky"
    {...register("email")}
  />

  <Input.Label
    label="Email"
    hasInputValue={emailValue !== ""}
    hasError={!!errors.email?.message}
    bgColor="zinc"
    initialTextColor="gray"
    focusedTextColor="sky"
  />

  <Input.ButtonIcon>
    <Mail color="#fff" size={18} />
  </Input.ButtonIcon>

  <Input.ErrorMessage errorMessage={emailErrorMessage} />
</Input.Root>

Input.FormField Props

  • value: The value of the input (string).
  • initialBorderColor: The initial border color of the input.
  • focusedBorderColor: The border color when the input is focused.
  • hasError (optional): Indicates whether there is a validation error in the input (boolean).

Input.Label Props

  • label: The text of the label (string).
  • hasInputValue: Indicates whether the input has a value (boolean).
  • bgColor: The background color of the label (should match the background color of the parent element).
  • initialTextColor: The initial text color of the label.
  • focusedTextColor: The text color of the label when the input is focused.
  • hasError (optional): Indicates whether there is a validation error in the input (boolean).

Input.ButtonIcon

  • The ButtonIcon should receive a children of type ReactNode.

Input.ErrorMessage Props

  • errorMessage: The error message (string).

Notes

  • All components accept the className property, allowing you to apply Tailwind CSS classes to customize the style as needed.
  • If you want to add a new color type to the component, such as a new focus color or initial color for the Input or Label, this must be done manually. You need to add the new color to the type definition and include the desired styles in the variants.
// Example

// 1. Add the color "blue" to the existing type:
focusedTextColor: "sky" | "blue";

// 2. Define the styles for the new "blue" color in the variants:
const focusedTextColorVariants = {
  sky: {
    default: "text-sky-600",
    peer_focus: "peer-focus:text-sky-600",
  },
  blue: {
    default: "text-blue-600",
    peer_focus: "peer-focus:text-blue-600",
  },
};