Embed block plugin for Yoopta Editor. Renders embed blocks for URLs (e.g. YouTube, Vimeo, Twitter, Figma). Use headless or with theme UI from @yoopta/themes-shadcn.
yarn add @yoopta/embedPass the plugin to createYooptaEditor. Do not pass plugins to <YooptaEditor>.
import { useMemo } from 'react';
import YooptaEditor, { createYooptaEditor } from '@yoopta/editor';
import Embed from '@yoopta/embed';
const plugins = [Embed];
export default function Editor() {
const editor = useMemo(() => createYooptaEditor({ plugins, marks: [] }), []);
return <YooptaEditor editor={editor} onChange={() => {}} />;
}import { applyTheme } from '@yoopta/themes-shadcn';
const plugins = applyTheme([Paragraph, Embed, /* ... */]);Or: Embed.extend({ elements: EmbedUI }) with EmbedUI from @yoopta/themes-shadcn/embed.
Embed.extend({
elements: {
embed: { render: (props) => <YourEmbedBlock {...props} /> },
},
options: {
display: { title: 'Embed', description: 'Embed a link' },
},
});See Embed plugin docs.