Extended Select for Bootstrap 4 (analog bootstrap-select)
Demo and documentation
You can require bootstrap plugin via cdn or download the archive with release and unzip into assets directory.
For install via npm, use command:
npm i --save bootstrap-hardskilled-extend-select
To use CDN:
Example usage:
Usage with options:
Key | Description | Default value |
---|---|---|
search | Search input placeholder | Search |
notSelectedTitle | Title if option not selected | Nothing to shown |
empty | Message if select list empty | Nothing to shown |
activeClass | Class to active element | active |
disabledClass | Class to disabled element | diabled |
maxOptionMessage | Custom error message for all selects (use placeholder %items) | Limit reached (%items items max) |
maxOptionMessageDelay | Delay to hide message | 2000 |
popoverResize | Popover logic (resize or save height) | false |
dropdownResize | Auto resize dropdown by button width | false |
To listen changes use .on('change') event:
HTML attributes to select:
Rabbit Cat Owl Spider Worm Fly
Attribute | Description | Default value |
---|---|---|
data-live-search | Live search | false |
data-max-options | Max selected options | Nothing to shown |
data-max-options-message | Message if select limit overflow | Limit reached (%items items max) |
data-live-search-placeholder | Search input placeholder | Search |
data-hide-disabled | Hide disabled elements | false |
data-btn-class | Button class for dropdown | btn-secondary |
data-not-selected | Title if option not selected | Nothing to shown |
data-empty | Message if select list empty | Nothing to shown |
data-type | Custom select type (ex. checkbox) | null |
multiple | Enable multiple selections | false |