react-component-renderer
v1.0.9
Published
[npm package](https://www.npmjs.com/package/react-component-renderer)
Downloads
21
Maintainers
Readme
React Component Renderer
How To Use
- Install package
npm install react-component-renderer
yarn add react-component-renderer
pnpm add react-component-renderer
- Import render component
import { PageEditor } from "react-component-renderer";
<PageEditor
baseImageUrl={baseImageUrl}
components={components}
placeholderImageUrl={placeholderImageUrl}
/>;
- Example component props data
baseImageUrl
:
https://your-api-domain.com # without slash at the end
components
:
[
{
"type": 0,
"id": "Section 1",
"content": "Input title.",
"settings": {
"fontSize": "24px"
}
},
{
"type": 0,
"id": "Section 2",
"content": "Any description goes here."
},
{
"type": 1,
"id": "Section 3",
"content": "product/images/shirt.png",
"settings": {
"width": 300,
"height": 300,
"imageAltText": "shirt"
}
}
]
placeholderImageUrl
:
https://your-api-domain.com/placeholder.png # full image url