Tiptap v3 rich-text editing for Phoenix LiveView.
Tiptapex packages a full editor integration:
Tiptapex.Components—tiptapex_editor/1andtiptapex_viewer/1HEEx function components backed by theTiptapexEditor/TiptapexViewerJS hooks shipped inside this package.Tiptapex.Renderer— converts ProseMirror/Tiptap JSON documents to safe, escaped HTML on the server, so you never have to trust client-generated HTML.Tiptapex.Upload— a behaviour plusTiptapex.Upload.Controllermacro for handling editor file uploads with server-side validation.Tiptapex.Collab— optional realtime collaboration (Yjs) over Phoenix Channels via theTiptapex.Collab.Channelmacro.
JavaScript setup
The JS ships as raw ESM inside the Hex package. Your app bundles it with
its own copy of the @tiptap/* packages (peer dependencies — install
them with npm in assets/). Point esbuild's NODE_PATH at both deps
and assets/node_modules, then:
import { hooks as tiptapex } from "tiptapex"
const liveSocket = new LiveSocket("/live", Socket, {
hooks: { ...otherHooks, ...tiptapex },
})See the README for the full installation walkthrough.
Summary
Functions
Returns true when the given document is nil, empty, or contains no text,
media, or horizontal rules.
Returns an empty Tiptap document.
Delegates to Tiptapex.Renderer.to_html/2.
Delegates to Tiptapex.Renderer.to_plain_text/1.
Functions
Returns true when the given document is nil, empty, or contains no text,
media, or horizontal rules.
@spec empty_doc() :: map()
Returns an empty Tiptap document.
Useful as a default value for new records:
schema "articles" do
field :body, :map, default: Tiptapex.empty_doc()
end
Delegates to Tiptapex.Renderer.to_html/2.
Delegates to Tiptapex.Renderer.to_plain_text/1.