
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
Mention plugin for last-draft
npm install ld-mention --save
import {Editor} from 'last-draft'
import mention from 'ld-mention'
let plugins = [mention]
const mentionUsers = [
{
name: 'Steven Iseki',
link: 'https://github.com/steveniseki',
avatar: 'https://avatars1.githubusercontent.com/u/6695114?v=3&s=400',
},
{
name: 'Nik Graf',
link: 'https://github.com/nikgraf',
avatar: 'https://avatars2.githubusercontent.com/u/223045?v=3&s=400',
}
]
export default class ExampleEditor extends Component {
constructor(props) {
super(props)
const INITIAL_STATE = editorStateFromHtml('<div></div>')
this.state = { value: INITIAL_STATE }
}
onChange(editorState) {
this.setState({ value: editorState })
}
render() {
return (
<Editor
inline={['bold', 'italic', 'code', 'dropcap']}
blocks={['h2', 'quote']}
plugins={plugins}
mentionUsers={mentionUsers}
editorState={this.state.value}
onChange={::this.onChange} />
)
}
}
You can pass your mention users to mentionUsers in the Editor, or pass to mentionUsersAsync a function that returns the list users for mentions functionality on change of the searchValue.
const mentionUsersAsync = function (searchValue, cb) {
return new Promise(
(resolve, reject) => {
let url = `https://api.github.com/search/users?q=${searchValue}`
fetch(url)
.then( (response) => { return response.json() })
.then((data) => {
let users = data.items.map( (u, i) => { return { name: u.login, link: u.html_url, avatar: u.avatar_url } })
resolve({ mentionUsers: users })
})
}
)
}
Last Draft plugins use styled-components 💅 for the base styling.
You can also add custom css to override the base styling with the following class names specified below:
.ld-mention-wrapper {}
.ld-mention {}
.ld-mention-list {}
.ld-mention-autocomplete {}
.ld-mention-menu {}
.ld-mention-menu-list {}
.ld-mention-item {}
.ld-mention-avatar {}
.ld-mention-name {}
FAQs
Last Draft mention plugin
We found that ld-mention demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.