Skip to content

Differences between blocks and components

eKrausedivae edited this page Apr 10, 2024 · 2 revisions

Blocks

Content in Google Drive or SharePoint documents can be either added as default content (such as text, headings, and links) or as blocks. Blocks are implemented within the document as a table, featuring a headline cell that specifies the block's name and potentially additional cells containing further markup.

Default content and an accordion block in a Google Document

Blocks have corresponding SCSS and TypeScript files, responsible for styling the block and modifying its markup if necessary. These files are stored within the "src/blocks/{blockname}" directory. The name of the block serves as both the folder name and the filename for the SCSS and TypeScript files.

Directory for blocks

To utilise blocks, a default function is invoked with a block parameter, containing the generated markup of the block defined within the Google Drive or SharePoint document. This markup can either be retained as is, allowing for styling and functionality enhancements, or the data can be extracted from the markup and employed to create new markup as needed.

Default function of a block

Components

Components are not maintained in Google Drive or SharePoint. Instead, they can either be used within a block, which acts as a container, or added programmatically during the DOM building process.

Clone this wiki locally