Skip to main content

Hashtag Plugin

Hashtag plugin allow the user to add Hashtags

This is #Hashtag, try to add one yourself

Usage#

/* Editor */
import { RicosEditor } from 'ricos-editor';
import { pluginHashtag } from 'wix-rich-content-plugin-hashtag';
<RicosEditor plugins={[pluginHashtag(HashtagConfig)]} />;
/* Viewer */
import { RicosViewer } from 'ricos-viewer';
import { pluginHashtag } from 'wix-rich-content-plugin-hashtag/viewer';
<RicosViewer plugins={[pluginHashtag(HashtagConfig)]} />;

Hashtag Config API#

createHref#

Converter function that converts the Hashtag #text to URL. if provided, the hashtags will behave as anchor links

createHref?: (text: string) => string;

Default value:

none;

onClick#

Optional Hashtag click handler

onClick?: (event: React.MouseEvent<HTMLElement>, text: string) => void;

Default value:

none;