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

uijs-kit

v1.0.10

Published

Framework for building UI elements programmatically using JavaScript.

Downloads

4

Readme

Framework for building UI elements programmatically using JavaScript.

🏠 UIJS-KIT Homepage

Introduction

Are you a JavaScript developer and want to create UI elements quickly with a consistent Bootstrap code? Take a look at UIJS-KIT. Out of the box, it provides functions to generate UI element. For example:

  • textField function creates the HTML code for <input type="text" .../> and provides the label tag for the input field. All is encapsulated with a .form-group.
  • functions for popular input UI elements: checkboxes, boolean, color, radio, select, textarea, color, time, url, date, datetime, datetime-local, or week.
  • quick indicator for required fields: a trailing asterisk (*) in the label field.
  • options field allows you to specify custom name and id attributes. You can also add additional properties and use them in field type templates.

Install

npm install uijs-kit

Usage

const {textField, colorField} = require('uijs-kit')

let fields = [
  textField('First name'), // optional. Label, name, and id properties derived from text parameter
  textField('Last name*'), // required (see trailing asterisk). Label, name, required, and id properties derived from text parameter
  colorField('Background color', {name: 'bg-color'}), // optional. Label derived from text parameter, name and id specified in name property
]

let values = {}
let renderedFields = fields.map(field => field.render(values))

console.log(JSON.stringify(renderedFields))

SelectField: field with choices

const {selectField} = require('uijs-kit');

// choices as array of objects with label and value properties
let choices = ["Choice 1", "Choice 2"].map((label, value) => {
  return {
    label,
    value: `${value}`
  }
})

// generate the selectField and pass the choices
let f = selectField('Select', choices);

let values = {select: '1'}; // a record storing values for fields

let html = f.render(values);
console.log(html);

// <div class="form-group" id="select-group">
//     <label for="select">Select:</label>
// <select name="select" id="select" class="form-control">
//     <option value="0">Choice 1</option>
//     <option value="1" selected="selected">Choice 2</option>
// </select>
// </div>

API

See api.md for API documentation.

Run tests

npm run test

Roadmap

  • [x] UiField descendant (UiFieldWithFields) to handle collection of fields
  • [x] UiFormField class to generate form
  • [x] Update shortcut functions code documentation: type, default param values, return type.
  • [ ] Create documentation site with Docusaurus, outlined with Skelosaurus. Store it at Github pages for this repository
  • [ ] Create button Ui classes and shortcut functions (e.g UiButton, UiSubmit, UiReset)
  • [ ] Extend formField function to add submit and reset buttons.

Author

👤 Ion Gireada

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.

Contributor Covenant

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2023 Ion Gireada. This project is MIT licensed.