This package has been deprecated

Author message:

Please use ionic-selectable instead as ionic-select-searchable is no longer maintained.

ionic-select-searchable
TypeScript icon, indicating that this package has built-in type declarations

2.10.0 • Public • Published

Ionic Select with Searchbar

npm npm npm

An Ionic component similar to ion-select, that allows to search items, including async search and infinite scrolling.

iOS Demo

Contents

Getting started

  1. Install it.
npm install ionic-select-searchable --save
  1. Import it.
import { SelectSearchableModule } from 'ionic-select-searchable';

@NgModule({
    imports: [
        SelectSearchableModule
    ]
})
export class AppModule { }

  1. Add it to template.
<ion-item>
    <ion-label>Port</ion-label>
    <select-searchable
        item-content
        [(ngModel)]="port"
        [items]="ports"
        itemValueField="id"
        itemTextField="name"
        [canSearch]="true"
        (onChange)="portChange($event)">
    </select-searchable>
</ion-item>
  1. Configure it.
import { SelectSearchableComponent } from 'ionic-select-searchable';

class Port {
    public id: number;
    public name: string;
}

@Component({ ... })
export class HomePage {
    ports: Port[];
    port: Port;

    constructor() {
        this.ports = [
            { id: 1, name: 'Tokai' },
            { id: 2, name: 'Vladivostok' },
            { id: 3, name: 'Navlakhi' }
        ];
    }

    portChange(event: {
        component: SelectSearchableComponent,
        value: any 
    }) {
        console.log('port:', event.value);
    }
}
  1. Enjoy it 😉
  2. That is just a small part of what ionic-select-searchable is capable of.
    See more samples and explore docs and FAQ to learn more.

Share it

If you find this component useful, please star the repo to let others know that it's reliable. Also, share it with friends and colleagues who might find it useful as well. Thank you 😄

Package Sidebar

Install

npm i ionic-select-searchable

Weekly Downloads

142

Version

2.10.0

License

none

Unpacked Size

211 kB

Total Files

24

Last publish

Collaborators

  • eakoryakin