Skip to content

jakobjohansson/react-marky-markdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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;
  onChange?(value: string): void;
  onSubmit?(): void;
  onBlur?(): void;
  onCancel?(): void;
}

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

Packages

No packages published

Languages

  • TypeScript 92.4%
  • CSS 3.9%
  • HTML 2.5%
  • JavaScript 1.2%