Download the PHP package marshmallow/nova-tiptap without Composer
On this page you can find all versions of the php package marshmallow/nova-tiptap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nova-tiptap
Laravel Nova Tiptap Editor Field
A rich text editor for Laravel Nova based on tiptap by @ueberdosis.
[!Warning] When updating from
manogi/nova-tiptap
, replace all instances ofManogi\Tiptap\Tiptap
withMarshmallow\Tiptap\Tiptap
.[!IMPORTANT] This is a maintained fork of the original package with Nova 5 support.
Installation
Add the use statement to your Nova resource:
Basic Usage
This provides a simple editor with bold and italic buttons only.
Button Configuration
Create a fully-featured editor by configuring your desired buttons:
Available Buttons
Button | Description |
---|---|
heading |
Text headings (H1, H2, H3, etc.) |
color |
Color text formatting |
backgroundColor |
Background color formatting |
bold |
Bold text formatting |
italic |
Italic text formatting |
strike |
Strikethrough text |
underline |
Underline text |
bulletList |
Unordered/bullet list |
orderedList |
Ordered/numbered list |
link |
Hyperlinks to URLs or files |
code |
Inline code formatting |
codeBlock |
Block code with optional syntax highlighting |
blockquote |
Block quotes |
image |
Insert and upload images |
table |
Create and edit tables |
tableAlternative |
Alternative UI for creating and editing tables. Supports coloring cell's background and border. |
textAlign |
Text alignment options |
rtl |
Right-to-left text direction |
horizontalRule |
Horizontal divider line |
hardBreak |
Hard line break |
history |
Undo/redo functionality |
editHtml |
HTML source code editor |
\| |
Vertical divider in toolbar (special) |
br |
Line break in toolbar (special) |
Feature Configuration
Headings
Links
Images
Text Alignment
Color options
Background color options
Table cell background color options
Table cell border color options
RTL Support
Code Options
Two code formatting options are available:
code
- Inline code formatting (<code>text</code>
)codeBlock
- Block code formatting (<pre><code>text</code></pre>
)
Enable syntax highlighting for code blocks:
HTML Editing
Available themes are listed on CodeMirror's theme demo page.
JSON Storage
Empty Content Sanitization
By default, when a TipTap editor is empty, it returns an empty paragraph with styling (e.g., <p style="text-align: left"></p>
). If you prefer to get an empty string instead (especially useful for translatable fields), you can enable the sanitization feature:
Image Pruning
When enabled, this feature automatically removes uploaded images from storage when they are deleted from the TipTap content. Only images with tt-mode="file"
(uploaded files) will be pruned, not external URLs with tt-mode="url"
.
Enable Globally
First, publish the configuration file:
Then enable image pruning in config/nova-tiptap.php
:
Enable Per Field
You can also enable image pruning for specific fields:
How It Works
The system tracks uploaded images by their tt-mode="file"
attribute. When content is updated:
- It extracts all uploaded image URLs from the old content
- It extracts all uploaded image URLs from the new content
- Images that exist in the old content but not in the new content are deleted from storage
- External images with
tt-mode="url"
are never deleted
Read-Only Mode
The Tiptap field supports Nova's native readonly functionality. When in readonly mode, the editor will display the content without allowing edits:
You can also conditionally set the readonly state:
Index View Visibility
Like other rich text fields, this field is hidden from index views. You can display it using a computed field.
Screenshots
The editor adapts to Nova's theme:
License
The MIT License (MIT). Please see License File for more information.