Testing Notion content blocks and styling with TailwindCSS
February 22, 2022
From Notion's API documentation:
"A block object represents content within Notion. Blocks can be text, lists, media, and more. A page is a type of block, too!"
So far, only text-like blocks are currently available. View the Notion API documentation for more info.
Content blocks:
Heading 1
Heading 2
Heading 3
This is a paragraph block with bold text, strikethrough text, underline text, code text, italicized text and text in a different color.
- numbered list 1
- numbered list 2
- numbered list 3
Toggle
hi!? Underline?
Bookmark
Code
async (image: string | PropertyValueFiles): Promise<number[]> => {let imageSrc: string;if (typeof image === 'string') {imageSrc = image;} else {imageSrc = PropertyImage(image);}const v = vib.from(imageSrc);const col = await v.getPalette().then((palette) => palette).catch(() => [0, 0, 0]);//gets Vibrant Colorif (Array.isArray(col)) return col as number[];else return col.Vibrant?.rgb as number[];};
Image
Customize
To edit how a content block renders, change the corresponding block component in ContentBlocks.js.
View the Notion page where the contents of this page lives.