Skip to contentnotionic

notionic

Write in Notion. Ship it as React Server Components, styled with your shadcn/ui theme.

  • Server-first. Every block renders on the server, with no client JavaScript.
  • Follows your theme. Styled with Tailwind CSS and shadcn/ui tokens, so pages match your app, dark mode included.
  • Yours to change. Replace the component for any block type, or install shadcn/ui versions from the registry.
  • Light. React is the only runtime dependency.

Get started

1. Install

Bash
pnpm add notionic @notionhq/client

2. Add the styles

Import notionic after Tailwind CSS, in your global stylesheet:

CSS
@import "tailwindcss";@import "notionic/styles.css";

3. Render a page

TypeScript
import { Client } from "@notionhq/client"import { NotionRenderer } from "notionic"import { fetchBlocks } from "notionic/fetch"
const notion = new Client({ auth: process.env.NOTION_TOKEN })
export default async function Page() {  const blocks = await fetchBlocks(notion, "your-page-id")  return <NotionRenderer blocks={blocks} />}

fetchBlocks gets every block of the page with its nested blocks. Cache it with your framework, for example Next.js's "use cache".

How it works

Mermaid
graph TD
  A["Notion page"] --> B["fetchBlocks"]
  B --> C["NotionRenderer"]
  C --> D["HTML from the server"]

Make it yours

Pass your own component for any block type. It gets the block and its rendered children.

TypeScript
<NotionRenderer blocks={blocks} components={{ callout: MyCallout }} />

From the registry

ComponentBuilt on
notion-codeCode Block and Shiki
notion-calloutAlert
notion-tableTable
notion-toggleCollapsible
notion-tabsTabs
notion-equationKaTeX
notion-mermaidMermaid

notion-equation renders math on the server, the way Notion shows it:

eiπ+1=0e^{i\pi} + 1 = 0

Questions