Skip to contentnotionic
Docs menu

Reference

Utilities

Helpers for your own components and layouts.

All from notionic.

collectHeadings(blocks)

The page's headings in reading order, with the same anchor ids the rendered headings get. Use it for a sidebar outline:

TypeScript
const outline = collectHeadings(blocks)// [{ id: "install", text: "Install", level: 1, blockId: "…" }]

RichText

Renders a Notion rich text array, with annotations, colors and links: <RichText text={block.callout.rich_text} context={context} />.

plainText(richText) and pageTitle(page)

The text of a rich text array without formatting, and a page's title from its properties.

resolveLink and resolvePageLink

How a link renders, after pageHref and safety checks: { href, external }, or null.

LinkFavicon

The favicon before a link to another site: &lt;LinkFavicon favicon={favicon} /&gt;. It draws the site's icon, a muted globe for a site without one, or nothing when favicon is undefined. Use it in your own components.link.

collectLinkFavicons(blocks)

The favicons fetchBlocks attached to the blocks, nested ones included, as a Map by host.

defaultComponents

The built-in component for each block type.