@knymbus/react-widget-builder
v0.2.24
Published
[npm-badge]: https://img.shields.io/npm/v/@knymbus/react-widget-builder.svg?style=flat-square [npm]: https://www.npmjs.org/package/@knymbus/react-widget-builder
Downloads
9
Readme
react-widget-builder
React widget builder is a small light weight UI component widget that is use to contain componants that can share data between the components outside of the default router.
Install:
$ npm i @knymbus/react-widget-builder
Usage:
import {
WidgetBuilder,
WidgetBuilderOutlet,
IWidgetBuilderRoute } from "@knymbus/react-widget-builder";
import WindowOne from "./WindowOne"
import WindowTwo from "./WindowTwo"
export default function MyComponent(props: IProps){
const widgetRoutes: IWidgetBuilderRoute[] = [
{
index: true,
path: "window-1",
window: <WindowOne />,
transition: true
},
{
path: "window-2",
window: <WindowTwo />,
transition: true
}
]
const myWidgetBuilder = new WidgetBuilder({
name: "My Widget Name",
routes: widgetRoutes
})
return (
<div>
<WidgetBuilderOutlet builder={myWidgetBuilder} />
</div>
)
}