1.0.9 • Published 4 months ago

react-component-renderer v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

React Component Renderer

npm package

How To Use

  1. Install package
npm install react-component-renderer
yarn add react-component-renderer
pnpm add react-component-renderer
  1. Import render component
import { PageEditor } from "react-component-renderer";

<PageEditor
  baseImageUrl={baseImageUrl}
  components={components}
  placeholderImageUrl={placeholderImageUrl}
/>;
  1. 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
1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago