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

react-input-styles

v0.1.5

Published

Opinionated React input components with multiple ready-to-use visual styles.

Readme

React Input Styles

一个基于 TypeScript + React 的输入框样式组件库,封装了多种可复用的输入框风格,帮助你在项目中快速切换不同风格的输入体验。

功能特性

  • 🎨 四种常用的输入框视觉风格(经典边框 / 浮动标签 / 拟物 / 荧光胶囊)。
  • ♻️ 统一的 InputProps API,可随时互换不同样式。
  • ⚙️ 基础逻辑集中在 InputBase,包含聚焦、禁用、受控/非受控处理。
  • 🧩 支持前后缀图标、状态提示、Label、className 等扩展。
  • 🛠️ 采用 tsup 输出 CommonJS + ESM + 类型声明,方便发布到 npm。

目录结构

src/
├─ components/
│  └─ InputBase.tsx        # 统一的输入逻辑
├─ page/
│  ├─ page1/               # 经典边框风格
│  ├─ page2/               # 浮动标签风格
│  ├─ page3/               # 拟物柔光风格
│  └─ page4/               # 荧光胶囊风格
└─ index.ts                # 导出入口

每个 pageX 目录都包含 index.tsxstyle.css,方便独立维护样式。

安装依赖

npm install

开发 & 构建

npm run dev    # tsup watch 模式
npm run build  # 生成 dist(cjs + esm + d.ts)
npm run lint   # 类型检查

使用方式

重要:需要手动导入样式文件!

import { Page1Input, Page2Input } from 'react-input-styles';
// 导入样式(必须)
import 'react-input-styles/styles.css';

export function Demo() {
  return (
    <div>
      <Page1Input placeholder="请输入用户名" status="success" />
      <Page2Input label="邮箱" status="error" />
    </div>
  );
}

InputProps 统一具备以下能力:

  • value / defaultValue / onChange
  • status?: 'default' | 'error' | 'success'
  • prefixIcon / suffixIcon
  • label, className, containerClassName
  • 与原生 <input /> 一样的其余属性(例如 type="password"

发布

构建完成后即可通过 npm publish --access public 发布。也欢迎在现有样式的基础上继续扩展更多 pageX 输入风格。