1.10.2 • Published 1 year ago

@canadies/searchselectsvelte v1.10.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Search Select Svelte (SSS)

A light weight, easy to use select Svelte component with lots of handy integrated features

Authors

@Daniel Ho

Demo

A demo app of this component can be seen here.

Features

  • Allows more than just text to be displayed in select (eg: emoji, icon, etc).
  • Allows searching for the corresponding value.
  • Customable UI (using global classes, lib, etc).

Installation

Install SearchSelectSvelte with npm

npm i @canadies/searchselectsvelte

Usage/Examples

<script>
	import {SearchSelectSvelte} from "@canadies/searchselectsvelte@1.0.6"
    let list = ["a", "b", "c", "d"]
    let selectedValue
</script>

<svelte:head>
	<script src="https://cdn.tailwindcss.com"></script>
</svelte:head>

<div class=" max-w-md mx-auto flex flex-wrap gap-10">
    <h1 class="font-bold text-3xl w-full">Search Select Svelte Demo</h1>
    <SearchSelectSvelte bind:selected={selectedValue}>
        {#each list as item}
            <li class="select-option" data-value={item}>{item}</li>
        {/each}
    </SearchSelectSvelte>
    
    <h3 class="text-xl w-full">Selected value: {selectedValue}</h3>
</div>

Properties

ul (dropdown board)

PropertiesTypeDescription
selectedstringRequired. Used to bind the selected value
inputPlaceholderstringOptional. Placeholder of the select (default: 'Search here')
dropdownCssClassstringOptional. Style the select dropdown using css class (global css, tailwind, etc) as you wish
dropdownStylestringOptional. Style the select dropdown using css style as you wish

li (select option)

select options must contain the class "select-option"

PropertiesTypeDescription
data-valuestringRequired. Value of the select option

Support

For further support, feel free to email danielho567@gmail.com.

Issues

If you find any bugs, be my guest to create new issues ♥️♥️

Appendix

If you find this useful, please leave a star on my github repo, it would help me a lot ♥️♥️♥️

1.10.2

1 year ago

1.10.1

1 year ago

1.10.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago