Skip to content

Instantly share code, notes, and snippets.

import * as React from 'react';
import { Registry, simulateState } from 'react-component-viewer';
import { LabeledCheckBox } from './LabeledCheckBox';
const [getCheckBoxValueA, setCheckBoxValueA] = simulateState(true);
const [getCheckBoxValueB, setCheckBoxValueB] = simulateState(false);
export function labeledCheckBoxDemo(registry: Registry) {
registry
export function buttonsDemo(registry: Registry) {
registry
.add('primary', () => <Button primary label="click me" onClick={onClick}/>)
.add('secondary', () => <Button label="click me" onClick={onClick}/>);
}
import { Registries, ComponentViewer } from 'react-component-viewer';
const registries = new Registries();
registries.add('components')
.registerAsGrid('Links', 300, linksDemo)
.registerAsTwoColumnTable('Buttons', buttonsDemo)
.registerAsRows('Inputs', inputsDemo);
registries.add('layouts')
.registerSingle('Side by Side', sideBySideDemo);