All Projects → splitbee → React Notion

splitbee / React Notion

Licence: mit
A fast React renderer for Notion pages

Programming Languages

typescript
32286 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Notion

Formium
The headless form builder for the modern web.
Stars: ✭ 78 (-96.29%)
Mutual labels:  headless-cms
Ghost
Turn your audience into a business. Publishing, memberships, subscriptions and newsletters.
Stars: ✭ 39,261 (+1765.13%)
Mutual labels:  headless-cms
Shio
✨ :dna: Shio CMS - Model Content, Use GraphQL and Create Site using Javascript with Native Cache and Search.
Stars: ✭ 119 (-94.35%)
Mutual labels:  headless-cms
Example Ecommerce Snipcart Vue
The Transglobal Candy Store: Sample front-end for the Sanity.io e-commerce schema with vue.js, nuxt.js, and snipcart
Stars: ✭ 89 (-95.77%)
Mutual labels:  headless-cms
Squidex
Headless CMS and Content Managment Hub
Stars: ✭ 1,583 (-24.8%)
Mutual labels:  headless-cms
Nextjs Headless Wordpress
🔥 Nextjs Headless WordPress
Stars: ✭ 110 (-94.77%)
Mutual labels:  headless-cms
Core
Backpulse's core. Backpulse is an API Based CMS. Build you own website without worrying about the content administration system.
Stars: ✭ 61 (-97.1%)
Mutual labels:  headless-cms
Notion Clone
Stars: ✭ 2,048 (-2.71%)
Mutual labels:  notion
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+1885.08%)
Mutual labels:  headless-cms
Awesome Headless Cms
An awesome list of headless / decoupled CMS resources.
Stars: ✭ 118 (-94.39%)
Mutual labels:  headless-cms
Builder
Drag and drop page building using your code components
Stars: ✭ 1,281 (-39.14%)
Mutual labels:  headless-cms
Awesome Sanity
A curated list of awesome resources related to Sanity.io, the Platform for Structured Content.
Stars: ✭ 96 (-95.44%)
Mutual labels:  headless-cms
Awesome Jamstack
📔 Curated list of resources: books, videos, articles, speaker decks, tools about using the JAMstack (A modern web development architecture for creating fast, secure and dynamic websites)
Stars: ✭ 115 (-94.54%)
Mutual labels:  headless-cms
Accounts Ui
Zesty.io account management application
Stars: ✭ 87 (-95.87%)
Mutual labels:  headless-cms
Lotion
Unofficial Notion.so app for Linux
Stars: ✭ 1,735 (-17.58%)
Mutual labels:  notion
Daptin
Daptin - Backend As A Service - GraphQL/JSON-API Headless CMS
Stars: ✭ 1,195 (-43.23%)
Mutual labels:  headless-cms
Elepy
Elepy, The Headless Content Management Framework
Stars: ✭ 109 (-94.82%)
Mutual labels:  headless-cms
Grandnode
Open source, headless, multi-tenant eCommerce platform built with .NET Core, MongoDB, AWS DocumentDB, Azure CosmosDB, Vue.js.
Stars: ✭ 1,768 (-16.01%)
Mutual labels:  headless-cms
Directus
Open-Source Data Platform 🐰 — Directus wraps any SQL database with a real-time GraphQL+REST API and an intuitive app for non-technical users.
Stars: ✭ 13,190 (+526.6%)
Mutual labels:  headless-cms
Sdk Js
Directus JS SDK — JavaScript Software Development Kit for Node and Browser
Stars: ✭ 117 (-94.44%)
Mutual labels:  headless-cms

react-notion

npm version npm version minzipped sized

A React renderer for Notion pages. Use Notion as CMS for your blog, documentation or personal site.

react-notion was developed by Splitbee. Splitbee is a fast, reliable, free, and modern analytics for any team.

This package doesn't handle the communication with the API. Check out notion-api-worker for an easy solution.

Created by Timo Lins & Tobias Lins with the help of all contributors ❤️

Features

⚡️ Fast – Up to 10x faster than Notion*

🎯 Accurate – Results are almost identical

🔮 Code Highlighting – Automatic code highlighting with prismjs

🎨 Custom Styles – Styles are easily adaptable. Optional styles included

* First Meaningful Paint compared to a hosted example on Vercel.

react-notion is best suited as minimal renderer for blogs & content pages. If you're looking for a full-featured solution to render Notion-like pages, check out react-notion-x.

Install

npm install react-notion

How to use

Minimal Example

We can store the API response in a .json file and import it.

import "react-notion/src/styles.css";
import "prismjs/themes/prism-tomorrow.css"; // only needed for code highlighting
import { NotionRenderer } from "react-notion";

import response from "./load-page-chunk-response.json"; // https://www.notion.so/api/v3/loadPageChunk

const blockMap = response.recordMap.block;

export default () => (
  <div style={{ maxWidth: 768 }}>
    <NotionRenderer blockMap={blockMap} />
  </div>
);

A working example can be found inside the example directory.

Next.js Example

In this example we use Next.js for SSG. We use notion-api-worker to fetch data from the API.

/pages/my-post.jsx

import "react-notion/src/styles.css";
import "prismjs/themes/prism-tomorrow.css";

import { NotionRenderer } from "react-notion";

export async function getStaticProps() {
  const data = await fetch(
    "https://notion-api.splitbee.io/v1/page/<NOTION_PAGE_ID>"
  ).then(res => res.json());

  return {
    props: {
      blockMap: data
    }
  };
}

export default ({ blockMap }) => (
  <div style={{ maxWidth: 768 }}>
    <NotionRenderer blockMap={blockMap} />
  </div>
);

Sites using react-notion

List of pages that implement this library.

Supported Blocks

Most common block types are supported. We happily accept pull requests to add support for the missing blocks.

Block Type Supported Notes
Text Yes
Heading Yes
Image Yes
Image Caption Yes
Bulleted List Yes
Numbered List Yes
Quote Yes
Callout Yes
Column Yes
iframe Yes
Video Yes Only embedded videos
Divider Yes
Link Yes
Code Yes
Web Bookmark Yes
Toggle List Yes
Page Links Yes
Header Yes Enable with fullPage
Databases Missing Not planned. Supported by react-notion-x
Checkbox Missing Supported by react-notion-x
Table Of Contents Missing Supported by react-notion-x

Block Type Specific Caveats

When using a code block in your Notion page, NotionRenderer will use prismjs to detect the language of the code block. By default in most project, prismjs won't include all language packages in the minified build of your project. This tends to be an issue for those using react-notion in a next.js project. To ensure the programming language is correctly highlighted in production builds, one should explicitly imported into the project.

import 'prismjs/components/prism-{language}';

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].