Skip to content

Latest commit

 

History

History
 
 

editor-social

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

@remirror/editor-social

npm bundle size (scoped) npm

A configurable editor which replicates a social editors behaviour.

Usage

The following editor would add emoji characters as valid prefix characters when typing the @ key in the editor.

import emojiRegex from 'emoji-regex';
import { SocialEditor } from '@remirror/editor-social';
const Editor = props => (
  <SocialEditor
    {...props}
    attributes={{ 'data-testid': 'editor-social' }}
    userData={[]}
    tagData={[]}
    onMentionChange={onChange}
    atMatcherOptions={{
      // Adds emoji characters the the valid prefix characters.
      validPrefixCharacters: `^([\\s\\0]|${emojiRegex().source})?$`,
    }}
  />
);

Installation

yarn add @remirror/editor-social