You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After fetching your Strapi content, you can use the BlocksRenderer component to render the data from a blocks attribute. Pass the array of blocks coming from your Strapi API to the `content` prop:
You can provide your own React components to the renderer, both for blocks and modifier. They will be merged with the default components, so you can override only the ones you need.
40
+
41
+
-**Blocks** are full-width elements, usually at the root of the content. The available options are:
42
+
- paragraph
43
+
- heading
44
+
- list
45
+
- quote
46
+
- code
47
+
- image
48
+
- link
49
+
-**Modifiers** are inline elements, used to change the appearance of fragments of text within a block. The available options are:
50
+
- bold
51
+
- italic
52
+
- underline
53
+
- strikethrough
54
+
- code
55
+
56
+
To provide your own components, pass an object to the `blocks` and `modifiers` props of the renderer. For each type, the value should be a React component that will receive the props of the block or modifier. Make sure to always render the children, so that the nested blocks and modifiers are rendered as well.
0 commit comments