@gpaol/bootstrap-multiselect
Version:
Bootstrap 5 MultiSelect component with search, filtering, grouped options, pagination, and comprehensive localization support
179 lines (134 loc) ⢠5.8 kB
Markdown
# Bootstrap MultiSelect jQuery Plugin
A modern, feature-rich Bootstrap 5 MultiSelect component with search, filtering, grouped options, and comprehensive localization support.
## š¦ Package Name
`@gpaol/bootstrap-multiselect`
## š Package Structure
```text
@gpaol/bootstrap-multiselect/
āāā src/
ā āāā css/
ā ā āāā bootstrap-multiselect.css
ā ā āāā bootstrap-multiselect.min.css
ā āāā js/
ā ā āāā bootstrap-multiselect.js
ā ā āāā bootstrap-multiselect.min.js
ā āāā langs/ # Localization files
ā āāā bootstrap-multiselect.de.js
ā āāā bootstrap-multiselect.de.min.js
ā āāā bootstrap-multiselect.es.js
ā āāā bootstrap-multiselect.es.min.js
ā āāā bootstrap-multiselect.fr.js
ā āāā bootstrap-multiselect.fr.min.js
ā āāā bootstrap-multiselect.it.js
ā āāā bootstrap-multiselect.it.min.js
ā āāā bootstrap-multiselect.pt.js
ā āāā bootstrap-multiselect.pt.min.js
āāā package.json
āāā LICENSE
āāā README.md
```
## š Installation
### via npm
```bash
npm install @gpaol/bootstrap-multiselect
```
### via CDN
```html
<!-- CSS -->
<link href="https://cdn.jsdelivr.net/npm/@gpaol/bootstrap-multiselect@1.2.0/src/css/bootstrap-multiselect.min.css" rel="stylesheet">
<!-- JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/@gpaol/bootstrap-multiselect@1.2.0/src/js/bootstrap-multiselect.min.js"></script>
```
## š Usage
After installing via npm, you can import the files in your project:
```html
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="node_modules/@gpaol/bootstrap-multiselect/src/css/bootstrap-multiselect.min.css" rel="stylesheet">
</head>
<body>
<select id="mySelect" multiple>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="node_modules/@gpaol/bootstrap-multiselect/src/js/bootstrap-multiselect.min.js"></script>
<script>
$('#mySelect').bootstrapMultiSelect({
placeholder: 'Select items...',
enableSearch: true,
showSelectAll: true,
enablePagination: true,
itemsPerPage: 10
});
</script>
</body>
</html>
```
### Using with Module Bundlers
If you're using a module bundler like Webpack or Vite:
```javascript
// Import CSS
import '@gpaol/bootstrap-multiselect/src/css/bootstrap-multiselect.min.css';
// Import JavaScript
import '@gpaol/bootstrap-multiselect/src/js/bootstrap-multiselect.min.js';
// Use the plugin
$('#mySelect').bootstrapMultiSelect({
placeholder: 'Select items...',
enableSearch: true,
showSelectAll: true
});
```
## š Localization
The plugin supports multiple languages. Language files are included in the package:
```html
<!-- Include language file -->
<script src="node_modules/@gpaol/bootstrap-multiselect/src/langs/bootstrap-multiselect.it.min.js"></script>
<!-- Set global language -->
<script>
$.fn.bootstrapMultiSelect.lang = 'it';
</script>
```
### Available Languages
- German (`de`)
- Spanish (`es`)
- French (`fr`)
- Italian (`it`)
- Portuguese (`pt`)
For more details, see the [Localization Guide](https://github.com/gpaol/bootstrap-multiselect/blob/main/docs/LOCALIZATION-GUIDE.md).
## š Documentation
- **Complete Examples**: [PLUGIN-EXAMPLES.md](https://github.com/gpaol/bootstrap-multiselect/blob/main/docs/PLUGIN-EXAMPLES.md)
- **Localization Guide**: [LOCALIZATION-GUIDE.md](https://github.com/gpaol/bootstrap-multiselect/blob/main/docs/LOCALIZATION-GUIDE.md)
- **Main README**: [README.md](https://github.com/gpaol/bootstrap-multiselect/blob/main/README.md)
## ā” Features
- ā
**Bootstrap 5 Integration**: Full compatibility with Bootstrap 5
- ā
**Search & Filtering**: Built-in search functionality
- ā
**Select All**: Convenient select/deselect all options
- ā
**Pagination**: Paginate long lists for better performance
- ā
**Grouped Options**: Support for optgroup elements
- ā
**Localization**: Multiple language support (DE, ES, FR, IT, PT)
- ā
**Responsive Design**: Works seamlessly on all devices
- ā
**Customizable**: Extensive configuration options
- ā
**Lightweight**: Minimal footprint, optimized performance
## š License
MIT License - see [LICENSE](../../LICENSE) for details
## š¤ Author
Paolo Gaetano
- GitHub: [@gpaol](https://github.com/gpaol)
- Repository: [bootstrap-multiselect](https://github.com/gpaol/bootstrap-multiselect)
## š¤ Contributing
Contributions, issues, and feature requests are welcome!
See the [Contributing Guide](https://github.com/gpaol/bootstrap-multiselect/blob/main/CONTRIBUTING.md) for detailed guidelines.
## š Links
- **Repository**: <https://github.com/gpaol/bootstrap-multiselect>
- **Issues**: <https://github.com/gpaol/bootstrap-multiselect/issues>
- **npm Package**: <https://www.npmjs.com/package/@gpaol/bootstrap-multiselect>
- **CDN (jsDelivr)**: <https://cdn.jsdelivr.net/npm/@gpaol/bootstrap-multiselect@latest/>
- **CDN (unpkg)**: <https://unpkg.com/@gpaol/bootstrap-multiselect@latest/>
## š Requirements
- Bootstrap 5.3.0 or higher
- jQuery 3.7.0 or higher