11# Intro
22
3+ ``` typescript
4+ import { ComponentViewer } from ' react-component-viewer' ;
5+ ```
6+
37![ screen example] ( documentation/rcv/static/screen-example.png )
48
5- React Component to help with development of other react components.
6- * Just a component, no build system: works with your setup seamlessly.
7- * See your components at once in the different states.
8- * Zoom-in into a single component for debug.
9- * User defined theme switching for multi brand/theme development.
9+ React Component to help you with development of other React components.
10+ * just a component, no separate build system,
11+ * observe component states all at once or zoom into a single component or a screen for debugging,
12+ * user defined theme switching for multi brand/theme development.
1013
1114# Installation
1215
@@ -16,7 +19,7 @@ npm install react-component-viewer --save-dev
1619
1720# CRA Example
1821
19- ``` typescript
22+ ``` typescript
2023import * as React from ' react' ;
2124
2225import { Registries , ComponentViewer } from ' react-component-viewer' ;
@@ -27,17 +30,16 @@ import { profileScreenDemo } from './demos/profileScreen';
2730import { formsDemo } from ' ./demos/forms' ;
2831import { sideBySideDemo } from ' ./demos/sideBySide' ;
2932
30- const registries = new Registries ();
31- registries .add (' widgets ' )
33+ const registries = new Registries ({componentWrapper: DemoWrapper } );
34+ registries .add (' components ' )
3235 .registerAsGrid (' Links' , 300 , linksDemo )
33- .registerAsTwoColumnTable (' Forms' , formsDemo )
3436 .registerAsTwoColumnTable (' Buttons' , buttonsDemo )
3537 .registerAsRows (' Inputs' , inputsDemo );
3638
3739registries .add (' layouts' )
38- .registerSingle (' Side by Side' , sideBySideDemo );
40+ .registerAsRows (' Side by Side' , sideBySideDemo );
3941
40- registries .add (' end to end ' )
42+ registries .add (' screens ' )
4143 .registerSingle (' Single Screen' , profileScreenDemo )
4244 .registerAsMiniApp (' Single Screen mini app' , ' /app' , profileScreenDemo );
4345
@@ -50,29 +52,7 @@ export class App extends React.Component {
5052}
5153```
5254
53- # Demo functions
54-
55- Demo must be defined in a function that accepts ` Registry ` . Function should register components to display.
56-
57- ``` typescript
58- export function buttonsDemo(registry : Registry ) {
59- registry
60- .add (' primary' , () => <Button primary label =" click me" onClick ={onClick}/>,
61- ` long description
62- multiline markdown ` )
63- .add (' secondary' , () => <Button label =" click me" onClick ={onClick}/>);
64- }
65- ```
66-
67- # Registration methods
68-
69- ` registerAsGrid ` name, minWidth, demoFunction
70-
71- ` registerAsRows ` name, demoFunction
72-
73- ` registerAsTwoColumnTable ` name, demoFunction
74-
75- ` registerAsTabs ` name, demoFunction
55+ # Read more
7656
77- ` registerAsSingle ` name, demoFunction
57+ [ More details explanation ] ( https://medium.com/@mykolagolubyev/react-component-viewer-ff7cf793695a )
7858
0 commit comments