mui-tiptap
Version:
A Material-UI (MUI) styled WYSIWYG rich text editor, using Tiptap
43 lines (42 loc) • 1.82 kB
TypeScript
import { type SxProps } from "@mui/material/styles";
import { type EditorContentProps } from "@tiptap/react";
import { type RichTextContentClasses } from "./RichTextContent.classes";
export type RichTextContentProps = {
/**
* Optional ref to provide to the EditorContent DOM element.
*
* Only available in Tiptap >= 2.2.0, hence the conditional type
* (https://github.com/ueberdosis/tiptap/commit/fd8d4c090183a0d6106250a4a1c3f522283244e7).
*/
innerRef?: EditorContentProps extends {
innerRef?: infer T;
} ? T : never;
/**
* Whether to disable all default styles applied to the rich text content.
*
* Useful if you want to apply your own styles instead, or simply inherit
* external page styles.
*
* Warning: several utility styles will also be omitted if you disable default
* styles. (For instance, these handle table editability, displaying content
* from the Placeholder extension, etc. such as the styles here:
* https://github.com/sjdemartini/mui-tiptap/blob/7c94b6860a66835c35b9a7a5994fa773202654ac/src/styles.ts#L370-L417.)
* You may need to add equivalent CSS back yourself depending on the
* extensions you use.
*/
disableDefaultStyles?: boolean;
/** Optional additional className to provide to the root element. */
className?: string;
/** Override or extend existing styles. */
classes?: Partial<RichTextContentClasses>;
/** Provide custom styles. */
sx?: SxProps;
};
/**
* A component for rendering a MUI-styled version of Tiptap rich text editor
* content.
*
* Must be a child of the RichTextEditorProvider so that the `editor` context is
* available.
*/
export default function RichTextContent(inProps: RichTextContentProps): import("react/jsx-runtime").JSX.Element;