You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2019. It is now read-only.
ReactCLI is a react renderer for the command line. All of the benefits of React, right in your terminal.
6
+
7
+
## Getting started
8
+
9
+
### yarn
10
+
11
+
```bash
12
+
yarn add react-cli-renderer
13
+
```
14
+
15
+
### npm
16
+
17
+
```bash
18
+
npm install --save react-cli-renderer
19
+
```
20
+
21
+
### How it works
22
+
23
+
```javascript
24
+
constReact=require("react");
25
+
constReactCLI=require("react-cli-renderer");
26
+
27
+
ReactCLI.render(
28
+
<div horizontal>
29
+
First column
30
+
<div>
31
+
Second column
32
+
<div>
33
+
First row
34
+
<br />
35
+
Second row
36
+
</div>
37
+
</div>
38
+
</div>
39
+
);
40
+
```
41
+
42
+
### Details
43
+
44
+
#### Premise
45
+
46
+
ReactCLI is analogous to ReactDOM or ReactNative. It takes the tree of nodes determined by React and the React reconciler, and renders that content to the command line. This means that you get all of the core features of React for free, like stateful components, context, refs, etc - in addition to being able to use third party libraries for things like state management.
47
+
48
+
#### Components
49
+
50
+
ReactCLI provides two components for building command line interfaces.
51
+
52
+
- div
53
+
A new section is denoted by `div`. A section can either be vertical, or horizontal. The children of a section can be a mix of text, or more sections. A section can also align text left, right, or center.
54
+
55
+
```javascript
56
+
<div horizontal>
57
+
<div>Column 1</div>
58
+
<div>Column 2</div>
59
+
</div>
60
+
```
61
+
62
+
- break
63
+
Break components allow you to define columns and/or rows within a section.
0 commit comments