0.3.1 • Published 4 years ago

ss-select v0.3.1

Weekly downloads
39
License
MIT
Repository
github
Last release
4 years ago

ss-select

npm npm npm npm

Stylable searchable select component for VueJS. This component is renderless so you are free to customize it however you need to!

Features

  • Renderless
  • Single and multiple mode
  • Filtering
  • Disabling options
  • Keyboard navigation
  • v-model and vuex support
  • No dependencies

Documentation:

Read documentation with examples.

Installation:

npm install ss-select

or

yarn add ss-select

Pull ss-select components in

<script>
    import { SsSelect, SsSelectToggle, SsSelectOption, SsSelectSearchInput } from 'ss-select'

    components: { SsSelect, SsSelectToggle, SsSelectOption, SsSelectSearchInput }
</script>

Basic usage:

<!-- ss-select is the root component. Give it your options and a unique key to track them by. -->
<ss-select v-model="model" :options="options" track-by="id" search-by="name" class="relative">
    <!-- Then create a div so you can resolve data and methods you need from slot scope -->
    <div slot-scope="{ selectedOption, isOpen, $get }">
        <!-- toggle component opens and closes the dropdown -->
        <ss-select-toggle>
            {{ $get(selectedOption, 'name') || 'Select a car' }}
        </ss-select-toggle>

        <!-- Create a div to display options -->
        <div v-show="isOpen" class="absolute min-w-full z-10">
            <!-- search input component is used to filter options -->
            <!-- Be sure to provide search-by prop that will be the key to filter options by -->
            <ss-select-search-input placeholder="Search cars"></ss-select-search-input>

            <!-- Here go options -->
            <ss-select-option v-for="(option, index) in options"
                              :index="index"
                              :value="option">
                {{ option.name }}
            </ss-select-option>
        </div>
    </div>
</ss-select>

License

MIT

0.4.0-beta.1

4 years ago

0.4.0-beta.2

4 years ago

0.4.0-beta.0

4 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.3.0-beta.1

5 years ago

0.3.0-beta.0

5 years ago

0.2.1

5 years ago

0.2.0-beta.0

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago