🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

svelte-multiselect

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-multiselect

Svelte multi-select component

1.0.0
Source
npm
Version published
Weekly downloads
9.1K
-54.75%
Maintainers
1
Weekly downloads
 
Created
Source

Svelte MultiSelect

Svelte MultiSelect Netlify Status

Live demo.

Key Features

  • Single / multiple select
  • Dropdowns
  • Searchable
  • Tagging
  • Server-side rendering
  • Configurable
  • No dependencies
  • Keyboard friendly

Installation

yarn add -D svelte-multiselect

Usage

<script>
  import MultiSelect from 'svelte-multiselect'

  const webFrameworks = [
    `Svelte`,
    `React`,
    `Vue`,
    `Angular`,
    `Polymer`,
    `Ruby on Rails`,
    `ASP.net`,
    `Laravel`,
    `Django`,
    `Express`,
    `Spring`,
  ]
  const name = `webFrameworks`
  const placeholder = `Take your pick...`
  const required = true

  let input
</script>

Favorite Web Frameworks?

<MultiSelect bind:input {name} {placeholder} options={webFrameworks} {required} />

Full list of props/bindable variables for this component:

  • options (required): Array of strings (or integers) that will be listed in the dropdown selection.
  • selected = []: Array of currently/pre-selected options when binding/passing as props respectively.
  • readonly = false: Disables the input. User won't be able to interact with it.
  • placeholder = '': String shown when no option is selected.
  • single = false: Allows only a single option to be selected when true.
  • required = false: Prevents submission in an HTML form when true.
  • input = undefined: Handle to the DOM node storing the currently selected options in JSON format as its value attribute.
  • name = '': Used as reference for associating HTML form labels with this component as well as for the input id. That is, the same DOM node input bindable through <MultiSelect bind:input /> is also retrievable via document.getElementByID(name) e.g. for use in a JS file outside a Svelte component.

Keywords

svelte

FAQs

Package last updated on 07 May 2021

Did you know?

Socket

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