DocumentHub React Components
Less is more. Now with DocumentHub React Components you can use customizable UI features right in your React Application.
1. How to...
1.1 React Usage
From the terminal run npm i documenthub-react-components
in the root of your application.
Import module via import { Article, ... } from "documenthub-react-components";
where you want the component to be used.
1.1.1 Components
Usage
<Article
catalogid="your-catalog-id",
documentid="document-id",
language="en" ,
headings="false", //optional
scrollUp="true", //optional
token="aaa.bbb.ccc"
/>
1.2 Other Usage
1.2.1 HTML Custom Tags
Create a custom HTML tag which will be automatically handled by the module.
Usage
<documenthub-article
catalogid="your-catalog-id"
documentid="document-id"
language="en"
headings="false"
scrollUp="true"
token="aaa.bbb.ccc"
></documenthub-article>
Note
This approach can be used in a React Application but also in plane old webpage.
For that you will need to include the resources differently:
<!DOCTYPE html>
<html lang="en">
<head>
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="stylesheet" href="https://unpkg.com/documenthub-react-components@0.1.33/dist/lib/index.css">
<title>Your application</title>
</head>
<body>
<!-- //article instance -->
<documenthub-article
catalogid="your-catalog-id"
documentid="document-id"
language="en"
headings="false"
scrollUp="true"
token="aaa.bbb.ccc"
></documenthub-article>
<!-- //document instance -->
<documenthub-document
catalogid="your-catalog-id"
documentid="document-id"
language="en"
headings="false"
scrollUp="true"
token="aaa.bbb.ccc"
></documenthub-document>
<script src="https://unpkg.com/documenthub-react-components@0.1.33/dist/lib/index.js"></script>
</body>
</html>