New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mui-tiptap-editor

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mui-tiptap-editor

Tiptap WYSIWYG rich text editor using Material UI (MUI)

  • 0.4.0
  • npm
  • Socket score

Version published
Weekly downloads
120
increased by16.5%
Maintainers
1
Weekly downloads
 
Created
Source

mui-tiptap-editor!

mui-tiptap-editor: A customizable and easy to use Tiptap styled WYSIWYG rich text editor, using Material UI.

Files

StackEdit stores your files in your browser, which means all your files are automatically saved locally and are accessible offline!

Table of Contents

Installation


npm  install  mui-tiptap-editor

or


yarn  add  mui-tiptap-editor

Get started

Simple usage
import { TextEditor, TextEditorReadOnly } from 'mui-tiptap-editor';
import { useState } from "react";

function App() {
  const [value, setValue] = useState<string>("");

  const handleChange = (newValue: string) => setValue(newValue);

  return (
    <div>
      <TextEditor value={value} onChange={handleChange} />
      {value && <TextEditorReadOnly value={value} />}
    </div>
  );
}

See example/App.tsx for a more thorough example of using TextEditor.

Customization

Toolbar

Can display the menus as needed

  import { TextEditor } from 'mui-tiptap-editor';

  function App() {
    return (
      <TextEditor toolbar={['bold', 'italic', 'underline']} />
    );
  }

Styles

Root styles
import './index.css';

function App () {
  return (
    <TextEditor
      value="<p>Hello word!</p>"
      rootClassName="root"
    />
  )
}
/* ./index.css */
.root {
  background-color: #fff;
}
.root  .MuiTab-root.Mui-selected {
  background-color: yellow  !important;
}
Each element styles
import './index.css';

function App () {
  return (
    <TextEditor
      value="<p>Hello word!</p>"
      label="Content"
      tabClassName="my-tab"
      labelClassName="my-label"
      inputClassName="my-input"
    />
  )
}
/* ./index.css */
.my-tab.MuiTab-root.Mui-selected {
  background-color: pink !important;
}

.my-label {
  color: blue !important;
}

.my-input {
  border: 1px solid green;
}

Props

propstypeDefault valueDescription
toolbarstring[]heading, bold, italic, strike, link, underline, image, code, orderedList, bulletList, align, codeBlock, blockquote, table, history, youtube, color, mention, aiThe list of the menu buttons to be displayed
placeholderstringemptyinput placeholder
labelstringemptyinput label
errorstringemptyError message to display
withFloatingMenubooleanfalseShow or hide the floating menu
withBubbleMenubooleantrueShow or hide the bubble menu
inputClassNamestringemptyOverride input styles
toolbarClassNamestringemptyOverride the toolbar menu styles
tabsClassNamestringemptyOverride the tabs (preview, editor) styles
tabClassNamestringemptyOverride the tab (preview or editor) styles
errorClassNamestringemptyOverride the error message styles
rootClassNamestringemptyOverride the main container styles
labelClassNamestringemptyOverride the label styles
bubbleMenuToolbarstring[]['bold', 'italic', 'underline', 'link']Similar to toolbar props
floatingMenuToolbarstring[]['bold', 'italic', 'underline', 'link']Similar to toolbar props
valuestringemptyValue of the input
onChange(value: string) => voidemptyFunction to call when the input change
...all tiptap featuresEditorOptionsemptyCan access to all tiptap useEditor props

Keywords

FAQs

Package last updated on 30 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc