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

tuxedo-elements

v0.3.130

Published

A collection of components with minimal dependencies

Downloads

18

Readme

A collection of components that can be dropped into projects, not overly complicated.

Index

Usage

Download & Installation

$ npm i tuxedo-elements

Some CSS styling is available (recommended) to be included in your compiled stylesheets

@import '~tuxedo-elements/dist/tuxedo.css';

Mount Globally

import { TuxedoInput, TuxedoRadio } from 'tuxedo-elements'

const components = {
    TuxedoInput,
    TuxedoRadio
}

Object.entries(components).forEach(([name, component]) => Vue.component(name, component))

Mount Within Component

<script>
    import { TuxedoInput, TuxedoRadio } from 'tuxedo-elements'
    
    export default {
      name: 'SomeComponent',
      components: {
        TuxedoInput,
        TuxedoRadio
      }
    }
</script>

Fields

All fields include a few standard props that can be used consistently throughout.

:name (required) This prop passes a standard html name value to the field, a required prop with a unique value as it helps to differentiate the field form others.

:label Optional, set the attached label markup to the field.

:sub Optional, set <small> text next to the label and within the label tag.

:help Optional, include a helpful bit of text to guide the user. This text gets replaced with error text if there is some validation problem.

:inputClass Optional, include class declarations to be applied to the input field.

Input Field

<tuxedo-input :name="'first_name'" :label="'Some Label'" :help="'Some help text that appears below the field'" v-model="resource" />

Radio Field

<tuxedo-radio :name="'first_name'" :label="'Some Label'" :help="'Some help text that appears below the field'" v-model="resource" />

Select Field

This is an object select field with search functionality. An array of objects should be passed in as options, and an array of chosen options are returned. by default the component will use id and label properties of the objects in the option fields. An array of selected objects will be returned.

<tuxedo-select :name="'select'" :label="'Select Field'" v-model="resource" :options="[{}]" />

# Pass in a default value, and insist on simple returns
<tuxedo-select 
        :name="'select'" 
        :label="'Select Field'" 
        v-model="resource" 
        :options="[{id: 'yes', label: 'Yes'}, {id: 'no', label: 'No'}]"
        :default="'yes'" # the default value based on the insisted return
        :insistReturn="'id'" 
/>

Multiselect Field

Similar to above, but we can pass in the 'multi' prop to let our select field know it should be multi-select

<tuxedo-select 
        :name="'multi-select'" 
        :label="'Multiselect Field'"
        :options="[]"
        :multi="true" />

This field also will also display a 'Select All' and 'Unselect All' buttons for use. The text of these buttons can be changed by using the props 'insistSelectAll' and 'insistUnselectAll' to pass in the text preferred.

Date Field

<tuxedo-date :name="'date'" :label="'Some Label'" v-model="resource" />

# Make it a date range picker by passing the 'range' prop
<tuxedo-date :name="'dateRange'" :range="true" />

# Insist on a specific format to get and set by passing in the 'insistFormat' prop
# Formats available include:
# 'iso', 'isoDate' (which returns as date only no tz), 'isoDateTime' (excludes tz)
<tuxedo-date :insistFormat="'isoDate'" />

Switch Field

<tuxedo-switch :name="'switch'" :label="'Toggle this switch on and off'" v-model="resource" />

License

This project is licensed under the MIT License