vue-notion-render
Vue Renderer for Notion pages.
Features
- Supports The Official Notion API
- Supports notion-api-worker to render unsupported blocks of the Official API created by @splitbee
- Fast
- Customizable
Install
Vue.js
in src/index.js
file import the component and use Vue.component method.
Nuxt.js
in order to use it with Nuxt.js create a Nuxt plugin.
-
in
/plugins
directory create a filevue-notion-render.js
-
Register the plugin by adding the file in
nuxt.config.js
plugins array
Local Component
if you don't want to register the component globally you can use it locally in your component.
Usage
This package doesn't handle the communication with the API, therefore to learn more about the official API check out the official documentation.
Currently the Official API doesn't support all Notion blocks, a temporary solution is to use notion-api-worker a serverless wrapper for the private Notion API.
Using notion-api-worker
- Use the /v1/page/:id to retrieve page blocks
- Make sure to pass :unofficial="true" prop
Using The official API
https://developers.notion.com/reference/get-block-children
- Retrieve block children and pass the results array to data
- Make sure to pass :unofficial="false" prop
Supported Blocks
Block Type | Supported | Notion-API-Worker | Official API | Note |
---|---|---|---|---|
paragraph | ✅ | ✅ | ✅ | |
Headings | ✅ | ✅ | ✅ | |
To-do | ✅ | ✅ | ✅ | |
Lists | ✅ | ✅ | ✅ | |
Toggle | ✅ | ✅ | ✅ | |
Quote | ✅ | ✅ | ❌ | |
Colors | ✅ | ✅ | ✅ | |
Highlight | ✅ | ✅ | ✅ | |
Divider | ✅ | ✅ | ❌ | |
Callout | ✅ | ✅ | ❌ | |
Emojis | ✅ | ✅ | ✅ | |
Inline Equation | ✅ | ✅ | ✅ | |
Block Equation | ✅ | ✅ | ❌ | |
Code | ✅ | ✅ | ❌ | |
Bookmark | ✅ | ✅ | ❌ | |
Embeds | ✅ | ✅ | ❌ | Spotify, Twitter, Maps, Figma, Pdf, Codepen, TypeForm, Replit, Youtube, Whimsical, Drive |
Layout | ✅ | ✅ | ❌ | |
Video | ✅ | ✅ | ❌ | embed |
Audio | ✅ | ✅ | ❌ | embed |
File | ✅ | ✅ | ❌ | embed |
Table | ❌ | ❌ | ❌ | soon |
Board | ❌ | ❌ | ❌ | soon |