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

@darksnow-ui/input

v1.0.0

Published

Input component for DarkSnow UI

Downloads

7

Readme

@darksnow-ui/input

A flexible and customizable Input component for React applications.

Installation

pnpm add @darksnow-ui/input

Usage

import { Input } from "@darksnow-ui/input"
import "@darksnow-ui/input/styles.css"

function App() {
  return <Input placeholder="Enter your email" variant="default" size="md" />
}

Props

| Prop | Type | Default | Description | | --------- | ----------------------------------- | ----------- | --------------------------------------- | | variant | 'default' \| 'error' \| 'success' | 'default' | Visual variant of the input | | size | 'sm' \| 'md' \| 'lg' | 'md' | Size of the input | | leftIcon | ReactNode | - | Icon to display on the left side | | rightIcon | ReactNode | - | Icon to display on the right side | | isLoading | boolean | false | Whether the input is in a loading state | | focusRing | boolean | true | Whether to show focus ring | | ...props | InputHTMLAttributes | - | All native input attributes |

Examples

Basic Usage

<Input type="email" placeholder="Email" />

With Label

import { Label } from "@darksnow-ui/label"

<div className="grid w-full max-w-sm items-center gap-1.5">
  <Label htmlFor="email">Email</Label>
  <Input type="email" id="email" placeholder="Email" />
</div>

With Icons

import { Input } from '@darksnow-ui/input'
import { Search, Mail } from 'lucide-react'

// Left icon
<Input
  leftIcon={<Search size={16} />}
  placeholder="Search..."
/>

// Right icon
<Input
  rightIcon={<Mail size={16} />}
  placeholder="Email"
  type="email"
/>

Variants

// Default
<Input variant="default" placeholder="Default input" />

// Error
<Input variant="error" placeholder="Error state" />

// Success
<Input variant="success" placeholder="Success state" />

Sizes

<Input size="sm" placeholder="Small input" />
<Input size="md" placeholder="Medium input" />
<Input size="lg" placeholder="Large input" />

States

// Disabled
<Input disabled type="email" placeholder="Email" />

// Loading
<Input isLoading placeholder="Loading..." />

// Without focus ring
<Input focusRing={false} placeholder="No focus ring" />

Input Types

<div className="space-y-4">
  <div>
    <Label htmlFor="text">Text</Label>
    <Input id="text" type="text" placeholder="Enter text" />
  </div>
  
  <div>
    <Label htmlFor="password">Password</Label>
    <Input id="password" type="password" placeholder="Enter password" />
  </div>
  
  <div>
    <Label htmlFor="number">Number</Label>
    <Input id="number" type="number" placeholder="Enter number" />
  </div>
  
  <div>
    <Label htmlFor="date">Date</Label>
    <Input id="date" type="date" />
  </div>
  
  <div>
    <Label htmlFor="time">Time</Label>
    <Input id="time" type="time" />
  </div>
  
  <div>
    <Label htmlFor="file">File</Label>
    <Input id="file" type="file" />
  </div>
</div>

With Button

import { Button } from "@darksnow-ui/button"

<div className="flex w-full max-w-sm items-center space-x-2">
  <Input type="email" placeholder="Email" />
  <Button type="submit">Subscribe</Button>
</div>

Form Example

import { Button } from "@darksnow-ui/button"
import { Label } from "@darksnow-ui/label"

<form className="space-y-4 max-w-sm">
  <div>
    <Label htmlFor="name">Full Name</Label>
    <Input 
      id="name" 
      type="text" 
      placeholder="John Doe" 
      required 
    />
  </div>
  
  <div>
    <Label htmlFor="email">Email</Label>
    <Input 
      id="email" 
      type="email" 
      placeholder="[email protected]" 
      required 
    />
  </div>
  
  <div>
    <Label htmlFor="phone">Phone</Label>
    <Input 
      id="phone" 
      type="tel" 
      placeholder="+1 (555) 123-4567"
      leftIcon={<Phone size={16} />}
    />
  </div>
  
  <Button type="submit" className="w-full">
    Submit
  </Button>
</form>

Search Input

import { Search, X } from "lucide-react"

<div className="relative">
  <Input
    type="search"
    placeholder="Search..."
    leftIcon={<Search size={16} />}
    rightIcon={<X size={16} />}
    className="pr-10"
  />
</div>

CSS Variables

You can customize the appearance using CSS variables:

:root {
  --darksnow-input-border: #e5e7eb;
  --darksnow-input-bg: #ffffff;
  --darksnow-input-color: #111827;
  --darksnow-input-border-hover: #d1d5db;
  --darksnow-input-border-focus: #3b82f6;
  --darksnow-input-focus-ring: rgba(59, 130, 246, 0.15);
  --darksnow-input-placeholder: #9ca3af;
  --darksnow-input-icon-color: #6b7280;
  --darksnow-input-radius: 0.375rem;

  /* Error variant */
  --darksnow-input-error-border: #ef4444;
  --darksnow-input-error-border-hover: #dc2626;
  --darksnow-input-error-focus-ring: rgba(239, 68, 68, 0.15);

  /* Success variant */
  --darksnow-input-success-border: #10b981;
  --darksnow-input-success-border-hover: #059669;
  --darksnow-input-success-focus-ring: rgba(16, 185, 129, 0.15);
}