Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

notion-blocks-chakra-ui

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notion-blocks-chakra-ui

Parse notion blocks from API to Chakra UI components

  • 0.0.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-92.86%
Maintainers
1
Weekly downloads
 
Created
Source

Parse Notion blocks into Chakra UI React components

Get started

npm install notion-blocks-chakra-ui

or

yarn add notion-blocks-chakra-ui

How to use

import { Stack } from '@chakra-ui/react';
import { NotionBlock } from 'notion-blocks-chakra-ui';

// fetch `blocks` from a Notion API call
<Stack>
  {blocks.map((block) => (
    <NotionBlock key={block.id} block={block} />
  ))}
</Stack>;

Images and video (unsupported by Notion API)

In order to parse images and video, because it is natively unsupported by Notion API, you need to add this kind of block in your Notion doc:

[image, <imageUrl>]
[video, <video>]
[youtube, <youtubeId>]

Custom image component

<NotionBlock
  block={block}
  customImage={{
    MyCustomComponent,
    props: {
      className: 'image',
    },
  }}
/>

Inspired by samuelkraft/notion-blog-nextjs

Here is my portofolio source code which uses this library

FAQs

Package last updated on 27 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc