Skip to content

stechstudio/laravel-tiptap

Repository files navigation

A TALL-stack implementation of the Tiptap WYSYWIG editor.

Installation

You can install the package via composer:

composer require stechstudio/laravel-tiptap

The service provider will be automatically wired up for you.

Include Javascript resources

The following packages must be installed.

Tailwind:

npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

TipTap Starter Kit:

npm install @tiptap/starter-kit

TipTap Extension Link:

npm install @tiptap/extension-link

TipTap Extension Color:

npm install @tiptap/extension-color

TipTap Extension Text Style:

npm install @tiptap/extension-text-style

You also need to have Alpine.js and the TipTap editor already installed.

Alpine.js:

npm install alpinejs

TipTap Core:

npm install @tiptap/core

In your app.js file, add the following boilerplate to get up and running.

import { Editor } from "@tiptap/core";
import StarterKit from "@tiptap/starter-kit";
import Link from "@tiptap/extension-link";
import TextStyle from "@tiptap/extension-text-style";
import Color from "@tiptap/extension-color";
import Alpine from 'alpinejs';

window.Editor = Editor;
window.StarterKit = StarterKit;
window.Link = Link;
window.TextStyle = TextStyle;
window.Color = Color;
window.Alpine = Alpine;

Alpine.start();

This will make use of the previously mentioned packages.

Usage

Within your Livewire component view, add the TipTap editor component and bind it to your desired Livewire property as usual:

<x-tiptap::editor wire:model="message.body" id="body" name="body" />

Customization

The editor view may be customized by publishing the views into your application's resources/views/vendor folder.

php artisan vendor:publish --tag=tiptap-views

License

The MIT License (MIT). Please see License File for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published