Socket
Socket
Sign inDemoInstall

selectic

Package Overview
Dependencies
26
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    selectic

Smart Select for VueJS 3.x


Version published
Weekly downloads
102
decreased by-1.92%
Maintainers
1
Install size
13.1 MB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 09 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc