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-elements

v0.2.0

Published

Reusable DOM elements built with Tailwind CSS.

Downloads

86

Readme

Tailwind Elements

npm version build status downloads js-standard-style

DOM elements built with Tailwind CSS using bel. Work in progress.

Install

$ npm i tailwind-elements
// or
$ yarn add tailwind-elements

Elements

Use elements by importing them accordingly like require('tailwind-elements/$element').

header(title, subtitle)

Simple title with optional subtitle.

input(attributes)

Form input element.

Params

  • attributes.type: {String} Input type.
  • attributes.name: {String} Input name.
  • attributes.placeholder: {String} Input placeholder.
  • attributes.value: Input value.
  • attributes.onChange: {Function} Input value change listener.
  • attributes.required: {Boolean} Whether input is required or not.
  • attributes.className: {String} Additional css classes.

textarea(attributes)

Form textarea element.

Params

  • attributes.name: {String} Input name.
  • attributes.placeholder: {String} Input placeholder.
  • attributes.value: Input value.
  • attributes.onChange: {Function} Input value change listener.
  • attributes.className: {String} Additional css classes.

select(attributes)

Select element.

Params

  • attributes.name: {String} Input name.
  • attributes.value: Input value.
  • attributes.onChange: {Function} Input value change listener.
  • attributes.className: {String} Additional css classes.

inputContainer(label, input)

Form elements wrapping element.

Params

  • label: {String} Input label.
  • input: {HTMLElement} input element.

Example

var inputContainer = require('tailwind-elements/input-container')
var input = require('tailwind-elements/input')

inputContainer('First Name', input({
  name: 'first-name',
  required: true
}))

navbar(props)

Navigation bar. Please see navigation example

Params

  • props.brand: {String | HTMLElement} Branding text / element.
  • props.items: {Array} Array of navigation items.
    • item.label: {String} Nav label.
    • item.href: {String} Nav link.
  • props.loginItem: {String | HTMLElement} Login info text / element.

steps(items)

Progress steps element.

Params

  • items: {Array} Step items.
    • item.label: {String | HTMLElement} Step label.
    • item.href: {String} Step link.
    • item.onClick: {Function} Click handler for the step.
    • item.active: {Boolean} Whether the step is active or not.

Dropdown

Dropdown component. Based on nanocomponent.

Params

  • props.label: {String | HTMLElement} Dropdown label.
  • props.className: {String} Additional css classes.
  • props.items: [Array] Array of dropdown items.

dropdownMenuItem(props)

Dropdown menu item element.
Params

  • props.label: {String | HTMLElement} Menu item label.
  • props.onClick: {Function} Click handler for the menu item.
  • item.href: {String} Menu item link.

Example

var Dropdown = require('tailwind-elements/Dropdown')
var dropdownMenuItem = require('tailwind-elements/dropdown-menu-item')

new Dropdown({
  label: User,
  items: [
    dropdownMenuItem({ label: 'My Account', href: '/account/profile' }),
    dropdownMenuItem({ label: 'Logout', href: '/account/logout' })
  ]
})

License

MIT

Author

Ismail Demirbilek - @dbtek