Overview
The editor and all plugins are headless by default: they define structure and behavior but do not ship UI for how block elements look. You can keep them headless (e.g. for custom design) or attach styled UI from a theme package. Available themes:@yoopta/themes-shadcn— Shadcn UI styled components (production ready)@yoopta/themes-material— Material Design styled components (in progress)
applyTheme(), or attach theme UI to individual plugins via plugin.extend({ elements: ThemeUI }).
Concept: headless + optional UI
Plugins define their block type, elements, and behavior; they do not require any specific look. Theme packages export:- Per-plugin UI objects — e.g.
CalloutUIfrom@yoopta/themes-shadcn/callout, which you pass intoCallout.extend({ elements: CalloutUI }). applyTheme(plugins)— a helper that applies the theme’s UI to every supported plugin in the array in one go.
- Use plugins as-is (headless) and render elements yourself.
- Use theme UI for a single plugin:
Callout.extend({ elements: CalloutUI }). - Use theme UI for all plugins:
applyTheme([Paragraph, Callout, ...]).
Apply theme to all plugins
UseapplyTheme() from a theme package to wrap your plugin list; the theme will attach its styled elements to every plugin it supports.
plugins (the result of applyTheme) into createYooptaEditor. The theme’s CSS is applied by the package; you don’t pass plugins or marks to <YooptaEditor>.
Apply theme UI to a single plugin
If you only want themed UI for specific plugins, import the theme’s UI object for that plugin and extend the plugin withelements.
Example: Callout with Shadcn UI
CalloutWithUI in your plugins array; other plugins can stay headless or use other themes.
Subpaths are available per plugin, for example:
@yoopta/themes-shadcn/callout→CalloutUI@yoopta/themes-shadcn/paragraph→ParagraphUI@yoopta/themes-shadcn/embed→EmbedUI- …and other plugins supported by the theme
@yoopta/themes-shadcn
Production-ready theme based on Shadcn UI. It provides styled elements for paragraph, headings, lists, blockquote, callout, code, image, video, embed, file, table, tabs, steps, accordion, carousel, divider, link, mention, and table-of-contents. Install@yoopta/themes-material
Material Design styled components for Yoopta plugins. In progress — not all plugins may be covered yet. InstallapplyTheme(plugins) or plugin.extend({ elements: MaterialUI }) per plugin when the package exposes it).
Summary
| Approach | Use case |
|---|---|
| Headless | Custom design; you implement all element UI. |
plugin.extend({ elements: ThemeUI }) | Use theme UI only for specific plugins. |
applyTheme(plugins) | Use theme UI for all supported plugins at once. |