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

selectic

v3.1.1

Published

Smart Select for VueJS 3.x

Downloads

353

Readme

Selectic

VueJS 3.X + Typescript + JSX + Select

npm

Introduction

A customizable component allowing you to list and select items which embeds the most common features like searching, remote data sets, infinite scrolling, reverse selection, and many other possibilities.

It integrates well with VueJS and is reactive to option changes.

Typescript types are provided.

There are very few dependencies and code stays very small (~90kB).

example of a Selectic component

Example

<Selectic
    :options="['first choice', 'second choice', 'third choice']"
    v-model="selection"
/>

<Selectic
    multiple
    value="item2"
    :options="[{
        id: 'item1',
        text: 'The first item',
        icon: 'fa fa-thumbs-o-up',
    }, {
        id: 'item2',
        text: 'Another item',
        title: 'second choice',
    }, {
        id: 'item3',
        text: 'Disabled item',
        disabled: true,
    }]"

    @input="onChange"
/>

<Selectic
    :options="[{
        id: 'animals',
        text: 'Animals',
        options: [{
            id: 'cat',
            text: 'Cat',
        }, {
            id: 'dog',
            text: 'A dog',
        }, {
            id: 42,
            text: '42 goldfishes',
        }],
    }]"
/>

Full documentation

Features

  • List of items (either string array or object array).
  • Can load dynamically list from a server and the list can be paginate (with a cache system to avoid reloading previous requests).
  • ~~Slots: options may be added from Vue template (by writing explicit <option> or <optgroup>) in a reactive way~~ (currently disabled in 3.0.0+).
  • Multi-sources: Possibility to combine options from different sources (static, dynamic or slots) or to use the other as fallback (if the list is empty).
  • Supports basic Select properties like multiple, disabled, title
  • Supports group element (equivalent of optGroup), even for dynamic list.
  • Supports placeholder to display a default text when there is no selection.
  • Keyboard shortcuts works.
  • Possibility to search for any string in options.
  • Scroll bar always indicates the size of the list (even for dynamic list), next pages to fetch are already computed the size of the list.
  • Performance optimization for list containing large number of items.
  • Emits input, change, open, and close events.
  • Supports a reverse selection system (for very long list where only some elements are not selected).
  • All displayed text can be changed (for example, to translate them in another language).
  • Options to auto-disable the component when there is no options or only one mandatory option.
  • Handle selection overflow either by displaying a tag "+x more" either by adding several lines and show all selected options.
  • Possibility to open the component programmatically.
  • CSS styles can be easily changed to fit your theme.
  • Strong typing: all Typescript types are provided.

Documentation

Read the documentation to know how to configure Selectic and all its possibilities.

For users which are used to previous Selectic versions, they can read the migration strategy guide.

It uses VTYX for strong typing.

Tests

First build all files:

$ npm run build

Run unitary tests:

$ npm run test

Migration information

From 3.0 to 3.1

Selectic no more depends on Font-awesome. It embeds its own icons (from Material Design Icons).

It is still possible to use Font-awesome icons (or from any other libraries).

Read the documentation section related to changing icons for more information on how to handle them.