Extended image extension for tiptap, adding support for alignment and scaling.
npx shadcn add https://tiptap.niazmorshed.dev/r/image.json
@lib/utils.ts
export const NODE_HANDLES_SELECTED_STYLE_CLASSNAME = "node-handles-selected-style"; export function isValidUrl(url: string) { return /^https?:\/\/\S+$/.test(url); }
const extensions = [ StarterKit.configure({ // ... }), ImageExtension, ImagePlaceholder, ]; const editor = useEditor({ extensions, });
On This Page