Skip to main content
Version: 3.xx.xx

Markdown

This field lets you display markdown content. It supports GitHub Flavored Markdown.

Usage​

Let's see how we can use <MarkdownField> in a show page.

pages/posts/show.tsx
import { useShow } from "@pankod/refine-core";
import {
Show,
Typography,
MarkdownField,
} from "@pankod/refine-mui";

export const PostShow: React.FC = () => {
const { queryResult } = useShow<IPost>();
const { data, isLoading } = queryResult;
const record = data?.data;

return (
<Show isLoading={isLoading}>
<Typography>Id</Typography>
<Typography>{record?.id}</Typography>
<Typography>Content</Typography>
<MarkdownField value={record?.content} />
</Show>
);
};

interface IPost {
id: number;
title: string;
content: string;
}

MarkdownField

API Reference​

Properties​

PropertyDescriptionType
valueMarkdown data to renderstring | undefined

Live StackBlitz Example​