cx-loading-widget
v1.0.1
Published
Really simple loading animation widget with responsive width and adjustable size
Downloads
6
Readme
Loading Widget
Really simple loading animation widget with responsive width and adjustable size.
Installation
npm install --save cx-loading-widget
Usage Example
var React = require('react');
var LoadingWidget = require('cx-loading-widget'); // 1. require this package
var YourComponent = React.createClass({
render: function () {
var currentView;
if (this.state.isLoading) {
currentView = <LoadingWidget size={50} />; // 2. use it. note how size can be changed with a prop value
} else {
currentView = <ViewForDataIsLoaded />;
}
return (
<div className="YourComponent">
{currentView}
</div>
);
}
});
Where is CSS?
All cx-* modules use in-line styles so there's no need for managing stylesheets at all.
What about assets? (image, fonts, etc.)
- Asset files required for this component is located at
dist/assets/.
- Users of this module will need to deploy everything inside
dist/assets
, if any, tohttp://example.com/assets/cx-loading-widget/*
- If you're using AppEx framework, step 2. will be done automatically for you when you build the project.