Using Mobiscroll with Meteor react
Installing Mobiscroll in your Meteor app takes a couple of minutes. Let's see how can you start with a simple app.
Start a trial
First, start a free trial by entering your email address on the Mobiscroll homepage and create your account.
This is how the free trial works:
- You can try Mobiscroll for free.
-
The trial needs an active connection to Mobiscroll servers for validation. Don't worry, the licensed product will work offline with downloadable resource files.
Read about the differences between trial and licensed products. - You can upgrade to the licensed product at any time during or after your trial.
Enter your first name, set a password and you're ready to go!
Using the Mobiscroll CLI and NPM to install it in your Meteor app
Step 1: Create an app
If you don't have an app at hand, you can read more about creating a React Meteor app. If you already have an app, you can skip this step.
Step 2: Install the Mobiscroll CLI and configure the app
Install Mobiscroll CLI from NPM (you'll only have to do it once).
$ npm install -g @mobiscroll/cli
meteor npm install
doesn't support global installation at the moment and you won't be able to install the Mobiscorll CLI with it.
Run mobiscroll config react
in your terminal window.
$ mobiscroll config react
Step 3: Import mobiscroll resources to your React component
Importing the js and css:
import { Datepicker } from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
Step 4: Let's see if Mobiscroll was installed correctly
To test it let's use the following example and add to one of your react component. Add the mobiscroll imports and the Datepicker initialization as it is in the below example.
import React, { Component } from 'react';
import { Datepicker } from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return (
<div className="container">
<Datepicker label="Birthday" placeholder="Please select..." />
</div>
);
}
}
To build the app just run the meteor command in the CLI:
$ meteor