@roboholix/component-browser
v0.0.3
Published
Component Browser
Downloads
5
Maintainers
Readme
A set of React components
Platform | CI Status ---------|:--------- Linux | OSX | Windows |
Documentation (Live Demo)
See a live demo of the components and their respective documentation.
The demo component browser includes:
- Rendered example components that are included in this library
- Code snippets used to generate the example components
- Component prop options, including default values and requirements
Installation
npm install @roboholix/component-browser
Components
See the component browser demo for up-to-date
documentation and examples using latest version of @roboholix/component-browser
.
Useage
Importing Individual Components
Choose one of the following ways to import or require a component into your project.
:point_right: Examples marked for production use will only import code needed for the specified component
| Module Syntax | Example Code | Production | Development |
| --- | --- | :---: | :---: |
| import | import MyButton from '@roboholix/component-browser/MyButton';
| ✔ | ✔ |
| import | import { MyButton } from '@roboholix/component-browser';
| ✗ | ✔ |
| require | const MyButton = require('@roboholix/component-browser/MyButton');
| ✔ | ✔ |
| require | const MyButton = require('@roboholix/component-browser').MyButton;
| ✗ | ✔ |
Importing Multiple Components
// To only import code you need, you can import each individual component on their own
import MyButton from '@roboholix/component-browser/MyButton';
import MyHeader from '@roboholix/component-browser/MyHeader';
:warning: The following syntax will import the entire library (an additional ~5kb), instead of only code needed only for the components specified
// Add MyButton and MyHeader to your project with ES module syntax
import { MyButton, MyHeader } from '@roboholix/component-browser';
// Add MyButton and MyHeader to your project with CommonJS syntax
const RoboholixComponents = require('@roboholix/component-browser');
const MyButton = RoboholixComponents.MyButton;
const MyHeader = RoboholixComponents.MyHeader;
const RoboholixComponents = require('@roboholix/component-browser');
const {
MyButton,
MyHeader
} = RoboholixComponents;
Bug Reporting
Click here to report any bugs or open an issue with this package.