Download the PHP package braesident/dropdown without Composer
On this page you can find all versions of the php package braesident/dropdown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download braesident/dropdown
More information about braesident/dropdown
Files in braesident/dropdown
Download braesident/dropdown
More information about braesident/dropdown
Files in braesident/dropdown
Vendor braesident
Package dropdown
Short Description Dropdown for Bootstrap
License proprietary
Homepage https://www.exunova.de
Package dropdown
Short Description Dropdown for Bootstrap
License proprietary
Homepage https://www.exunova.de
Please rate this library. Is it a good library?
Informations about the package dropdown
Dropdown (Bootstrap Extension)
This extension wraps a Bootstrap dropdown into a reusable JavaScript class (Dropdown) and adds:
- a searchable dropdown input
- a hidden input for stable form values
- dynamic item loading/replacement
- programmatic selection and reset
- optional swipe actions per item
- optional List.js integration
Purpose and Use Cases
Use this when a plain Bootstrap dropdown is not enough, for example:
- large selectable lists with live filtering
- forms that must submit a stable value (
key) through a hidden field - dynamic data sources (Ajax/reload) without rebuilding markup manually
- extra interactions such as swipe delete or preselection
Requirements
- Bootstrap 5 (or 4 via the built-in
window.bs4fallback) - jQuery (used internally)
- optional: List.js when using
listjs: true
Quick Start
HTML:
JavaScript:
The selected value is stored in the hidden input with name="countryDropdown".
Initialization: Full Options List
| Option | Type | Default | Description |
|---|---|---|---|
bootstrapmajor |
number |
5 |
Bootstrap major version (5 or 4). |
buttonstyle |
string |
'btn-outline-secondary' |
Extra classes on the toggle button. |
caret |
boolean |
true |
Shows/hides the caret on the button (false disables it). |
disabled |
boolean |
false |
Disables input, toggle, and hidden input. |
floatingbox |
boolean |
false |
Enables Bootstrap floating-label behavior (with filter: true). |
items |
object |
{} |
Initial entries. Keys become data-value / hidden-input value. |
listjs |
boolean |
false |
Enables List.js mode instead of native menu rendering. |
filter |
boolean |
true |
Enables/disables searchable input (false = button label only). |
menumaxheight |
string |
'300px' |
Menu max-height (inline style). |
menustyle |
string |
'' |
Additional inline style for the menu. |
placeholder |
string |
'' |
Placeholder for search input or label placeholder when filter: false. |
required |
boolean |
false |
Sets required on the search input. |
swipe.left.hint |
string\|false |
false |
HTML hint for left swipe (for example an icon). |
swipe.left.action |
function\|false |
false |
Callback on valid left swipe ((event, li) => {}). |
swipe.left.condition |
function |
(item) => true |
Condition to allow left swipe ((idx, item, li) => boolean). |
swipe.right.hint |
string\|false |
false |
HTML hint for right swipe. |
swipe.right.action |
function\|false |
false |
Callback on valid right swipe ((event, li) => {}). |
swipe.right.condition |
function |
(item) => true |
Condition to allow right swipe ((idx, item, li) => boolean). |
onSelected |
function |
(e) => {} |
Runs after an item is selected. |
onInput |
function |
(event, input) => {} |
Runs while typing/filtering. |
onReplaceText |
function\|undefined |
undefined |
Overrides default display-text replacement (click/focusout). |
item |
string |
'<li>Entry</li>' |
List.js item template (listjs: true). |
valueNames |
array |
[] |
List.js field definitions (listjs: true). |
valueKey |
string\|undefined |
auto |
Forces which List.js item field is used as internal key. |
bootstrapAutoClose |
boolean\|undefined |
undefined |
Relevant only for Bootstrap 4 fallback; false prevents hide.bs.dropdown. |
Item Structure
A single items entry currently supports:
Usage Snippets
1. Set items dynamically
2. Select programmatically
3. Clear selection / input
4. Disable/enable dropdown
5. Swipe action on list entries
6. Dispose cleanly (for example before DOM removal)
Important Methods (Short Overview)
setItems(items, callback?, options?): add new entries / re-renderselected(): get currently selected itemselected(key): select item by keyselected(null): clear current selectionclear(options?): clear items/selection in a controlled waysetDisabled(state): enable/disable interactiongetInput(): current visible input textmatchItem(): number of exact matches for current inputdispose(): remove listeners/instance safely
Notes
- With
filter: false, the component uses a button label instead of a search input. - When
listjs: true, List.js must be available, otherwise initialization is incomplete. - The container dispatches custom events including
dropdown-items-rendered.
All versions of dropdown with dependencies
PHP Build Version
Package Version
No informations.
The package braesident/dropdown contains the following files
Loading the files please wait ...