# ra-input-markdown

> [![npm](https://img.shields.io/npm/dm/ra-input-markdown)](https://www.npmjs.com/package/ra-input-markdown) [![npm](https://img.shields.io/npm/v/ra-input-markdown)](https://www.npmjs.com/package/ra-input-markdown)

Latest version **1.4.0** (published 2021-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install ra-input-markdown
pnpm add ra-input-markdown
yarn add ra-input-markdown
bun add ra-input-markdown
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2021-10-04 |
| First published | 2019-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Michael Malura |
| Maintainers | maluramichael |

## Links

- npm: https://www.npmjs.com/package/ra-input-markdown
- Repository: https://github.com/maluramichael/ra-input-markdown
- Homepage: https://github.com/maluramichael/ra-input-markdown#readme
- Issues: https://github.com/maluramichael/ra-input-markdown/issues
- npm.io page: https://npm.io/package/ra-input-markdown

## Dependencies (5)

- [showdown](https://npm.io/package/showdown.md) ^1.9.1
- [react-mde](https://npm.io/package/react-mde.md) ^11.5.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [react-admin](https://npm.io/package/react-admin.md) ^3.18.1
- [react-markdown](https://npm.io/package/react-markdown.md) ^7.0.1

## Recent versions

- 1.4.0 (latest) — 2021-10-04
- 1.3.0 — 2021-09-11
- 1.2.1 — 2021-09-09
- 1.2.0 — 2021-08-09
- 1.1.7 — 2020-07-06
- 1.1.6 — 2020-07-06
- 1.1.5 — 2020-03-04
- 1.1.2 — 2020-03-04
- 1.1.3 — 2019-11-07
- 1.1.1 — 2019-11-07
- 1.0.2 — 2019-06-16
- 1.0.1 — 2019-05-08
- 1.0.0 — 2019-05-08

## README

# `<MarkdownInput>` for react-admin

[![npm](https://img.shields.io/npm/dm/ra-input-markdown)](https://www.npmjs.com/package/ra-input-markdown) [![npm](https://img.shields.io/npm/v/ra-input-markdown)](https://www.npmjs.com/package/ra-input-markdown)

For editing Markdown with [react-admin](https://github.com/marmelab/react-admin), use the `<MarkdownInput>` component. It uses [react-med](https://github.com/andrerpena/react-mde), a popular React Markdown Editor.

![`<MarkdownInput>` example](/screenshot.png?raw=true)

## Installation

```sh
npm install --save ra-input-markdown
# or
yarn add ra-input-markdown
```

## Usage

```js
import React from 'react';
import {
    DateInput,
    Edit,
    EditButton,
    LongTextInput,
    TextInput,
} from 'react-admin';
import MarkdownInput from 'ra-input-markdown';

const PostTitle = ({ record }) => {
    return <span>Post {record ? `"${record.title}"` : ''}</span>;
};

export const PostEdit = (props) => (
    <Edit title={<PostTitle />} {...props}>
        <DisabledInput label="Id" source="id" />
        <TextInput source="title" validation={{ required: true }} />
        <LongTextInput source="teaser" validation={{ required: true }} />
        <MarkdownInput source="body" />
        <DateInput label="Publication date" source="published_at" />
    </Edit>
);
```

---
_Source: https://npm.io/package/ra-input-markdown · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
