Skip to contentnotionic
Docs menu

Reference

NotionRenderer

Props of the component that renders Notion blocks.

TypeScript
import { NotionRenderer } from "notionic"
PropTypeDescription
blocksNotionBlock[]Blocks from the Notion API, with nested blocks as children, as fetchBlocks returns them.
componentsBlockComponentsReplacement components, by block type, plus inline_equation and demo (the frame around demos).
pageHref(pageId: string) => string | nullWhere links to Notion pages point. Defaults to notion.so (opens in a new tab).
transformFileUrl(file: { blockId: string; url: string }) => stringRewrites URLs of files uploaded to Notion, which expire after an hour. External URLs aren't passed through it.
demosRecord<string, ComponentType<DemoProps>>Your demo components, by name. An embed of a URL ending in /demos/<name> renders one in its place.
classNamestringClasses 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.