The @yoopta/ui package provides a collection of headless UI components that give you complete control over your editor’s interface. These components follow modern design patterns and best practices, offering flexibility and customization while maintaining excellent developer experience.
Starting with Yoopta Editor v4.10+, the core @yoopta/editor is completely headless. All
UI components have been moved to the separate @yoopta/ui package, giving you full control over
appearance and behavior.
Import only what you need using subpath exports for better tree-shaking and smaller bundles:
Copy
// Only import the toolbar (smaller bundle)import { Toolbar, useToolbar } from '@yoopta/ui/toolbar';// Only import action menu listimport { ActionMenuList, useActionMenuList } from '@yoopta/ui/action-menu-list';// Only import slash command menuimport { SlashCommandMenu, useSlashCommand } from '@yoopta/ui/slash-command-menu';// Other available subpathsimport { FloatingBlockActions } from '@yoopta/ui/floating-block-actions';import { BlockOptions } from '@yoopta/ui/block-options';import { SelectionBox } from '@yoopta/ui/selection-box';import { HighlightColorPicker } from '@yoopta/ui/highlight-color-picker';import { Portal } from '@yoopta/ui/portal';import { Overlay } from '@yoopta/ui/overlay';import { ThemeProvider, useTheme } from '@yoopta/ui/theme';
Full Hook - For the component that renders the UI (includes Floating UI, event listeners, etc.)
Lightweight Hook - For other components that just need to interact with the UI
Copy
// In component that renders UIconst { isOpen, getRootProps, getItemProps } = useToolbar();// In other components that need to control itconst { open, close } = useToolbarActions();
UI components use Zustand for state management, allowing:
✅ Shared state across components
✅ Singleton stores (one instance per component type)
✅ Programmatic control from anywhere
✅ Lightweight and performant
Copy
// Open BlockOptions from any componentconst { open } = useBlockOptionsActions();open({ reference: element, blockId: 'block-123' });// The BlockOptions component will automatically show