Play Cricket React Components
This is a react UI/components library intended for the Play Cricket site.
Contents
Usage
🚀 Getting started
Include this script tag in the Play Cricket site:
<script src="https://unpkg.com/play-cricket-react-components@latest" crossorigin></script>
Example usage in HTML page
<body onload="setup()">
<script>
function setup() {
renderComponent({type: 'Heading', props: { text: 'Hello world', color: 'white' }, elementId: 'react-test'});
}
</script>
...
📖 API Overview
This library will expose the
renderComponent({})
function which takes in an object {} with these properties as an arg:
type
stringprops
objectelementId
string
Example
The following snippet will render the <Heading />
component within a <div id="club-heading"></div>
element in the Play Cricket site, outputting the message 'Hello World!'.
renderComponent({type: 'Heading', props: { text: 'Hello World!' }, elementId: 'club-heading'})
🔍 API Reference
To be updated
Contributing
Local installation
npm install