Typedef

MentionFeedItem (mention)

@ckeditor/ckeditor5-mention/src/mention

typedef
Object | String

The mention feed item. It may be defined as a string or a plain object.

When defining a feed item as a plain object, the id property is obligatory. Additional properties can be used when customizing the mention feature bahavior (see "Customizing the autocomplete list" and "Customizing the output" sections).

ClassicEditor
	.create( editorElement, {
		plugins: [ Mention, ... ],
		mention: {
			feeds: [
				// Feed items as objects.
				{
					marker: '@',
					feed: [
						{
							id: '@Barney',
							fullName: 'Barney Bloom'
						},
						{
							id: '@Lily',
							fullName: 'Lily Smith'
						},
						{
							id: '@Marshall',
							fullName: 'Marshall McDonald'
						},
						{
							id: '@Robin',
							fullName: 'Robin Hood'
						},
						{
							id: '@Ted',
							fullName: 'Ted Cruze'
						},
						// ...
					]
				},

				// Feed items as plain strings.
				{
					marker: '#',
					feed: [ 'wysiwyg', 'rte', 'rich-text-edior', 'collaboration', 'real-time', ... ]
				},
			]
		}
	} )
	.then( ... )
	.catch( ... );

Filtering

Properties

  • id : String

    A unique ID of the mention. It must start with the marker character.

  • text : String

    Text inserted into the editor when creating a mention.