npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2026 – Pkg Stats / Ryan Hefner

@yoopta/editor

v6.0.1

Published

<h2 align="center">Yoopta-Editor v1 πŸŽ‰</h2> <p align="center">Yoopta-Editor - is an open source notion-like editor πŸ’₯</p> <div align="center"> <img width="574" alt="Screen Shot 2023-01-25 at 16 04 29" src="https://user-images.githubusercontent.com/2909311

Readme

@yoopta/editor

Core headless package for Yoopta Editor. Provides the editor instance, block/element/mark logic, and React component. Plugins and marks are passed to createYooptaEditor; UI (toolbars, slash menu, block actions) is rendered as children of <YooptaEditor> from @yoopta/ui.

Installation

yarn add slate slate-react slate-dom @yoopta/editor

Peer dependencies: slate, slate-react, slate-dom.

Quick Start

Plugins, marks, and optional initial value are passed to createYooptaEditor. The component receives only the editor instance and callbacks.

import { useMemo } from 'react';
import YooptaEditor, { createYooptaEditor, type YooptaContentValue } from '@yoopta/editor';
import Paragraph from '@yoopta/paragraph';
import { Bold, Italic } from '@yoopta/marks';

const plugins = [Paragraph];
const marks = [Bold, Italic];
const initialValue = {} as YooptaContentValue;

export default function Editor() {
  const editor = useMemo(
    () => createYooptaEditor({ plugins, marks, value: initialValue }),
    [],
  );

  return (
    <YooptaEditor
      editor={editor}
      placeholder="Type / to open menu"
      onChange={(value) => console.log(value)}
    />
  );
}

To add toolbar and slash menu, install @yoopta/ui and render them as children of <YooptaEditor>:

import { FloatingToolbar, FloatingBlockActions, SlashCommandMenu } from '@yoopta/ui';

<YooptaEditor editor={editor} onChange={onChange} placeholder="Type / to open menu">
  <FloatingToolbar />
  <FloatingBlockActions />
  <SlashCommandMenu />
</YooptaEditor>

YooptaEditor props

| Prop | Type | Description | |------|------|-------------| | editor | YooEditor | Required. Instance from createYooptaEditor. | | onChange | (value, options) => void | Called when content changes. | | onPathChange | (path) => void | Called when the current block path changes. | | autoFocus | boolean | Focus editor on mount. Default: true. | | className | string | Additional CSS class (default: .yoopta-editor). | | style | CSSProperties | Inline styles (e.g. { width: 750, paddingBottom: 100 }). | | placeholder | string | Placeholder when the editor is empty. | | children | ReactNode | UI components (toolbar, slash menu, block actions, etc.). | | renderBlock | (props) => ReactNode | Custom wrapper per block (e.g. for drag-and-drop). |

Initial content is set via createYooptaEditor({ value }) or later with editor.setEditorValue(value). Do not pass plugins, marks, or value to <YooptaEditor>.

createYooptaEditor options

createYooptaEditor({
  plugins: YooptaPlugin[];   // required
  marks?: YooptaMark[];      // optional
  value?: YooptaContentValue;
  readOnly?: boolean;
  id?: string;
});

Editor API (YooEditor)

  • Content: getEditorValue(), setEditorValue(value)
  • Blocks: insertBlock, updateBlock, deleteBlock, duplicateBlock, toggleBlock, moveBlock, focusBlock, mergeBlock, splitBlock, increaseBlockDepth, decreaseBlockDepth, getBlock
  • Transforms: applyTransforms([{ type: 'validate_block_paths' }])
  • History: undo(), redo(), batchOperations(fn)
  • Events: on, off, once, emit β€” events: change, focus, blur, path-change, block:copy
  • Parsers: getHTML(value), getMarkdown(value), getPlainText(value), getEmail(value, options)
  • Focus: focus(), blur(), isFocused()
  • Element builder: editor.y for building block/element structures programmatically

Namespace APIs

Use these for programmatic control (e.g. inside toolbar or custom UI):

import { Blocks, Elements, Marks, Selection } from '@yoopta/editor';

// Block operations
Blocks.insertBlock(editor, { ... });
Blocks.updateBlock(editor, { ... });
Blocks.deleteBlock(editor, { ... });
Blocks.getBlock(editor, { id: blockId });

// Element operations (within a block)
Elements.insertElement(editor, { ... });
Elements.updateElement(editor, { ... });
Elements.getElement(editor, { ... });

// Text formatting (marks)
Marks.toggle(editor, { type: 'bold' });
Marks.isActive(editor, { type: 'bold' });

Hooks

Must be used inside a component that is a child of <YooptaEditor> (e.g. inside toolbar or block actions).

| Hook | Description | |------|-------------| | useYooptaEditor() | Returns the editor instance. | | useYooptaReadOnly() | Returns whether the editor is read-only. | | useYooptaFocused() | Returns whether the editor is focused. | | useBlockData(blockId) | Returns block data for the given blockId. | | useYooptaPluginOptions(blockType) | Returns options for the plugin of the given block type. |

Related packages

  • @yoopta/ui β€” FloatingToolbar, SlashCommandMenu, FloatingBlockActions, BlockOptions, SelectionBox, BlockDndContext, SortableBlock
  • @yoopta/themes-shadcn β€” Styled block UI; use applyTheme(plugins) or extend a single plugin with theme elements
  • @yoopta/marks β€” Bold, Italic, Underline, Strike, CodeMark, Highlight, etc.
  • @yoopta/paragraph, @yoopta/headings, @yoopta/code, etc. β€” Block plugins

See the main README and Quickstart for full setup with themes and UI.