Mention
Mention - Bootstrap 5 & Material Design components
Responsive Mention plugin built with the latest Bootstrap 5. Mention is an autocomplete dropdown menu for your search inputs. It is useful for tagging items or topics.
Note: Read the API tab to find all available options and advanced customization
Basic example
Type @ and use up/down arrows, home/end keys to navigate. Click enter or use mouse click to choose item
Toggle show list on trigger
Showing all items on trigger key is turned on by default. Set
showListOnTrigger
option to false
to turn it off and show items only
after user search input
Placement example
Use placement
options to change placement of the component
Position of the component will be flipped to opposite side when no free space is available. Once enough space is detected, component will flip back to its original placement
Textarea example
Mention works also with textarea
Customize search conditions
Use queryBy
option to change search conditions
Customize no results text
Set noResultsText
to a text of your choice to change the message for no results
found
Trigger sign
Use trigger
option to change search triggering sign
Show image
Use showImg
option to show images in the mentions list
Visible items
Use visibleItems
option to change the number of options that will be displayed in
the select dropdown without scrolling.
Multiple lists
Assign multiple mentions to the element by giving each mention different trigger key
Async
Use disableFilter
option to disable filtering by directive and use asynchronous data loading
Mention - API
Installation
To install and configure the plugin follow our Plugins Installation Guide. Please remember to update all the plugin names and import paths. You can find all the necessary information in the Import section.
Import
Inputs
Name | Type | Default | Description |
---|---|---|---|
items |
Array | '[]' |
An array of items to display on the list. Each user should contain the required
username key value. Other key values are optional e.g. user ,
image
|
noResultText
|
String | 'No results found' |
The text that will be displayed when no item is found after using mention filter |
trigger
|
String | '@' |
Changes trigger sign that allows to search for items |
queryBy
|
String | 'name' |
Changes the key by which list will be rendered and filtered |
placement
|
String | 'bottom' |
Changes placement of the component relative to the reference element |
showListOnTrigger
|
Boolean | 'true' |
Specifies whether whole list has to be opened before search input |
showImg
|
Boolean | 'true' |
Displays user image on the list |
asyncError
|
Boolean | 'false' |
Allows to manually show an error in a dropdown list |
showNoResultText
|
Boolean | 'true' |
Specifies whether the built-in 'no results' error should be displayed if there is no results |
outputKey
|
String | '' |
Changes the key by which chosen item will be insterted into the input/textarea |
disableFilter
|
Boolean | 'false' |
Disables filtering to enable client side and dynamic filtering of items |
visibleItems
|
Number | 5 |
The maximum number of items which are visible in the mention dropdown without scrolling. |
Outputs
Name | Type | Description |
---|---|---|
mentionOpen
|
EventEmitter<void> | This output fires immediately when the mention is opened. |
mentionClose
|
EventEmitter<void> | This output fires immediately when the mention is closed. |
mentionSelect
|
EventEmitter<any> | This output fires immediately when the list item is selected |
mentionChange
|
EventEmitter<MdbMentionChange> | This output fires immediately when the mention reference element value changes |
Methods
Name | Description | Example |
---|---|---|
open |
Manually opens a mention | mention.open() |
close |
Manually close a mention | mention.close() |