-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,63 @@ | ||
# @onedoc/react-print | ||
--- | ||
title: Introduction | ||
description: Build PDFs using React and TypeScript. | ||
icon: react | ||
--- | ||
|
||
--- | ||
# Getting started | ||
|
||
react-print | ||
## 1. Installation | ||
|
||
Get the react-print component library. | ||
|
||
<CodeGroup> | ||
|
||
```sh npm | ||
npm install -s @onedoc/react-print | ||
``` | ||
|
||
```sh yarn | ||
yarn add @onedoc/react-print | ||
``` | ||
|
||
```sh pnpm | ||
pnpm add @onedoc/react-print | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
## 2. Import component | ||
|
||
Import a component as follow: | ||
|
||
```javascript | ||
import { PageTop, PageBottom, PageBreak } from '@onedoc/react-print'; | ||
``` | ||
|
||
## 3. Integrate in your document: | ||
|
||
|
||
```javascript | ||
export const document = ({props}) => { | ||
return ( | ||
<div> | ||
<PageTop> | ||
<span>Hello #1</span> | ||
</PageTop> | ||
<div> | ||
Hello #2 | ||
</div> | ||
<PageBottom> | ||
<div className="text-gray-400 text-sm"> | ||
Hello #3 | ||
</div> | ||
</PageBottom> | ||
<PageBreak /> | ||
<span>Hello #4, but on a new page ! </span> | ||
</div> | ||
); | ||
}; | ||
``` | ||
--- |