Aslam97 / shadcn-minimal-tiptap

Minimal Tiptap Editor
https://shadcn-minimal-tiptap.vercel.app
MIT License
315 stars 14 forks source link
shadcn-tiptap tiptap-editor

Minimal Tiptap Editor

This is a Minimal Tiptap Editor Component built for Shadcn. It provides a simple and clean editor for users to write and format text.

Installation

Before you can use the Minimal Tiptap Editor Component, you will need to install the following packages:

npm install @tiptap/extension-image @tiptap/extension-link @tiptap/pm @tiptap/react @tiptap/starter-kit
npm install @radix-ui/react-icons
npm install -D @tailwindcss/typography

The Minimal Tiptap Editor Component is depends on the following components from shadcn:

Next, copy and paste the code from the src directory for minimal-tiptap into your project and customize to your needs. The code is yours.

Props

The Minimal Tiptap Editor Component accepts the following props:

Usage

import React, { useState } from 'react'
import { MinimalTiptapEditor } from './minimal-tiptap'

export const App = () => {
  const [value, setValue] = useState('')

  return (
    <MinimalTiptapEditor
      value={value}
      onValueChange={setValue}
      outputValue="json"
      disabled={false}
      contentClass="max-w-3xl mx-auto mt-8"
    />
  )
}

Advanced Template

Tiptap just released a new version 2 of their documentation with a advanced template. You can check it out here.