Skip to content

danielbrodin/react-marky-markdown

Folders and files

NameName
Last commit message
Last commit date
Nov 1, 2019
May 12, 2021
Nov 20, 2019
Oct 28, 2019
Oct 24, 2019
Nov 20, 2019
Oct 24, 2019
Nov 1, 2019
Nov 20, 2019
Oct 24, 2019
Oct 25, 2019
May 12, 2021

Repository files navigation

React Marky Markdown

npm version

A clean markdown editor for react.

Currently in beta. Like this readme :)

Usage

yarn add react-marky-markdown

import { Editor, Mention } from 'react-marky-markdown';
// Includes necessary styling
import 'react-marky-markdown/dist/styles.css';

const App = () => {
  return (
    <Editor>
      <Mention
        prefix="@"
        data={[
          { value: 'terminator', label: 'Arnold Schwarzenegger' },
          { value: 'markymark', label: 'Mark wahlberg' },
        ]}
      />
    </Editor>
  );
};

Props

// Editor
{
  defaultValue?: string;
  singleLine?: boolean;
  disableFormatting?: boolean;
  onChange?(value: string): void;
  onSubmit?(): void;
  onBlur?(): void;
  onCancel?(): void;
}

// Mention
{
  prefix: string;
  data: Item[]; // { value: string | number; label: string; }
  onSearch?(value: string): void;
}