Docs menu
Reference
NotionRenderer
Props of the component that renders Notion blocks.
TypeScript
import { NotionRenderer } from "notionic"| Prop | Type | Description |
|---|---|---|
blocks | NotionBlock[] | Blocks from the Notion API, with nested blocks as children, as fetchBlocks returns them. |
components | BlockComponents | Replacement components, by block type, plus inline_equation and demo (the frame around demos). |
pageHref | (pageId: string) => string | null | Where links to Notion pages point. Defaults to notion.so (opens in a new tab). |
transformFileUrl | (file: { blockId: string; url: string }) => string | Rewrites URLs of files uploaded to Notion, which expire after an hour. External URLs aren't passed through it. |
demos | Record<string, ComponentType<DemoProps>> | Your demo components, by name. An embed of a URL ending in /demos/<name> renders one in its place. |
className | string | Classes for the root element. |
It works as a Server Component and ships no client JavaScript of its own; demos ship theirs. Unsupported blocks render nothing, with a warning in development.