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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tailwind-forms

v1.0.6

Published

Tailwind CSS plugin to add better form styling with unlimited customization

Downloads

515

Readme

Tailwind Forms

HEAVILY inspired by Adam Wathan's Tailwind Form Styles

Installation

npm install tailwind-forms

Configuration

// tailwind.config.js
{
  theme: {
    ...
  },
  plugins: [
    require('tailwind-forms')(),
  ],
}

There are currently no options available. You can customize everything by stacking core utility classes.

Usage

Text Input

<label class="block">
  <span class="text-gray-700">Name</span>
  <input type="email" class="form-input mt-1 block w-full" placeholder="John Appleseed"/>
</label>

Textarea

<label class="block">
  <span class="text-gray-700">Textarea</span>
  <textarea class="form-textarea mt-1 block w-full" rows="3" placeholder="Enter some long form content."></textarea>
</label>

Select

<label class="block">
  <span class="text-gray-700">Select</span>
  <select class="form-select block w-full mt-1">
    <option>Option 1</option>
    <option>Option 2</option>
  </select>
</label>

Select Multiple

<label class="block">
  <span class="text-gray-700">Multiselect</span>
  <select class="form-multiselect block w-full mt-1" multiple>
    <option>Option 1</option>
    <option>Option 2</option>
    <option>Option 3</option>
    <option>Option 4</option>
    <option>Option 5</option>
  </select>
</label>

Checkbox

<div class="block">
  <span class="text-gray-700">Checkboxes</span>
  <div class="mt-2">
    <div>
      <label class="inline-flex items-center">
        <input type="checkbox" class="sr-only" checked/>
        <span class="form-checkbox text-blue-400" aria-hidden="true"></span>
        <span class="ml-2">Option 1</span>
      </label>
    </div>
    <div>
      <label class="inline-flex items-center">
        <input type="checkbox" class="sr-only"/>
        <span class="form-checkbox text-blue-400" aria-hidden="true"></span>
        <span class="ml-2">Option 2</span>
      </label>
    </div>
    <div>
      <label class="inline-flex items-center">
        <input type="checkbox" class="sr-only"/>
        <span class="form-checkbox text-blue-400" aria-hidden="true"></span>
        <span class="ml-2">Option 3</span>
      </label>
    </div>
  </div>
</div>

Changing the clicked background color

<div class="block">
  <span class="text-gray-700">Checkboxes</span>
  <div class="mt-2">
    <div>
      <label class="inline-flex items-center">
        <input type="checkbox" class="sr-only" checked/>
        <span class="form-checkbox text-indigo-600" aria-hidden="true"></span>
        <span class="ml-2">Option 1</span>
      </label>
    </div>
    <div>
      <label class="inline-flex items-center">
        <input type="checkbox" class="sr-only" checked/>
        <span class="form-checkbox text-blue-500" aria-hidden="true"></span>
        <span class="ml-2">Option 2</span>
      </label>
    </div>
    <div>
      <label class="inline-flex items-center">
        <input type="checkbox" class="sr-only" checked/>
        <span class="form-checkbox text-pink-600" aria-hidden="true"></span>
        <span class="ml-2">Option 3</span>
      </label>
    </div>
  </div>
</div>

Radio Button

<div class="block">
  <span class="text-gray-700">Radio Buttons</span>
  <div class="mt-2">
    <div>
      <label class="inline-flex items-center">
        <input type="radio" class="sr-only" name="radio" value="1" checked/>
        <span class="form-radio text-blue-400" aria-hidden="true"></span>
        <span class="ml-2">Option 1</span>
      </label>
    </div>
    <div>
      <label class="inline-flex items-center">
        <input type="radio" class="sr-only" name="radio" value="2"/>
        <span class="form-radio text-blue-400" aria-hidden="true"></span>
        <span class="ml-2">Option 2</span>
      </label>
    </div>
    <div>
      <label class="inline-flex items-center">
        <input type="radio" class="sr-only" name="radio" value="3"/>
        <span class="form-radio text-blue-400" aria-hidden="true"></span>
        <span class="ml-2">Option 3</span>
      </label>
    </div>
  </div>
</div>

Changing the checked background color

<div class="block">
  <span class="text-gray-700">Radio Buttons</span>
  <div class="mt-2">
    <div>
      <label class="inline-flex items-center">
        <input type="radio" class="sr-only" name="radio-colors" value="1" checked/>
        <span class="form-radio text-indigo-600" aria-hidden="true"></span>
        <span class="ml-2">Option 1</span>
      </label>
    </div>
    <div>
      <label class="inline-flex items-center">
        <input type="radio" class="sr-only" name="radio-colors" value="2"/>
        <span class="form-radio text-blue-500" aria-hidden="true"></span>
        <span class="ml-2">Option 2</span>
      </label>
    </div>
    <div>
      <label class="inline-flex items-center">
        <input type="radio" class="sr-only" name="radio-colors" value="3"/>
        <span class="form-radio text-pink-600" aria-hidden="true"></span>
        <span class="ml-2">Option 3</span>
      </label>
    </div>
  </div>
</div>

Input Groups

<!-- Button Right -->
<div class="form-input-group w-1/2 mx-auto mb-4 relative">
  <input type="text" class="form-input form-input-group-left relative" placeholder="Username">
  <div class="form-input-group-right">
    <button class="bg-blue-600 text-white px-6 hover:bg-blue-500">Submit</button>
  </div>	
</div>
  
<!--  Text Right  -->
<div class="form-input-group w-1/2 mx-auto mb-4 relative">
  <input type="text" class="form-input form-input-group-left relative" placeholder="john_doe">
  <div class="form-input-group-right">
    <span class="bg-gray-300 text-gray-600">@example.com</span>
  </div>	
</div>
  
<!--  Button Left  -->
<div class="form-input-group w-1/2 mx-auto mb-4 relative">
  <div class="form-input-group-left">
    <button class="bg-blue-600 text-white px-6 hover:bg-blue-500">Submit</button>
  </div>
  <input type="text" class="form-input form-input-group-right" placeholder="Username">
</div>
  
<!--  Text Left  -->
<div class="form-input-group w-1/2 mx-auto mb-4 relative">
  <div class="form-input-group-left">
    <span class="bg-gray-300 text-gray-600">@</span>
  </div>
  <input type="text" class="form-input form-input-group-right" placeholder="Username">
</div>