Skip to content

Commit 60e395d

Browse files
committed
chore(lab): update readme
1 parent d539a5a commit 60e395d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

packages/hedgehog-lab/readme.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Hedgehog Lab package
2+
3+
This package provides a simple way to run Hedgehog editor in your application.
4+
5+
## Installation
6+
7+
```bash
8+
yarn install @hedgehogcomputing/lab
9+
# or
10+
npm install @hedgehogcomputing/lab
11+
```
12+
13+
## Usage
14+
15+
```jsx
16+
import HedgehogLab from "@hedgehogcomputing/lab/src/HedgehogLab";
17+
18+
const Draft = () => {
19+
const yourSource = "any string"
20+
return (
21+
<>
22+
<HedgehogLab source={yourSource} defaultFullScreen={false} defaultLiveMode={true}/>
23+
<HedgehogLab userSnippet={"@username/snippet"} defaultFullScreen={false} defaultLiveMode={true}/>
24+
</>
25+
)
26+
}
27+
```
28+
29+
## API
30+
`<HedgehogLab />` accepts the following props:
31+
32+
-- alternative
33+
* source: `string` - the source code to be displayed in the editor
34+
* userSnippet : `string`- the user snippet to be displayed in the editor, example: "@username/snippet"
35+
36+
-- common
37+
* defaultFullScreen: `boolean` - whether the editor should be displayed in full screen mode by default
38+
* defaultLiveMode: `boolean` - whether the compiler should be auto-reload in live mode by default

0 commit comments

Comments
 (0)