{"id":13406729,"url":"https://github.com/softsimon/ngx-bootstrap-multiselect","last_synced_at":"2026-02-14T22:05:23.540Z","repository":{"id":47396739,"uuid":"56352170","full_name":"softsimon/ngx-bootstrap-multiselect","owner":"softsimon","description":"Angular 9+ Dropdown Multiselect Bootstrap","archived":false,"fork":false,"pushed_at":"2023-03-15T02:03:56.000Z","size":871,"stargazers_count":332,"open_issues_count":15,"forks_count":200,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-30T23:35:04.595Z","etag":null,"topics":["angular2","bootstrap4"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softsimon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-04-15T21:58:54.000Z","updated_at":"2025-04-22T18:04:11.000Z","dependencies_parsed_at":"2024-01-15T20:51:36.837Z","dependency_job_id":"9ef7b73b-e936-4e3f-a124-189b8ab915d5","html_url":"https://github.com/softsimon/ngx-bootstrap-multiselect","commit_stats":{"total_commits":292,"total_committers":71,"mean_commits":4.112676056338028,"dds":0.8184931506849316,"last_synced_commit":"86523d9bed13201781cac36ee2d52b269a15c935"},"previous_names":["softsimon/angular-2-dropdown-multiselect","softsimon/ngx-bootrap-multiselect"],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softsimon%2Fngx-bootstrap-multiselect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softsimon%2Fngx-bootstrap-multiselect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softsimon%2Fngx-bootstrap-multiselect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softsimon%2Fngx-bootstrap-multiselect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softsimon","download_url":"https://codeload.github.com/softsimon/ngx-bootstrap-multiselect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252179193,"owners_count":21707107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular2","bootstrap4"],"created_at":"2024-07-30T19:02:37.770Z","updated_at":"2026-02-14T22:05:18.518Z","avatar_url":"https://github.com/softsimon.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Angular Multiselect Dropdown for Bootstrap CSS \n\nCompiled for Angular 15 with Ivy enabled. If you are using an older version of Angular and are relying on the View Engine, you can use version 2.1 of this library.\n\nCustomizable multiselect dropdown in Angular(9+), TypeScript with Bootstrap css.\n\n## Dependencies\n* Bootstrap CSS 3 or 4\n* Font Awesome (optional)\n\n## Install\n\n* Install with [npm](https://www.npmjs.com): `npm install ngx-bootstrap-multiselect --save`.\n\n## Usage\n\nImport `NgxBootstrapMultiselectModule` into your @NgModule.\n\n```js\nimport { NgxBootstrapMultiselectModule } from 'ngx-bootstrap-multiselect';\n\n@NgModule({\n  // ...\n  imports: [\n    NgxBootstrapMultiselectModule,\n  ]\n  // ...\n})\n```\n\nDefine options in your consuming component:\n\n```js\nimport { IMultiSelectOption } from 'ngx-bootstrap-multiselect';\n\nexport class MyClass implements OnInit {\n    optionsModel: number[];\n    myOptions: IMultiSelectOption[];\n\n    ngOnInit() {\n        this.myOptions = [\n            { id: 1, name: 'Option 1' },\n            { id: 2, name: 'Option 2' },\n        ];\n    }\n    onChange() {\n        console.log(this.optionsModel);\n    }\n}\n```\n\nIn your template, use the component directive:\n\n```html\n\u003cngx-bootstrap-multiselect [options]=\"myOptions\" [(ngModel)]=\"optionsModel\" (ngModelChange)=\"onChange()\"\u003e\u003c/ngx-bootstrap-multiselect\u003e\n```\n\n## Customize\n\nImport the `IMultiSelectOption` and `IMultiSelectTexts` interfaces to enable/override settings and text strings:\n```js\n\n// Default selection\noptionsModel: number[] = [1, 2];\n\n// Settings configuration\nmySettings: IMultiSelectSettings = {\n    enableSearch: true,\n    checkedStyle: 'fontawesome',\n    buttonClasses: 'btn btn-default btn-block',\n    dynamicTitleMaxItems: 3,\n    displayAllSelectedText: true\n};\n\n// Text configuration\nmyTexts: IMultiSelectTexts = {\n    checkAll: 'Select all',\n    uncheckAll: 'Unselect all',\n    checked: 'item selected',\n    checkedPlural: 'items selected',\n    searchPlaceholder: 'Find',\n    searchEmptyResult: 'Nothing found...',\n    searchNoRenderText: 'Type in search box to see results...',\n    defaultTitle: 'Select',\n    allSelected: 'All selected',\n};\n\n// Labels / Parents\nmyOptions: IMultiSelectOption[] = [\n    { id: 1, name: 'Car brands', isLabel: true },\n    { id: 2, name: 'Volvo', parentId: 1 },\n    { id: 3, name: 'Honda', parentId: 1 },\n    { id: 4, name: 'BMW', parentId: 1 },\n    { id: 5, name: 'Colors', isLabel: true },\n    { id: 6, name: 'Blue', parentId: 5 },\n    { id: 7, name: 'Red', parentId: 5 },\n    { id: 8, name: 'White', parentId: 5 }\n];\n\n```\n\n```html\n\u003cngx-bootstrap-multiselect [options]=\"myOptions\" [texts]=\"myTexts\" [settings]=\"mySettings\" [(ngModel)]=\"optionsModel\"\u003e\u003c/ngx-bootstrap-multiselect\u003e\n```\n### Settings\n| Setting                       | Description                                                                                                                                                                             | Default Value     |\n|-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|\n| pullRight                     | Float the dropdown to the right                                                                                                                                                         | false             |\n| enableSearch                  | Enable searching the dropdown items                                                                                                                                                     | false             |\n| checkedStyle                  | Style of checked items one of 'checkboxes', 'glyphicon' or 'fontawesome'                                                                                                                | 'checkboxes'      |\n| buttonClasses                 | CSS classes to apply to the trigger button                                                                                                                                              | 'btn btn-default' |\n| itemClasses                   | CSS classes to apply to items                                                                                                                                                           | ''                |\n| containerClasses              | CSS classes to apply to container div                                                                                                                                                   | 'dropdown-inline' |\n| selectionLimit                | Maximum number of items that may be selected (0 = no limit)                                                                                                                             | 0                 |\n| minSelectionLimit             | Minimum number of items that may be selected                                                                                                                                            | 0                 |\n| autoUnselect                  | Unselect the previous selection(s) once selectionLimit is reached                                                                                                                       | false             |\n| closeOnSelect                 | If enabled, dropdown will be closed after selection                                                                                                                                     | false             |\n| showCheckAll                  | Display the `checkAll` item to select all options                                                                                                                                       | false             |\n| showUncheckAll                | Display the `uncheckAll` item to unselect all options                                                                                                                                   | false             |\n| fixedTitle                    | Use the default title (do not apply the dynamic title)                                                                                                                                  | false             |\n| dynamicTitleMaxItems          | The maximum number of options to display in the dynamic title                                                                                                                           | 3                 |\n| maxHeight                     | The maximum height for the dropdown (including unit)                                                                                                                                    | '300px'           |\n| displayAllSelectedText        | Display the `allSelected` text when all options are selected                                                                                                                            | false             |\n| searchRenderLimit             | If `enableSearch=true` and total amount of items more then `searchRenderLimit` (0 - No limit) then render items only when user typed more then or equal `searchRenderAfter` charachters | 0                 |\n| searchRenderAfter             | Amount of characters to trigger rendering of items                                                                                                                                      | 1                 |\n| searchMaxLimit                | If more than zero will render only first N options in search results                                                                                                                    | 0                 |\n| searchMaxRenderedItems        | Used with searchMaxLimit to further limit rendering for optimization. Should be less than searchMaxLimit to take effect                                                                 | 0                 |\n| displayAllSelectedText        | Display the `allSelected` text when all options are selected                                                                                                                            | false             |\n| closeOnClickOutside           | Close dropdown when clicked outside                                                                                                                                                     | true              |\n| isLazyLoad                    | An event, ```onLazyLoad```, triggers on scrolling to a specified distance from the bottom of the dropdown, allowing additional data to load                                             | false             |\n| loadViewDistance              | Distance from bottom of dropdown to trigger lazy load, in units of dropdown viewport height                                                                                             | 1                 |\n| stopScrollPropagation         | Scrolling the dropdown will not overflow to document                                                                                                                                    | false             |\n| selectAddedValues             | Additional lazy loaded ```Select All``` values are checked when added on scrolling                                                                                                      | false             |\n| ignoreLabels                  | Ignore label options when counting selected options                                                                                                                                     | false             |\n| maintainSelectionOrderInTitle | The title will show selections in the order they were selected                                                                                                                          | false             |\n| focusBack                     | Set the focus back to the input control when the dropdown closed                                                                                                                        | true              |\n\n### Texts\n| Text Item          | Description                                                                    | Default Value                          |\n|--------------------|--------------------------------------------------------------------------------|----------------------------------------|\n| checkAll           | The text for the \"check all\" option                                            | 'Check all'                            |\n| uncheckAll         | The text for the \"uncheck all\" option                                          | 'Uncheck all'                          |\n| checked            | Text for \"checked\" with single item selected (used in dynamic title)           | 'checked'                              |\n| checkedPlural      | Text for \"checked\" with multiple items selected (used in dynamic title)        | 'checked'                              |\n| searchPlaceholder  | Text initially displayed in search input                                       | 'Search...'                            |\n| defaultTitle       | Title displayed in button before selection                                     | 'Select'                               |\n| allSelected        | Text displayed when all items are selected (must be enabled in options)        | 'All selected'                         |\n| searchEmptyResult  | Text displayed when no items are rendered                                      | 'Nothing found...'                     |\n| searchNoRenderText | Text displayed when items rendering disabled by the `searchRenderLimit` option | 'Type in search box to see results...' |\n\n## Other examples\n\n### Single select\nAlthough this dropdown is designed for multiple selections, a common request is to only allow a single selection without requiring the user to unselect their previous selection each time. This can be accomplished by setting selectionLimit to 1 and autoUnselect to true.\n```\n{\n  ...\n  selectionLimit: 1,\n  autoUnselect: true,\n  ...\n}\n```\n\n### Lazy Loading\n\nThis Stackblitz link demonstrates an implementation of lazy loading: [Lazy loading Stackblitz](https://stackblitz.com/edit/angular-oqhzcv?embed=1\u0026file=src/app/app.component.ts)\n\nIf using search during lazy load, the search term must be supplied to the back end to return the appropriate number of results. Standard inline search will not work, since the front end does not know how many items to load to retrieve the desired number of matches.\n\nIf ```selectAddedValues``` is set to ```true``` for lazy loading, all values loaded to the checklist are checked when matching ```Select All``` criteria. If a search is used with ```Select All```, each search is added to a collection to be matched against when scrolling in. If ```selectAddedValues``` is false, only presently viewed matches will check on ```Select All```.\n\nIf a user searches countries on ```al``` and clicks ```Select All```, all matches will be selected as they load in on scrolling. If the user clears the search box, only matches to ```al``` will select upon scrolling in all country values.\n\nIf the user then searches ```an``` and clicks ```Select All```, all matches to ```an``` and ```al``` will select upon scrolling in. If the user then clicks ```Unselect All``` while ```an``` is the search criteria, all matches to ```an``` will clear, except those that match ```al```, which is still stored.\n\nClicking ```Select All``` or ```Unselect All``` with no search criteria present will clear all previously stored searches. Any search match that is manually unchecked will remain unchecked unless matched by a new search ```Select All```.\n\nThe implementor will be responsible for completing checks when the form is submitted. This could possibly either consist of completing the load of all lazy load checklists before submitting or sending checked items and search criteria to a back-end api to complete.\n\n### Use model driven forms with ReactiveFormsModule:\n\n```js\nimport { IMultiSelectOption } from 'ngx-bootstrap-multiselect';\n\nexport class MyClass implements OnInit {\n    myOptions: IMultiSelectOption[] = [\n        { id: 1, name: 'Option 1' },\n        { id: 2, name: 'Option 2' },\n    ];\n\n    ngOnInit() {\n        this.myForm = this.formBuilder.group({\n            optionsModel: [1, 2], // Default model\n        });\n\n        this.myForm.controls['optionsModel'].valueChanges\n            .subscribe((selectedOptions) =\u003e {\n                // changes\n            });\n    }\n}\n```\n\n```html\n\u003cform [formGroup]=\"myForm\"\u003e\n    \u003cngx-bootstrap-multiselect [options]=\"myOptions\" formControlName=\"optionsModel\"\u003e\u003c/ngx-bootstrap-multiselect\u003e\n\u003c/form\u003e\n```\n\n## Developing\n\nPull requests are welcome!\n\n## License\n\n[MIT]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftsimon%2Fngx-bootstrap-multiselect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftsimon%2Fngx-bootstrap-multiselect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftsimon%2Fngx-bootstrap-multiselect/lists"}