https://github.com/htmujahid/shadcn-editor
Lexical base rich text editor using shadcn/ui components
https://github.com/htmujahid/shadcn-editor
editor lexical rich-text rich-text-editor shadcn shadcn-editor shadcn-lexical wysiwyg
Last synced: 18 days ago
JSON representation
Lexical base rich text editor using shadcn/ui components
- Host: GitHub
- URL: https://github.com/htmujahid/shadcn-editor
- Owner: htmujahid
- Created: 2024-11-04T07:28:06.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-05-12T17:16:23.000Z (21 days ago)
- Last Synced: 2025-05-12T18:29:17.833Z (21 days ago)
- Topics: editor, lexical, rich-text, rich-text-editor, shadcn, shadcn-editor, shadcn-lexical, wysiwyg
- Language: TypeScript
- Homepage: https://shadcn-editor.vercel.app
- Size: 3.48 MB
- Stars: 604
- Watchers: 5
- Forks: 44
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-shadcn-ui - Link - 11-08 | (Libs and Components)
- awesome-shadcn-ui - shadcn-editor - Lexical editor using shadcn theme and components. (Libs and Components)
- awesome-shadcn-ui - shadcn-editor - Lexical editor using shadcn theme and components. (Libs and Components)
README
# Shadcn Editor
## Usage
1. Run this command to setup batteries included editor.
```bash
npx shadcn@latest add https://shadcn-editor.vercel.app/r/editor-x.json
```2. Use the `Editor` component in your project.
```tsx
'use client'import { useState } from 'react'
import { SerializedEditorState } from 'lexical'
import { Editor } from '@/components/blocks/editor-x/editor'
const initialValue = {
root: {
children: [
{
children: [
{
detail: 0,
format: 0,
mode: 'normal',
style: '',
text: 'Hello World 🚀',
type: 'text',
version: 1,
},
],
direction: 'ltr',
format: '',
indent: 0,
type: 'paragraph',
version: 1,
},
],
direction: 'ltr',
format: '',
indent: 0,
type: 'root',
version: 1,
},
} as unknown as SerializedEditorStateexport function EditorDemo() {
const [editorState, setEditorState] =
useState(initialValue)return (
setEditorState(value)}
/>
)
}
```## Start History
[](https://star-history.com/#bytebase/star-history&Date)