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

blocknote-native-editor

v0.0.3

Published

A pure-native BlockNote-compatible editor for React Native, without a WebView.

Readme

blocknote-native-editor

A pure-native, iOS-first block editor for React Native and Expo. It uses UITextView, TextKit, React Native Fabric, and a headless ProseMirror document engine. It does not use a WebView.

Early preview: iOS and the React Native New Architecture are required. Android and Expo Go are not currently supported.

Requirements

  • React Native 0.82 or newer.
  • React 19 or newer.
  • The React Native New Architecture.
  • An Expo development build or a bare React Native iOS app.

The package is tested by its example app with Expo SDK 57 and React Native 0.86.

Install in an Expo app

npm install blocknote-native-editor
npx expo install expo-dev-client

Ensure the New Architecture and an iOS bundle identifier are configured:

{
  "expo": {
    "newArchEnabled": true,
    "ios": {
      "bundleIdentifier": "com.example.myapp"
    }
  }
}

Create an EAS development client:

npx eas-cli build --profile development --platform ios

Then start Metro for the installed client:

npx expo start --dev-client

Expo Go cannot load this package because it includes custom native iOS code. Native package upgrades require a new development build. JavaScript-only app changes can reload through Metro.

No Expo config plugin or manual Podfile changes are required. React Native autolinking discovers the podspec and Fabric Codegen specification.

Basic usage

import {
  BlockNoteView,
  useCreateBlockNote,
} from "blocknote-native-editor";
import { StyleSheet, View } from "react-native";

export default function EditorScreen() {
  const editor = useCreateBlockNote({
    documentId: "notes-main",
    initialContent: [
      { type: "heading", props: { level: 1 }, content: "Notes" },
      { type: "paragraph", content: "Start writing…" },
      { type: "bulletListItem", content: "A bullet" },
      { type: "numberedListItem", content: "A numbered item" },
      {
        type: "toggleListItem",
        content: "Expandable notes",
        children: [{ type: "paragraph", content: "Hidden details" }],
      },
      {
        type: "image",
        props: { url: "https://example.com/image.png", caption: "Example" },
      },
    ],
  });

  return (
    <View style={styles.screen}>
      <BlockNoteView editor={editor} style={styles.editor} />
    </View>
  );
}

const styles = StyleSheet.create({
  screen: {
    flex: 1,
    padding: 16,
    backgroundColor: "#f5f6f8",
  },
  editor: {
    flex: 1,
    backgroundColor: "#ffffff",
    borderColor: "#dfe3e8",
    borderRadius: 12,
    borderWidth: 1,
  },
});

BlockNoteView must receive a stable editor instance. Use useCreateBlockNote() or create and retain one BlockNoteEditor manually. Pass a stable documentId when an app has multiple documents; native toggle expansion state is persisted separately for each document.

Styling

BlockNoteView accepts normal React Native view styles for its outer container:

<BlockNoteView
  editor={editor}
  style={{ flex: 1, backgroundColor: "white", borderRadius: 12 }}
/>

Block-level color and alignment are stored in the document:

const editor = useCreateBlockNote({
  initialContent: [
    {
      type: "paragraph",
      props: {
        textColor: "#243047",
        backgroundColor: "#f4f7ff",
        textAlignment: "center",
      },
      content: [
        {
          type: "text",
          text: "Styled native text",
          styles: { bold: true, textColor: "#7c3aed" },
        },
      ],
    },
  ],
});

Supported inline styles are bold, italic, underline, strike, code, text color, background color, and links. Font families, font sizes, editor insets, paragraph spacing, and list indentation are currently native defaults and do not yet have a public theme prop.

Editor controls

Toolbars are regular React Native UI. Call the editor API from button handlers:

const current = editor.getTextCursorPosition().block;

editor.updateBlock(current, { type: "heading", props: { level: 2 } });
editor.nestBlock();
editor.unnestBlock();
editor.moveBlocksUp();
editor.moveBlocksDown();
editor.undo();
editor.redo();
editor.focus();
editor.blur();

Set editable={false} to render a read-only editor:

<BlockNoteView editor={editor} editable={false} style={{ flex: 1 }} />

Save and load JSON

editor.document is the canonical BlockNote-style document. Serialize it for your API, database, or local storage:

const json = editor.getDocumentJSON({ pretty: true });

editor.loadDocumentJSON(json, {
  addToHistory: false,
  origin: "system",
});

Listen for document changes:

const unsubscribe = editor.onChange((currentEditor) => {
  const json = currentEditor.getDocumentJSON();
  console.log(json);
});

unsubscribe();

Parsing normalizes partial blocks, rejects unsupported block types and duplicate IDs, and guarantees at least one paragraph for an empty document.

Supported blocks

  • Paragraphs.
  • Headings with levels 1–6, including toggle headings via isToggleable.
  • Bullet list items.
  • Numbered list items, including nested numbering and a custom start prop.
  • Toggle list items with collapsible children.
  • File, image, video, and audio blocks with BlockNote-compatible props.
  • Arbitrarily nested child blocks.

Media blocks use content: undefined, matching BlockNote JSON. Tap an empty media block to choose an item from Photos or Files, or enter a URL. Picked files are copied into the app's Application Support directory. Images render inline with loading and failure states. Audio and video open in the native system player without leaving the app; file URLs open through iOS. Tap a populated media block once to select and again to open it. A selected media block can be removed with Backspace/Delete, and Return inserts a paragraph after it.

Toggle controls use a 44-point minimum hit target and expose an accessibility action. Their expansion state is local UI state and is not written into BlockNote document JSON.

Rendering performance

The native view tracks document revisions separately from selection revisions. Selection-only updates do not rebuild attributed content, native text edits are acknowledged without rerendering when the optimistic text already matches, and non-structural API updates patch only changed visible blocks. Insertions, removals, moves, nesting changes, and toggle visibility changes safely fall back to a full document render. Selection state also crosses the native bridge as a small payload, so the full block projection is serialized only after document changes.

Bare React Native

After installing the package, install CocoaPods and rebuild the iOS app:

cd ios
pod install
cd ..

Headless core

Consumers that only need the document engine can avoid importing the native view:

import { BlockNoteEditor } from "blocknote-native-editor/core";

License

Mozilla Public License 2.0.