Docs menu
Reference
Utilities
Helpers for your own components and layouts.
All from notionic.
The page's headings in reading order, with the same anchor ids the rendered headings get. Use it for a sidebar outline:
const outline = collectHeadings(blocks)// [{ id: "install", text: "Install", level: 1, blockId: "…" }]Renders a Notion rich text array, with annotations, colors and links: <RichText text={block.callout.rich_text} context={context} />.
The text of a rich text array without formatting, and a page's title from its properties.
How a link renders, after pageHref and safety checks: { href, external }, or null.
The favicon before a link to another site: <LinkFavicon favicon={favicon} />. 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.
The favicons fetchBlocks attached to the blocks, nested ones included, as a Map by host.
The built-in component for each block type.