All Projects → apalfrey → select2-bootstrap-5-theme

apalfrey / select2-bootstrap-5-theme

Licence: MIT license
A Select2 v4 theme for Bootstrap 5

Programming Languages

SCSS
7915 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to select2-bootstrap-5-theme

jinja-material-kit
Jinja Template - Material Kit 2 (Bootstrap 5) | AppSeed
Stars: ✭ 14 (-87.27%)
Mutual labels:  bootstrap5
RoyalUI-Free-Bootstrap-Admin-Template
Free Bootstrap 4 Admin Template
Stars: ✭ 153 (+39.09%)
Mutual labels:  bootstrap5
startbootstrap-business-frontpage
A Bootstrap HTML business homepage template created by Start Bootstrap
Stars: ✭ 177 (+60.91%)
Mutual labels:  bootstrap5
docs
DEPRECATED - Now located in docs directory of main repository
Stars: ✭ 47 (-57.27%)
Mutual labels:  select2
11straps
11straps is a static website boilerplate. It combines Eleventy with Bootstrap 5. 🎉
Stars: ✭ 85 (-22.73%)
Mutual labels:  bootstrap5
Dash-UI
Bootstrap 5 Admin & Dashboard Template - Dash-UI. Dash UI Kit is a free and open-source components and templates kit fully coded with Bootstrap 5.
Stars: ✭ 213 (+93.64%)
Mutual labels:  bootstrap5
spe
A series of PHP8 examples based around a super simple MVC framework (WIP)
Stars: ✭ 14 (-87.27%)
Mutual labels:  bootstrap5
bootstrap5-tags
Replace select[multiple] with nices badges for Bootstrap 5
Stars: ✭ 58 (-47.27%)
Mutual labels:  bootstrap5
hugo-dynamic-tabs
A Hugo theme component that allows you to add dynamic tabs in your markdown files.
Stars: ✭ 36 (-67.27%)
Mutual labels:  bootstrap5
ehr-blockchain
Electronic Health Record (EHR) and Electronic Medical Record (EMR) systems. However, they still face some issues regarding the security of medical records, user ownership of data, data integrity etc. The solution to these issues could be the use of a novel technology, i.e., Blockchain. This technology offers to provide a secure, temper-proof pl…
Stars: ✭ 41 (-62.73%)
Mutual labels:  bootstrap5
bs5-utils
A JavaScript utility package for Bootstrap 5 components.
Stars: ✭ 26 (-76.36%)
Mutual labels:  bootstrap5
bootscore
Flexible Bootstrap 5 WordPress starter theme with full WooCommerce support
Stars: ✭ 160 (+45.45%)
Mutual labels:  bootstrap5
capybara select2
Capybara helpers for https://select2.org select box (supports Select2 version 2/3/4)
Stars: ✭ 48 (-56.36%)
Mutual labels:  select2
arugo
Virtual rating system for codeforces using codeforces API.
Stars: ✭ 30 (-72.73%)
Mutual labels:  bootstrap5
django-tables2-column-shifter
Simple extension for django-tables2 can dynamically show or hide columns. Using JQuery, Bootstrap 3, Bootstrap 4, Bootstrap 5 and Django >=1.9
Stars: ✭ 17 (-84.55%)
Mutual labels:  bootstrap5
select2-treeview
github.com/select2/select2/pull/4717
Stars: ✭ 20 (-81.82%)
Mutual labels:  select2
mdb-vue-ui-kit
Vue 3 & Bootstrap 5 & Material Design 2.0 UI KIT
Stars: ✭ 887 (+706.36%)
Mutual labels:  bootstrap5
angular-app
Angular 14 ,Bootstrap 5, Node.js, Express.js, ESLint, CRUD, PWA, SSR, SEO, Universal, Lazy Loading
Stars: ✭ 389 (+253.64%)
Mutual labels:  bootstrap5
django-material-kit
Django Boilerplate - Material Kit Design | AppSeed
Stars: ✭ 36 (-67.27%)
Mutual labels:  bootstrap5
angular2-select
No description or website provided.
Stars: ✭ 12 (-89.09%)
Mutual labels:  select2

Select2 Bootstrap 5 Theme

GitHub npm Packagist Version License

Select2 v4 theme for Bootstrap 5, inspired by select2-bootstrap4-theme

Works with Select2 v4.0 and v4.1

Docs

https://apalfrey.github.io/select2-bootstrap-5-theme/

Installation

CDN

Select2 v4.0

<!-- Styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/select2-bootstrap-5-theme.min.css" />
<!-- Or for RTL support -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/select2-bootstrap-5-theme.rtl.min.css" />

<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.full.min.js"></script>

Select2 v4.1

<!-- Styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/select2-bootstrap-5-theme.min.css" />
<!-- Or for RTL support -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/select2-bootstrap-5-theme.rtl.min.css" />

<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>

Package Managers

# npm
$ npm install select2-bootstrap-5-theme

# yarn
$ yarn add select2-bootstrap-5-theme

# composer
$ composer require apalfrey/select2-bootstrap-5-theme

HTML

<link rel="stylesheet" href="/path/to/select2.css">
<link rel="stylesheet" href="/path/to/select2-bootstrap-5-theme.min.css">
<!-- Or for RTL support -->
<link rel="stylesheet" href="/path/to/select2-bootstrap-5-theme.rtl.min.css">

SCSS

@import "node_modules/select2/src/scss/core";
// If you need to import Bootstrap as well:
@import "node_modules/select2-bootstrap-5-theme/src/select2-bootstrap-5-theme";
// Or if you have already imported Bootstrap:
@import "node_modules/select2-bootstrap-5-theme/src/include-all";

Usage

// Basic
$("select").select2({
    theme: "bootstrap-5",
});

// Small using Select2 properties
$("#form-select-sm").select2({
    theme: "bootstrap-5",
    containerCssClass: "select2--small", // For Select2 v4.0
    selectionCssClass: "select2--small", // For Select2 v4.1
    dropdownCssClass: "select2--small",
});

// Small using Bootstrap 5 classes
$("#form-select-sm").select2({
    theme: "bootstrap-5",
    dropdownParent: $("#form-select-sm").parent(), // Required for dropdown styling
});

// Large using Select2 properties
$("select").select2({
    theme: "bootstrap-5",
    containerCssClass: "select2--large", // For Select2 v4.0
    selectionCssClass: "select2--large", // For Select2 v4.1
    dropdownCssClass: "select2--large",
});

// Large using Bootstrap 5 classes
$("#form-select-lg").select2({
    theme: "bootstrap-5",
    dropdownParent: $("#form-select-lg").parent(), // Required for dropdown styling
});

Build tools

This repo uses Gulp to compile the assets, see below for the included npm scripts and Gulp tasks and what they do;

npm script Gulp task Description
start default Cleans the dist directory, lints the SCSS, compiles the dev and min versions and starts watching the SCSS for changes
start:full N/A Cleans, lints, compiles and watches the SCSS (theme & docs) and serves the docs for development
clean clean Cleans the dist directory, removing the directory and it's contents
lint lint Lints the SCSS files using Stylelint, see .stylelintrc and stylelint-config-twbs-bootstrap for linting rules
compile compile Cleans the dist directory, lints the SCSS, compiles the LTR and RTL dev and min versions. Does the same for the docs
compile:main compile:main Compiles all LTR versions
compile:rtl compile:rtl Compiles all RTL versions
watch watch Watches all files in src, compiling the SCSS when changes are detected
docs docs Cleans the docs/assets/css directory, lints the docs SCSS, compiles the docsSCSS and starts watching the docs SCSS for changes
docs:clean docs:clean Cleans the docs/assets/css directory, removing the directory and it's contents
docs:lint docs:lint Lints the docs SCSS files using Stylelint, see .stylelintrc and stylelint-config-twbs-bootstrap for linting rules
docs:compile docs:compile Cleans the docs/assets/css directory, lints the docs SCSS and compiles the LTR and RTL versions
docs:compile:main docs:compile:main Compiles the LTR version of the docs SCSS
docs:compile:rtl docs:compile:rtl Compiles the RTL version of the docs SCSS
docs:watch docs:watch Watches all files in docs/_sass, compiling the SCSS when changes are detected
docs:build N/A Builds the docs using Jekyll
docs:serve N/A Serves the docs using Jekyll for development

Contributing

If you have ideas for improvements or changes, feel free to submit an issue, or if you have changes you'd like in the project, feel free to submit a pull request. Make sure you run gulp compile or npm run compile before submitting a pull request to ensure the styles are compiled.

Find out more about contributing here

License

MIT License

Copyright (c) 2022 Andrew Palfrey <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].