React Forms
Forms for React
Forms for React
Forms for React
Learn more
Form components you’ll need for building great looking mobile and desktop apps. Shipping 15 distinct elements ranging from inputs to layout helpers.
With useful features for a refined UX, including the following elements:
- Single and multiline text
- Select styling
- Buttons
- Segmented control
- Checkbox and checklist
- Radio buttons
- Switch
- Rating
- Stepper
- Page & typography
- Slider
- Progress
- Alerts
- Notifications
- Notes
Forms demos available for other frameworks.
Viewing demos & code for
Forms - Mobile form
Easily create single column layouts and render mobile forms using the various form elements like buttons, inputs, sliders, radio buttons and more.
Use the global settings to set the theme, localization options and everything that should be the same across your app.
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
class App extends React.Component {
render() {
return (
<mobiscroll.Form theme="" themeVariant="" lang="">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>User Data</mobiscroll.FormGroupTitle>
<mobiscroll.Input placeholder="First Name">First Name</mobiscroll.Input>
<mobiscroll.Input placeholder="Last Name">Last Name</mobiscroll.Input>
<mobiscroll.Input placeholder="User Name">User Name</mobiscroll.Input>
<mobiscroll.Input placeholder="Company Name">Company</mobiscroll.Input>
<mobiscroll.Input placeholder="Email Address">Email</mobiscroll.Input>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Phone Number</mobiscroll.FormGroupTitle>
<mobiscroll.Input placeholder="Home">Home</mobiscroll.Input>
<mobiscroll.Input placeholder="Business">Business</mobiscroll.Input>
<mobiscroll.Input placeholder="Fax">Fax</mobiscroll.Input>
</mobiscroll.FormGroup>
</mobiscroll.Form>
);
}
}
<div id="content"></div>
Forms - Desktop form
Use the grid layout to create single and multiple column forms suited for medium and large screens. Don't go overboard with too many columns but make use of the available horizontal space on bigger screens.
Use the global settings for setting the theme, localization options and everything that should be consistent across your app.
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
class App extends React.Component {
render() {
return (
<mobiscroll.Form inputStyle="box"theme="" themeVariant="" lang="">
<div className="mbsc-grid mbsc-grid-fixed">
<mobiscroll.FormGroup>
<div className="mbsc-row mbsc-justify-content-center">
<div className="mbsc-col-md-10 mbsc-col-xl-8 mbsc-form-grid">
<mobiscroll.FormGroupTitle>Multiple columns grid</mobiscroll.FormGroupTitle>
<div className="mbsc-row">
<div className="mbsc-col-md-6 mbsc-col-12">
<mobiscroll.Input type="text" placeholder="Email" inputStyle="box" labelStyle="floating">Email</mobiscroll.Input>
</div>
<div className="mbsc-col-md-6 mbsc-col-12">
<mobiscroll.Input type="password" placeholder="Password" passwordToggle="true" inputStyle="box" labelStyle="floating">Password</mobiscroll.Input>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-12">
<mobiscroll.Input type="text" placeholder="Address" inputStyle="box" labelStyle="floating">Address</mobiscroll.Input>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-md-6 mbsc-col-12">
<mobiscroll.Input type="text" placeholder="City" inputStyle="box" labelStyle="floating">City</mobiscroll.Input>
</div>
<div className="mbsc-col-md-4 mbsc-col-6">
<mobiscroll.Dropdown label="State" inputStyle="box" labelStyle="floating">
<option value="Alabama">Alabama</option>
<option value="Alaska">Alaska</option>
<option value="Arizona">Arizona</option>
<option value="Arkansas">Arkansas</option>
<option value="California">California</option>
<option value="Colorado">Colorado</option>
<option value="Connecticut">Connecticut</option>
<option value="Delaware">Delaware</option>
<option value="Florida">Florida</option>
<option value="Georgia">Georgia</option>
<option value="Hawaii">Hawaii</option>
<option value="Idaho">Idaho</option>
<option value="Illinois Indiana">Illinois Indiana</option>
<option value="Iowa">Iowa</option>
<option value="Kansas">Kansas</option>
<option value="Kentucky">Kentucky</option>
<option value="Louisiana">Louisiana</option>
<option value="Maine">Maine</option>
<option value="Maryland">Maryland</option>
<option value="Massachusetts">Massachusetts</option>
<option value="Michigan">Michigan</option>
<option value="Minnesota">Minnesota</option>
<option value="Mississippi">Mississippi</option>
<option value="Missouri">Missouri</option>
<option value="Montana Nebraska">Montana Nebraska</option>
<option value="Nevada">Nevada</option>
<option value="New Hampshire">New Hampshire</option>
<option value="New Jersey">New Jersey</option>
<option value="New Mexico">New Mexico</option>
<option value="New York">New York</option>
<option value="North Carolina">North Carolina</option>
<option value="North Dakota">North Dakota</option>
<option value="Ohio">Ohio</option>
<option value="Oklahoma">Oklahoma</option>
<option value="Oregon">Oregon</option>
<option value="Pennsylvania Rhode Island">Pennsylvania Rhode Island</option>
<option value="South Carolina">South Carolina</option>
<option value="South Dakota">South Dakota</option>
<option value="Tennessee">Tennessee</option>
<option value="Texas">Texas</option>
<option value="Utah">Utah</option>
<option value="Vermont">Vermont</option>
<option value="Virginia">Virginia</option>
<option value="Washington">Washington</option>
<option value="West Virginia">West Virginia</option>
<option value="Wisconsin">Wisconsin</option>
<option value="Wyomin">Wyomin</option>
</mobiscroll.Dropdown>
</div>
<div className="mbsc-col-md-2 mbsc-col-6">
<mobiscroll.Input type="text" placeholder="Zip" inputStyle="box" labelStyle="floating">Zip</mobiscroll.Input>
</div>
</div>
<mobiscroll.Button>Sign in</mobiscroll.Button>
</div>
</div>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<div className="mbsc-row mbsc-justify-content-center">
<div className="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-xl-5">
<mobiscroll.FormGroup inset>
<mobiscroll.FormGroupTitle>Single column grid</mobiscroll.FormGroupTitle>
<mobiscroll.Input placeholder="First Name">First Name</mobiscroll.Input>
<mobiscroll.Input placeholder="Last Name">Last Name</mobiscroll.Input>
<mobiscroll.Input placeholder="User Name">User Name</mobiscroll.Input>
<mobiscroll.Input placeholder="Company Name">Company</mobiscroll.Input>
<mobiscroll.Input placeholder="Email Address">Email</mobiscroll.Input>
</mobiscroll.FormGroup>
</div>
</div>
</mobiscroll.FormGroup>
</div>
</mobiscroll.Form>
);
}
}
<div id="content"></div>
Forms - Responsive form
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
class App extends React.Component {
render() {
return (
<mobiscroll.Form className="mbsc-form-grid" theme="" themeVariant="" lang="">
<div className="mbsc-grid">
<div className="mbsc-row mbsc-justify-content-center">
<div className="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-xl-5 mbsc-align-center">
<mobiscroll.Note color="primary">Create responsive forms with the help of the grid layout.</mobiscroll.Note>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-12 mbsc-col-md-6 mbsc-col-lg-3">
<mobiscroll.Input inputStyle="box" labelStyle="floating" placeholder="Enter your email address">Email</mobiscroll.Input>
</div>
<div className="mbsc-col-12 mbsc-col-md-6 mbsc-col-lg-3">
<mobiscroll.Input inputStyle="box" labelStyle="floating" type="password" passwordToggle="true" placeholder="Set a password">Password</mobiscroll.Input>
</div>
<div className="mbsc-col-12 mbsc-col-lg-6">
<mobiscroll.Input inputStyle="box" labelStyle="floating" placeholder="What is your address?">Address</mobiscroll.Input>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-12 mbsc-col-md-6 mbsc-col-lg-3">
<mobiscroll.Input inputStyle="box" labelStyle="floating" placeholder="Enter your town">Town</mobiscroll.Input>
</div>
<div className="mbsc-col-12 mbsc-col-md-6 mbsc-col-lg-3">
<mobiscroll.Input inputStyle="box" labelStyle="floating" placeholder="Select your state">State</mobiscroll.Input>
</div>
<div className="mbsc-col-12 mbsc-col-md-6 mbsc-col-lg-3">
<mobiscroll.Input inputStyle="box" labelStyle="floating" placeholder="What is your zip code">Zip</mobiscroll.Input>
</div>
<div className="mbsc-col-12 mbsc-col-md-6 mbsc-col-lg-3">
<mobiscroll.Input inputStyle="box" labelStyle="floating" placeholder="Select your country">Country</mobiscroll.Input>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-12 mbsc-col-md-16 mbsc-col-lg-3">
<div className="mbsc-btn-group-block">
<mobiscroll.Button color="success">Create account</mobiscroll.Button>
</div>
</div>
</div>
<div className="mbsc-row mbsc-justify-content-center">
<div className="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-xl-5">
<mobiscroll.Note color="secondary">
<p className="mbsc-align-left">Use the grid layout classes to set how the form should look on different screen sizes.</p>
<ul className="mbsc-align-left">
<li>The column widths will adapt to the screen size based on the predefined <b>.mbsc-col-{'{'}breakpoint{'}'}-{'{'}size{'}'}</b> classes and become horizontal at the specified breakpoint.
</li>
<li>The examples are using the <b>.mbsc-col-md-6</b>, <b>.mbsc-col-lg-6</b> and <b>.mbsc-col-lg-3</b> classes.</li>
</ul>
</mobiscroll.Note>
</div>
</div>
</div>
</mobiscroll.Form>
);
}
}
<div id="content"></div>
Forms - Custom usage
While using mobiscroll forms on its own is great and easy there are a lot of cases where a mixed solution is required. There are three common approaches we came across that are covered by this example.
-
Use mobiscroll form elements inside your existing forms. This is a common scenario that you can come across. Your page is already functional, designed and you would like to update/change a single piece or add something new. Use a stand-alone element like the
mbsc-switch
in the example. -
Use custom styled elements inside mobiscroll forms. Let's say you mostly use mobiscroll on your pages and forms but you also have custom components that you'd like to apply. In that case you want to turn all enahncements off for that element with the the
data-enhance="false"
property. -
Use mobiscroll form elements outside of an actual form. Also a common use case, think of some content like a couple paragraphs and a subscribe call to action in the middle. Use the stand-alone controls, like
mbsc-input
andmbsc-button
elements.
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
class App extends React.Component {
render() {
return (
<div className="mbsc-grid mbsc-grid-fixed md-custom-usage">
<div className="mbsc-row mbsc-justify-content-center">
<div className="mbsc-col-md-10 mbsc-col-xl-9 custom-section">
<h4>Using elements inside existing forms</h4>
<form className="custom-form">
<div className="mbsc-row">
<div className="mbsc-col-md-6 mbsc-col-12">
<div>
<label htmlFor="email">Email</label>
<input id="email" type="text" placeholder="Email" className="custom-input" />
</div>
</div>
<div className="mbsc-col-md-6 mbsc-col-12">
<div>
<label htmlFor="pass">Password</label>
<input id="pass" type="password" placeholder="Password" className="custom-input" />
</div>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-md-6 mbsc-col-12">
<div>
<label htmlFor="city">City</label>
<input id="city" type="text" placeholder="City" className="custom-input" />
</div>
</div>
<div className="mbsc-col-md-3 mbsc-col-6">
<div>
<label htmlFor="state">State</label>
<input id="state" type="text" placeholder="State" className="custom-input" />
</div>
</div>
<div className="mbsc-col-md-3 mbsc-col-6">
<div>
<label htmlFor="zip">Zip</label>
<input id="zip" type="text" placeholder="Zip" className="custom-input" />
</div>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-md-6 mbsc-col-12">
<mobiscroll.Switch>Agree to terms and conditions</mobiscroll.Switch>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-6">
<button>Submit</button>
</div>
</div>
</form>
</div>
<div className="mbsc-col-md-10 mbsc-col-xl-9 custom-section">
<h4>Skip enhancement of elements inside a mobiscroll form</h4>
<mobiscroll.Form className="mbsc-form-grid mbsc-grid">
<div className="mbsc-row">
<div className="mbsc-col-md-6 mbsc-col-12">
<mobiscroll.Input inputStyle="box" labelStyle="floating" type="text" placeholder="Email">Email</mobiscroll.Input>
</div>
<div className="mbsc-col-md-6 mbsc-col-12">
<mobiscroll.Input inputStyle="box" labelStyle="floating" type="password" placeholder="Password" passwordToggle={true}>Password</mobiscroll.Input>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-md-6 mbsc-col-12">
<mobiscroll.Input inputStyle="box" labelStyle="floating" type="text" placeholder="City">City</mobiscroll.Input>
</div>
<div className="mbsc-col-md-3 mbsc-col-6">
<mobiscroll.Input inputStyle="box" labelStyle="floating" type="text" placeholder="State">State</mobiscroll.Input>
</div>
<div className="mbsc-col-md-3 mbsc-col-6">
<mobiscroll.Input inputStyle="box" labelStyle="floating" type="text" placeholder="Zip">Zip</mobiscroll.Input>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-md-6 mbsc-col-12">
<mobiscroll.Switch inputStyle="box">Agree to terms and conditions</mobiscroll.Switch>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col-6">
<button data-enhance="false" className="custom-button">Submit</button>
</div>
</div>
</mobiscroll.Form>
</div>
<div className="mbsc-col-md-10 mbsc-col-xl-9 mbsc-form-grid outside-form">
<h4>Using form elements outside of forms</h4>
<div className="mbsc-row mbsc-padding">
<p>
Lorem ipsum dolor sit amet, similique expetendis suscipiantur no eos. Veniam officiis singulis usu id. Iriure animal vim ad, vix ex porro melius labitur, ea mentitum splendide laboramus pro. His vitae fabellas in, ad sed justo maiestatis. Te per quot
brute civibus. Ei elit voluptatum usu. Fuisset necessitatibus eum cu, te deserunt omittantur nam.
</p>
</div>
<div className="mbsc-row mbsc-align-items-center mbsc-justify-content-center mbsc-padding">
<div className="mbsc-col-12 mbsc-align-center">
<h4>Subscribe to our newsletter</h4>
</div>
<div className="mbsc-col-md-6 mbsc-col-12">
<mobiscroll.Input inputStyle="box" type="text" placeholder="Enter your email address"></mobiscroll.Input>
</div>
<div className="mbsc-col-md-3 mbsc-col-12 mbsc-align-center">
<mobiscroll.Button className="mbsc-btn-primary">Subscribe</mobiscroll.Button>
</div>
</div>
<div className="mbsc-row mbsc-padding">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</div>
</div>
</div>
</div>
);
}
}
<div id="content"></div>
.md-custom-usage {
font-size: 16px;
margin-top: 20px;
margin-bottom: 20px;
}
.custom-form {
margin: 0 -16px;
}
.custom-section {
margin: 20px 0;
}
.custom-form .mbsc-row {
margin: 10px 0;
}
.custom-input {
height: 40px;
width: 100%;
padding: 0 16px;
}
.md-custom-usage .custom-form button {
font-size: 14px;
font-weight: 600;
background: #6be085;
color: #000;
padding: 15px 25px;
}
.md-custom-usage button.custom-button {
font-size: 14px;
font-weight: 600;
background: #6be085;
color: #000;
padding: 15px 25px;
margin: 10px 16px;
}
.outside-form p {
text-align: justify;
}
Forms - Validation
Mobiscroll does not have built in validation mechanism, but provides error state styling. Use the mbsc-err
css class on the form element's container and the mbsc-err-msg
css class on the error message.
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
mobiscroll.settings = {
theme: '',
themeVariant: '',
lang: ''
};
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
formErrors: {},
formValues: {
username: '',
email: '',
password: '',
gender: '',
bio: ''
}
};
}
componentWillMount() {
this.initValidation();
}
onFormChange = (key, event) => {
const valueUpd = Object.assign({}, this.state.formValues);
valueUpd[key] = event.target.value;
const errorUpd = this.validateField(key, event.target.value);
this.setState({
formValues: valueUpd,
formErrors: errorUpd
});
}
render() {
return (
<div>
<mobiscroll.Form noValidate={true}>
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Sign Up</mobiscroll.FormGroupTitle>
<mobiscroll.Input
value={this.state.formValues.username}
onChange={this.onFormChange.bind(this, "username")}
valid={!this.state.formErrors.username}
errorMessage={this.state.formErrors.username}
placeholder="Username"
icon="user4" />
<mobiscroll.Input
type="email"
value={this.state.formValues.email}
onChange={this.onFormChange.bind(this, 'email')}
valid={!this.state.formErrors.email}
errorMessage={this.state.formErrors.email}
placeholder="Email"
icon="ion-ios7-email" />
<mobiscroll.Input
type="password"
value={this.state.formValues.password}
onChange={this.onFormChange.bind(this, "password")}
valid={!this.state.formErrors.password}
errorMessage={this.state.formErrors.password}
placeholder="Password"
icon="lock2"
passwordToggle={true} />
<mobiscroll.Dropdown
value={this.state.formValues.gender}
onChange={this.onFormChange.bind(this, "gender")}
valid={!this.state.formErrors.gender}
errorMessage={this.state.formErrors.gender}
icon="user4">
<option value="">Please select</option>
<option value="female">Female</option>
<option value="male">Male</option>
</mobiscroll.Dropdown>
<mobiscroll.Textarea
value={this.state.formValues.bio}
onChange={this.onFormChange.bind(this, "bio")}
valid={!this.state.formErrors.bio}
errorMessage={this.state.formErrors.bio}
placeholder="About me"
icon="line-note" />
</mobiscroll.FormGroup>
<mobiscroll.FormGroup className="mbsc-btn-group-block">
<mobiscroll.Button onClick={this.validateAllFields} icon="checkmark">Sign Up</mobiscroll.Button>
</mobiscroll.FormGroup>
</mobiscroll.Form>
<mobiscroll.Popup
ref={this.setRef}
focusOnClose={false}
buttons={[{
text: 'Log in',
handler: 'set'
}]}
>
<h3>Thank you for registering</h3>
<p>You have successfully signed up as a user!</p>
</mobiscroll.Popup>
</div>
);
}
setRef = (comp) => {
this.success = comp;
}
// set up validation
initValidation = () => {
this.validationSettings = {
username: [this.requiredCheck, this.minlengthCheck.bind(this, 2)],
email: [this.requiredCheck, this.emailCheck],
password: [this.requiredCheck, this.minlengthCheck.bind(this, 6)],
gender: [this.requiredCheck],
bio: [this.requiredCheck, this.minlengthCheck.bind(this, 20)],
}
}
// validation
validateField = (key, value) => {
let invalid = false;
if (this.validationSettings[key] !== undefined) {
for(let i = 0; i < this.validationSettings[key].length; i++) { // interate on validators
const validator = this.validationSettings[key][i];
invalid = invalid || validator.call(this, value);
}
}
let errorUpd = {};
errorUpd[key] = invalid;
return errorUpd;
}
validateAllFields = () => {
const errorsUpd = Object.assign({}, this.state.formErrors);
const values = Object.assign({}, this.state.formValues);
let allValid = true;
for (let key in values) {
errorsUpd[key] = this.validateField(key, values[key])[key];
allValid = allValid && !errorsUpd[key];
}
if (allValid) {
this.success.instance.show();
}
this.setState({
formErrors: errorsUpd
});
}
// validation check functions
requiredCheck = (value) => {
if (!!value) {
return false;
} else {
return 'This field is required';
}
}
minlengthCheck = (minlength, value) => {
if (!value || value.length < minlength) {
return 'It should be at least ' + minlength + ' characters long';
}
else {
return false;
}
}
emailCheck = (value) => {
if (/^\w+@\w+\.\w{2,3}$/.test(value)) {
return false;
} else {
return 'This is not a valid email';
}
}
}
<div id="content"></div>
Forms - Various fields
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
seg: 'minus',
prog1: 60,
prog2: 50,
check1: true,
check2: true,
switch1: true,
switch2: true,
rad1: '1',
rad2: '1',
slider1: 50,
slider2: 80
}
}
render() {
return (
<mobiscroll.Form className="mbsc-no-padding" inputStyle="box">
<div className="mbsc-grid">
<div className="mbsc-row mbsc-justify-content-center">
<div className="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-xl-5">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Alerts & Notifications</mobiscroll.FormGroupTitle>
<div className="mbsc-btn-group">
<mobiscroll.Button onClick={this.showAlert}>Alert</mobiscroll.Button>
<mobiscroll.Button onClick={this.showConfirm}>Confirm</mobiscroll.Button>
<mobiscroll.Button onClick={this.showPrompt}>Prompt</mobiscroll.Button>
<mobiscroll.Button onClick={this.showToast}>Toast</mobiscroll.Button>
<mobiscroll.Button onClick={this.showSnackbar}>Snackbar</mobiscroll.Button>
</div>
<div className="mbsc-align-center">
<mobiscroll.Note color="primary">This is a primary note!</mobiscroll.Note>
</div>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Buttons</mobiscroll.FormGroupTitle>
<div className="mbsc-btn-group">
<mobiscroll.Button>Button</mobiscroll.Button>
<mobiscroll.Button disabled>Disabled</mobiscroll.Button>
<mobiscroll.Button className="mbsc-btn-flat">Flat</mobiscroll.Button>
<mobiscroll.Button className="mbsc-btn-outline">Outline</mobiscroll.Button>
<mobiscroll.Button className="mbsc-btn-success">Success</mobiscroll.Button>
<mobiscroll.Button className="mbsc-btn-warning">Warning</mobiscroll.Button>
</div>
<mobiscroll.Segmented icon="minus" name="seg1" value="val1" checked={this.state.seg === 'minus'} onChange={this.setSeg}></mobiscroll.Segmented>
<mobiscroll.Segmented icon="plus" name="seg1" value="val1" checked={this.state.seg === 'plus'} onChange={this.setSeg}></mobiscroll.Segmented>
<mobiscroll.Stepper inputStyle="box">Stepper</mobiscroll.Stepper>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Inputs & Fields</mobiscroll.FormGroupTitle>
<mobiscroll.Input icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Input type="password" inputStyle="box" labelStyle="floating" passwordToggle="true" placeholder="Password field">Password</mobiscroll.Input>
<mobiscroll.Input type="file" inputStyle="box" labelStyle="floating" placeholder="Select file...">File upload</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" icon="bubble" iconAlign="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Slider & Progress</mobiscroll.FormGroupTitle>
<mobiscroll.Slider inputStyle="box" value={this.state.slider1} onChange={this.setSlider1}>Slider</mobiscroll.Slider>
<mobiscroll.Slider inputStyle="box" color="danger" value={this.state.slider2} onChange={this.setSlider2}>Danger</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value={this.state.prog1}>Progress</mobiscroll.Progress>
<mobiscroll.Progress inputStyle="box" color="success" value={this.state.prog2}>Success</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
<mobiscroll.Rating inputStyle="box" color="info" step=".5" value="3.5">Info</mobiscroll.Rating>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Toggle & Radio</mobiscroll.FormGroupTitle>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.check1} onChange={this.setCheck1}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Checkbox inputStyle="box" color="danger" checked={this.state.check2} onChange={this.setCheck2}>Danger</mobiscroll.Checkbox>
<mobiscroll.Switch inputStyle="box" checked={this.state.switch1} onChange={this.setSwitch1}>Switch</mobiscroll.Switch>
<mobiscroll.Switch inputStyle="box" color="info" checked={this.state.switch2} onChange={this.setSwitch2}>Info</mobiscroll.Switch>
<mobiscroll.Radio inputStyle="box" name="rad1" value="1" checked={this.state.rad1 === '1'} onChange={this.setRad1}> Radio Label 1</mobiscroll.Radio>
<mobiscroll.Radio inputStyle="box" name="rad1" value="2" checked={this.state.rad1 === '2'} onChange={this.setRad1}> Radio Label 2</mobiscroll.Radio>
<mobiscroll.Radio inputStyle="box" color="warning" name="rad2" value="1" checked={this.state.rad2 === '1'} onChange={this.setRad2}> Warning Label 1</mobiscroll.Radio>
<mobiscroll.Radio inputStyle="box" color="warning" name="rad2" value="2" checked={this.state.rad2 === '2'} onChange={this.setRad2}> Warning Label 2</mobiscroll.Radio>
</mobiscroll.FormGroup>
</div>
</div>
</div>
</mobiscroll.Form>
);
}
showAlert() {
mobiscroll.alert({,
title: 'Alert',
message: 'Alert message',
callback: function () {
mobiscroll.toast({,
message: 'Alert closed'
});
}
});
}
showConfirm() {
mobiscroll.confirm({,
title: 'Confirm',
message: 'Confirm message.',
callback: function (res) {
mobiscroll.toast({,
message: res ? 'OK' : 'Canceled'
});
}
});
}
showPrompt() {
mobiscroll.prompt({,
title: 'Prompt',
message: 'Prompt message.',
placeholder: 'Type here',
callback: function (value) {
mobiscroll.toast({,
message: value === null ? 'Canceled' : ('Your text: ' + value)
});
}
});
}
showToast() {
mobiscroll.toast({,
message: 'This is a toast'
});
}
showSnackbar() {
mobiscroll.snackbar({,
message: 'This is a snackbar'
});
}
setSeg = (event) => {
this.setState({
seg: event.target.value
});
}
setRad1 = (event) => {
this.setState({
rad1: event.target.value
});
}
setRad2 = (event) => {
this.setState({
rad2: event.target.value
});
}
setCheck1 = (ev) => {
this.setState({
check1: ev.target.checked
});
}
setCheck2 = (ev) => {
this.setState({
check2: ev.target.checked
});
}
setSlider1 = (value) => {
this.setState({
slider1: value
});
}
setSlider2 = (value) => {
this.setState({
slider2: value
});
}
setSwitch1 = (value) => {
this.setState({
switch1: value
});
}
setSwitch2 = (value) => {
this.setState({
switch2: value
});
}
}
<div id="content"></div>
Forms - Inline components
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
adults: 1,
children: 0,
infants: 0,
star: "1",
price: 100,
myrange: [new Date(2019, 10, 10), new Date(2019, 10, 12)],
work: false
}
}
adultChange = (value) => {
this.setState({
adults: value
});
}
childrenChange = (value) => {
this.setState({
children: value
});
}
infantChange = (value) => {
this.setState({
infants: value
});
}
render() {
return (
<mobiscroll.Form labelStyle="floating">
<div>
<mobiscroll.Input labelStyle="floating" placeholder="Where are you traveling?">Destination/Property name</mobiscroll.Input>
<mobiscroll.Stepper min={1} max={15} value={this.state.adults} onChange={this.adultsChange}>
<label>Adults</label>
<span className="mbsc-desc">From 14 years</span>
</mobiscroll.Stepper>
<mobiscroll.Stepper max={15} data-val="left" value={this.state.children} onChange={this.childrenChange}>
<label>Children</label>
<span className="mbsc-desc">2-14 years</span>
</mobiscroll.Stepper>
<mobiscroll.Stepper data-val="left" max={10} value={this.state.infants} onChange={this.infantChange}>
<label>Infant</label>
<span className="mbsc-desc">0-2 years</span>
</mobiscroll.Stepper>
<label>
Star rating
<mobiscroll.Select display="inline" value={this.state.star} select="multiple">
<option value="1">1 star</option>
<option value="2">2 stars</option>
<option value="3">3 stars</option>
<option value="4">4 stars</option>
<option value="4">5 stars</option>
</mobiscroll.Select>
</label>
<mobiscroll.Slider
labelStyle="stacked"
value={this.state.price}
data-val="left"
onChange={this.sliderChange}
data-tooltip="true"
max={1000}
data-template="${value}"
>
Price up to
</mobiscroll.Slider>
<label>
Checkin & checkout dates
<mobiscroll.Range
display="inline"
showSelector={false}
value={this.state.myrange}
>
</mobiscroll.Range>
</label>
<mobiscroll.Switch value={this.state.work}>Traveling for work?</mobiscroll.Switch>
</div>
<mobiscroll.FormGroup inset>
<mobiscroll.Button className="mbsc-btn-block" color="primary">Search</mobiscroll.Button>
</mobiscroll.FormGroup>
</mobiscroll.Form>
);
}
}
<div id="content"></div>
Forms - Embedded forms
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
const popupBtn = [{
text: 'Submit',
handler: 'set'
},
'cancel'
];
class App extends React.Component {
setPopup = (comp) => {
this.popup = comp;
}
showPopup = () => {
this.popup.instance.show();
}
render() {
return (
<div>
<mobiscroll.Note color="secondary" className="mbsc-align-center">Embed forms in cards or any layout element. 👇</mobiscroll.Note>
<mobiscroll.Card>
<mobiscroll.CardHeader>
<mobiscroll.CardTitle>Confirm Purchase</mobiscroll.CardTitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
<mobiscroll.Form.Label>
Name
<input type="text" placeholder="Required" />
</mobiscroll.Form.Label>
<mobiscroll.Form.Label>
Card
<input type="text" placeholder="Credit card number" />
</mobiscroll.Form.Label>
<mobiscroll.Form.Label>
Expiration
<input type="text" placeholder="Required" />
</mobiscroll.Form.Label>
<mobiscroll.Form.Label>
Security
<input type="text" placeholder="3-digit CVV" />
</mobiscroll.Form.Label>
</mobiscroll.CardContent>
<div className="mbsc-btn-group-block mbsc-padding">
<button className="mbsc-btn-primary">Confirm</button>
</div>
</mobiscroll.Card>
<mobiscroll.Note color="secondary" className="mbsc-align-center">You can also use embedded forms in pop-overs. 👇</mobiscroll.Note>
<div className="mbsc-btn-group-block">
<mobiscroll.Button onClick={this.showPopup}>Show popover with form</mobiscroll.Button>
</div>
<mobiscroll.Popup ref={this.setPopup} display="center" cssClass="mbsc-no-padding" buttons={popupBtn}>
<mobiscroll.Form>
<mobiscroll.FormGroup inset>
<mobiscroll.FormGroupTitle>Personal information</mobiscroll.FormGroupTitle>
<mobiscroll.Input labelStyle="inline" type="text" placeholder="John Doe">Name</mobiscroll.Input>
<mobiscroll.Input labelStyle="inline" type="text" placeholder="john@email.com">Email</mobiscroll.Input>
<mobiscroll.Input labelStyle="inline" type="text" placeholder="28 Darwin Street">Address</mobiscroll.Input>
<mobiscroll.Input labelStyle="inline" type="text" placeholder="Liverpool">City</mobiscroll.Input>
</mobiscroll.FormGroup>
</mobiscroll.Form>
</mobiscroll.Popup>
</div>
);
}
}
<div id="content"></div>
Forms - Input styling
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
switch1: true,
switch2: true,
switch3: true,
checkbox1: true,
checkbox2: true,
checkbox3: true
}
}
setSwitch1 = (ev) => {
this.setState({
switch1: ev.target.checked
});
}
setSwitch2 = (ev) => {
this.setState({
switch2: ev.target.checked
});
}
setSwitch3 = (ev) => {
this.setState({
switch3: ev.target.checked
});
}
setCheckbox1 = (ev) => {
this.setState({
checkbox1: ev.target.checked
});
}
setCheckbox2 = (ev) => {
this.setState({
checkbox2: ev.target.checked
});
}
setCheckbox3 = (ev) => {
this.setState({
checkbox3: ev.target.checked
});
}
render() {
return (
<div className="mbsc-grid mbsc-form-grid">
<div className="mbsc-row">
<div className="mbsc-col-sm-12 mbsc-col-md-4">
<mobiscroll.Form>
<h3 className="md-form-styling-hdr">Underline input style</h3>
<mobiscroll.FormGroup>
<mobiscroll.Input icon="user4" inputStyle="underline" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="underline" icon="bubble" iconAlign="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="underline" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="underline" checked={this.state.switch1} onChange={this.setSwitch1}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="underline" checked={this.state.checkbox1} onChange={this.setCheckbox1}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="underline" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="underline" value={50}>Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="underline">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<div className="mbsc-form-group-title">Inline label</div>
<mobiscroll.Input inputStyle="underline" labelStyle="inline" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="underline" labelStyle="inline" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<div className="mbsc-form-group-title">Stacked label</div>
<mobiscroll.Input inputStyle="underline" labelStyle="stacked" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="underline" labelStyle="stacked" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<div className="mbsc-form-group-title">Floating label</div>
<mobiscroll.Input inputStyle="underline" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="underline" labelStyle="floating" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
</mobiscroll.FormGroup>
</mobiscroll.Form>
</div>
<div className="mbsc-col-sm-12 mbsc-col-md-4">
<mobiscroll.Form className="mbsc-form-box">
<h3 className="md-form-styling-hdr md-form-styling-hdr-adjust">Box input style</h3>
<mobiscroll.FormGroup>
<mobiscroll.Input icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" icon="bubble" iconAlign="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.switch1} onChange={this.setSwitch1}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.checkbox1} onChange={this.setCheckbox1}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value={50}>Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<div className="mbsc-form-group-title">Inline label</div>
<mobiscroll.Input inputStyle="box" labelStyle="inline" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="inline" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<div className="mbsc-form-group-title">Stacked label</div>
<mobiscroll.Input inputStyle="box" labelStyle="stacked" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="stacked" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<div className="mbsc-form-group-title">Floating label</div>
<mobiscroll.Input inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
</mobiscroll.FormGroup>
</mobiscroll.Form>
</div>
<div className="mbsc-col-sm-12 mbsc-col-md-4">
<mobiscroll.Form className="mbsc-form-box">
<h3 className="md-form-styling-hdr md-form-styling-hdr-adjust">Outline input style</h3>
<mobiscroll.FormGroup>
<mobiscroll.Input icon="user4" inputStyle="outline" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="outline" labelStyle="floating" icon="bubble" iconAlign="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="outline" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="outline" checked={this.state.switch1} onChange={this.setSwitch1}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="outline" checked={this.state.checkbox1} onChange={this.setCheckbox1}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="outline" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="outline" value={50}>Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="outline">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<div className="mbsc-form-group-title">Inline label</div>
<mobiscroll.Input inputStyle="outline" labelStyle="inline" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="outline" labelStyle="inline" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<div className="mbsc-form-group-title">Stacked label</div>
<mobiscroll.Input inputStyle="outline" labelStyle="stacked" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="outline" labelStyle="stacked" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<div className="mbsc-form-group-title">Floating label</div>
<mobiscroll.Input inputStyle="outline" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="outline" labelStyle="floating" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
</mobiscroll.FormGroup>
</mobiscroll.Form>
</div>
</div>
</div>
);
}
}
<div id="content"></div>
.mbsc-page h3.md-form-styling-hdr {
margin: 16px;
}
.mbsc-page.mbsc-ios h3.md-form-styling-hdr-adjust {
margin-bottom: -1px;
}
Forms - Create account
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
class App extends React.Component {
render() {
return (
<mobiscroll.Form
theme=""
themeVariant=""
lang=""
className="md-create-account"
>
<div className="md-chart-pic"></div>
<div className="md-cac-title mbsc-padding">
<h4>Great news, your traffic <br /> is already being tracked</h4>
<h4>Continue by creating a new account</h4>
</div>
<div className="md-cac-cont">
<mobiscroll.FormGroup inset>
<mobiscroll.Input name="username" placeholder="Name" />
<mobiscroll.Input name="email" type="email" placeholder="Email address" />
<mobiscroll.Input name="password" type="password" placeholder="Password" passwordToggle={true} />
</mobiscroll.FormGroup>
<mobiscroll.FormGroup inset className="md-cac-btn">
<mobiscroll.Button block={true}>Create account</mobiscroll.Button>
<mobiscroll.Button block={true} flat={true}>I'll do it later</mobiscroll.Button>
</mobiscroll.FormGroup>
</div>
</mobiscroll.Form>
);
}
}
<div id="content"></div>
.md-create-account {
padding: 0 !important;
}
.md-create-account .md-cac-title {
text-align: center;
padding-bottom: 3em;
}
.md-create-account .md-cac-title,
.md-create-account .md-cac-cont {
padding-top: 0;
}
.md-create-account .md-cac-cont {
padding-bottom: 0;
}
.md-create-account .md-chart-pic {
background-image: url("/content/img/demos/chart@1x.png");
height: 150px;
background-repeat: no-repeat;
background-position: center;
}
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 144dpi) {
.md-create-account .md-chart-pic {
background: url("/Content/img/demos/chart@2x.png") no-repeat center 12px;
background-size: 109px 81px;
background-position: center;
}
}
.md-phone-num .mbsc-np-dsp {
min-height: 25px;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
Forms - Sign up
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
username: '',
email: '',
password: '',
nameValid: true,
nameError: '',
emailValid: true,
emailError: '',
passValid: true,
passError: ''
};
}
changeUsername = (event) => {
let username = event.target.value;
let valid = true;
let error = '';
if (!username) {
username = '';
valid = false;
error = 'This field is required';
} else if (username.length < 4) {
valid = false;
error = 'Please enter at leaset 4 characters';
}
this.setState({
username: username,
nameValid: valid,
nameError: error
});
}
changeEmail = (event) => {
let email = event.target.value;
let valid = true;
let error: '';
if (!email) {
email = '';
valid = false;
error = 'This field is required';
} else if (!/^[a-z0-9]+@[a-z]+$/.test(email)) {
valid = false;
error = 'Please provide a valid email address';
}
this.setState({
email: email,
emailValid: valid,
emailError: error
});
}
changePassword = (event) => {
let pass = event.target.value;
let valid = true;
let error: '';
if (!pass) {
email = '';
valid = false;
error = 'This field is required';
} else if (pass.length < 6) {
valid = false;
error = 'Password should be at least 6 characters';
}
this.setState({
password: pass,
passValid: valid,
passError: error
});
}
validate = (event) => {
const state = this.state;
const nameEntered = !!state.username;
const emailEntered = !!state.email;
const passEntered = !!state.password;
this.setState({
nameValid: nameEntered && state.nameValid,
nameError: nameEntered ? state.nameError : 'This field is required',
emailValid: emailEntered && state.emailValid,
emailError: emailEntered ? state.emailError : 'This field is required',
passValid: passEntered && state.passValid,
passError: passEntered ? state.passError : 'This field is required'
});
}
render() {
return (
<mobiscroll.Form theme="" themeVariant="" lang="" className="md-signup-rules" noValidate={true}>
<mobiscroll.FormGroup inset>
<mobiscroll.FormGroupTitle className="md-signup-title">Sign Up</mobiscroll.FormGroupTitle>
<mobiscroll.Input
value={this.state.username}
onChange={this.changeUsername}
error={!this.state.nameValid}
errorMessage={this.state.nameError}
placeholder="Name"
name="username" />
<mobiscroll.Input
type="email"
value={this.state.email}
onChange={this.changeEmail}
error={!this.state.emailValid}
errorMessage={this.state.emailError}
placeholder="Email"
name="email" />
<mobiscroll.Input
type="password"
value={this.state.password}
onChange={this.changePassword}
error={!this.state.passValid}
errorMessage={this.state.passError}
passwordToggle={true}
placeholder="Password"
name="password" />
</mobiscroll.FormGroup>
<mobiscroll.FormGroup inset>
<div className="mbsc-padding">
<h6 className="mbsc-desc">
<span className="mbsc-ic mbsc-ic-checkmark"></span> Use lowercase and uppercase characters
</h6>
<h6 className="mbsc-desc">
<span className="mbsc-ic mbsc-ic-checkmark"></span> Length of password should be at least 6 characters
</h6>
</div>
<mobiscroll.FormGroup>
<mobiscroll.Button block={true} onClick={this.validate}>Sign Up</mobiscroll.Button>
</mobiscroll.FormGroup>
</mobiscroll.FormGroup>
</mobiscroll.Form>
);
}
}
<div id="content"></div>
Forms - Log in
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
isLogin: false,
btnText: 'Sign in',
signup: "Don't have an account yet? Sign up.",
email: '',
emailValid: true,
emailError: '',
pass: '',
passValid: true,
passError: '',
submitted: false
};
}
emailChange = (event) => {
const invalid = this.validateEmail(event.target.value);
this.setState({
email: event.target.value,
emailValid: !this.state.submitted || !invalid,
emailError: invalid || ''
});
}
validateEmail = (email) => {
if (email) {
if (/[a-z]+@[a-z]+\.[a-z]+/.test(email)) {
return null;
} else {
return "Invalid email";
}
} else {
return "Email required";
}
}
passChange = (event) => {
const invalid = this.validatePass(event.target.value);
this.setState({
pass: event.target.value,
passValid: !this.state.submitted || !invalid,
passError: invalid || ''
});
}
validatePass = (pass) => {
if (pass) {
if (pass.length < 6) {
return 'At least 6 characters required';
} else {
return null;
}
} else {
return 'Password required';
}
}
signUp = (event) => {
const login = this.state.isLogin;
event.preventDefault();
this.setState({
signup: login ? "Don't have an account yet? Sign up." : "Already have an account?",
btnText: login ? "Sign in" : "Sign up",
isLogin: !login
});
}
password = (event) => {
event.preventDefault();
}
submit = (event) => {
const state = this.state;
event.preventDefault();
if (state.submitted && state.emailValid && state.passValid) {
mobiscroll.toast({ message: (state.isLogin ? 'Login' : 'Signup') + ' success!'});
} else {
const emailInvalid = this.validateEmail(state.email);
const passInvalid = this.validatePass(state.pass);
this.setState({
submitted: true,
emailValid: !emailInvalid,
emailError: emailInvalid || '',
passValid: !passInvalid,
passError: passInvalid || ''
});
}
}
render() {
return (
<mobiscroll.Form
theme=""
themeVariant=""
lang=""
className="md-login-form"
action="/login"
method='POST'
onSubmit={this.submit}
novalidate
>
<div className="md-logo micons icon-mbsc-logo"></div>
<mobiscroll.FormGroup inset>
<mobiscroll.Input type="email" name="Email" placeholder="Email" value={this.state.email} onChange={this.emailChange} valid={this.state.emailValid} errorMessage={this.state.emailError} />
<mobiscroll.Input type="password" name="Password" placeholder="Password" passwordToggle={true} icon="none" iconAlign="right" value={this.state.pass} onChange={this.passChange} valid={this.state.passValid} errorMessage={this.state.passError} />
</mobiscroll.FormGroup>
<mobiscroll.FormGroup inset className="mbsc-padding mbsc-align-center">
<a href="#" onClick={this.signUp}>{this.state.signup}</a>
<br/><br/>
<a href="#" onClick={this.password}>Forgot password?</a>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup inset className="mbsc-padding">
<mobiscroll.Button type="submit" block={true}>{this.state.btnText}</mobiscroll.Button>
</mobiscroll.FormGroup>
</mobiscroll.Form>
);
}
}
<div id="content"></div>
.md-login-form .md-logo {
display: inline-block;
width: 100%;
font-size: 80px;
text-align: center;
height: 46px;
margin: 130px 0 30px 0;
color: #1c75bc;
}
Forms - Theming capabilities
Forms can be themed and customized. There are four levels of customization:
- Base themes: Choose between
Mobiscroll
,iOS
,Android Material
andWindows
. - Light or dark: Every theme has a
light
anddark
variant. Setting thethemeVariant
to'auto'
will switch based on system settings. - Custom themes: Use the theme builder to customize the colors and make it match your brand.
- Custom Sass and CSS: If you need further customization, the sky is the limit with Sass and CSS overrides.
You can also see how the other demos look by changing the theme in the floating action bar on the right side (not this example, the themes are hardcoded here).
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
iosLightSwitch: true,
iosDarkSwitch: true,
iosCustomSwitch: true,
matLightSwitch: true,
matDarkSwitch: true,
matCustomSwitch: true,
winLightSwitch: true,
winDarkSwitch: true,
winCustomSwitch: true,
mobiLightSwitch: true,
mobiDarkSwitch: true,
mobiCustomSwitch: true,
iosLightCheck: true,
iosDarkCheck: true,
iosCustomCheck: true,
matLightCheck: true,
matDarkCheck: true,
matCustomCheck: true,
winLightCheck: true,
winDarkCheck: true,
winCustomCheck: true,
mobiLightCheck: true,
mobiDarkCheck: true,
mobiCustomCheck: true
};
}
render() {
return (
<div className="mbsc-grid mbsc-no-padding">
<div className="mbsc-row">
<mobiscroll.Form theme="ios" themeVariant="light" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle><b>iOS light theme</b></mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.iosLightSwitch} onChange={this.setIosLightSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.iosLightCheck} onChange={this.setIosLightCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
<mobiscroll.Form theme="ios-dark" themeVariant="dark" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle><b>iOS dark theme</b></mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.iosDarkSwitch} onChange={this.setIosDarkSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.iosDarkCheck} onChange={this.setIosDarkCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
<mobiscroll.Form theme="ios-gray" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle><b>iOS custom theme</b></mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.iosCustomSwitch} onChange={this.setIosCustomSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.iosCustomCheck} onChange={this.setIosCustomCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
</div>
<div className="mbsc-row">
<mobiscroll.Form theme="material" themeVariant="light" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle><b>Material light theme</b></mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.matLightSwitch} onChange={this.setMatLightSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.matLightCheck} onChange={this.setMatLightCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
<mobiscroll.Form theme="material-dark" themeVariant="dark" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle><b>Material dark theme</b></mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.matDarkSwitch} onChange={this.setMatDarkSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.matDarkCheck} onChange={this.setMatDarkCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
<mobiscroll.Form theme="material-indigo" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle><b>Material custom theme</b></mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.matCustomSwitch} onChange={this.setMatCustomSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.matCustomCheck} onChange={this.setMatCustomCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
</div>
<div className="mbsc-row">
<mobiscroll.Form theme="windows" themeVariant="light" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Windows light theme</mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.winLightSwitch} onChange={this.setWinLightSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.matLightCheck} onChange={this.setMatLightCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
<mobiscroll.Form theme="windows-dark" themeVariant="dark" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Windows dark theme</mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.winDarkSwitch} onChange={this.setWinDarkSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.matDarkCheck} onChange={this.setMatDarkCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
<mobiscroll.Form theme="windows-yellow" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Windows custom theme</mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.winCustomSwitch} onChange={this.setWinCustomSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.winCustomCheck} onChange={this.setWinCustomCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
</div>
<div className="mbsc-row">
<mobiscroll.Form theme="mobiscroll" themeVariant="light" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle><b>Mobiscroll light theme</b></mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.mobiLightSwitch} onChange={this.setMobiLightSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.mobiLightCheck} onChange={this.setMobiLightCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
<mobiscroll.Form theme="mobiscroll-dark" themeVariant="dark" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle><b>Mobiscroll dark theme</b></mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.mobiDarkSwitch} onChange={this.setMobiDarkSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.mobiDarkCheck} onChange={this.setMobiDarkCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
<mobiscroll.Form theme="mobiscroll-lime" className="mbsc-col-sm-12 mbsc-col-md-4 mbsc-form-box mbsc-form-grid">
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle><b>Mobiscroll custom theme</b></mobiscroll.FormGroupTitle>
<mobiscroll.Input type="text" data-icon="user4" inputStyle="box" labelStyle="floating" placeholder="Input with label">Input field</mobiscroll.Input>
<mobiscroll.Textarea inputStyle="box" labelStyle="floating" data-icon="bubble" data-icon-align="left" placeholder="Textarea with left icon">Textarea</mobiscroll.Textarea>
<mobiscroll.Dropdown inputStyle="box" labelStyle="floating" label="Select">
<option value="Opel">Opel</option>
<option value="Renault">Renault</option>
<option value="Citroen">Citroen</option>
<option value="Lotus">Lotus</option>
</mobiscroll.Dropdown>
<mobiscroll.Switch inputStyle="box" checked={this.state.mobiCustomSwitch} onChange={this.setMobiCustomSwitch}>Switch</mobiscroll.Switch>
<mobiscroll.Checkbox inputStyle="box" checked={this.state.mobiCustomCheck} onChange={this.setMobiCustomCheck}>Checkbox</mobiscroll.Checkbox>
<mobiscroll.Slider inputStyle="box" value={50}>Slider</mobiscroll.Slider>
<mobiscroll.Progress inputStyle="box" value="50">Progress</mobiscroll.Progress>
<mobiscroll.Rating inputStyle="box">Rating</mobiscroll.Rating>
</mobiscroll.FormGroup>
</mobiscroll.Form>
</div>
</div>
);
}
setIosLightSwitch = (ev) => {
this.setState({
iosLightSwitch: ev.target.checked
});
}
setIosDarkSwitch = (ev) => {
this.setState({
iosDarkSwitch: ev.target.checked
});
}
setIosCustomSwitch = (ev) => {
this.setState({
iosCustomSwitch: ev.target.checked
});
}
setMatLightSwitch = (ev) => {
this.setState({
matLightSwitch: ev.target.checked
});
}
setMatDarkSwitch = (ev) => {
this.setState({
matDarkSwitch: ev.target.checked
});
}
setMatCustomSwitch = (ev) => {
this.setState({
matCustomSwitch: ev.target.checked
});
}
setWinLightSwitch = (ev) => {
this.setState({
winLightSwitch: ev.target.checked
});
}
setWinDarkSwitch = (ev) => {
this.setState({
winDarkSwitch: ev.target.checked
});
}
setWinCustomSwitch = (ev) => {
this.setState({
winCustomSwitch: ev.target.checked
});
}
setMobiLightSwitch = (ev) => {
this.setState({
mobiLightSwitch: ev.target.checked
});
}
setMobiDarkSwitch = (ev) => {
this.setState({
mobiDarkSwitch: ev.target.checked
});
}
setMobiCustomSwitch = (ev) => {
this.setState({
mobiCustomSwitch: ev.target.checked
});
}
setIosLightCheck = (ev) => {
this.setState({
iosLightCheck: ev.target.checked
});
}
setIosDarkCheck = (ev) => {
this.setState({
iosDarkCheck: ev.target.checked
});
}
setIosCustomCheck = (ev) => {
this.setState({
iosCustomCheck: ev.target.checked
});
}
setMatLightCheck = (ev) => {
this.setState({
matLightCheck: ev.target.checked
});
}
setMatDarkCheck = (ev) => {
this.setState({
matDarkCheck: ev.target.checked
});
}
setMatCustomCheck = (ev) => {
this.setState({
matCustomCheck: ev.target.checked
});
}
setWinLightCheck = (ev) => {
this.setState({
winLightCheck: ev.target.checked
});
}
setWinDarkSCheck = (ev) => {
this.setState({
winDarkCheck: ev.target.checked
});
}
setWinCustomCheck = (ev) => {
this.setState({
winCustomCheck: ev.target.checked
});
}
setMobiLightCheck = (ev) => {
this.setState({
mobiLightCheck: ev.target.checked
});
}
setMobiDarkCheck = (ev) => {
this.setState({
mobiDarkCheck: ev.target.checked
});
}
setMobiCustomCheck = (ev) => {
this.setState({
mobiCustomCheck: ev.target.checked
});
}
}
<div id="content"></div>
Looking for something you didn't see or have a sales question?
Ask us about it, we're here to help.
Component license
Purchase component licenses if you are looking for specific funcionality.
All
Framework license
Get all 36 components, including
Framework license
Get all 36 components, including
- Use it when building with plain and simple JS
- Compatible with vanilla JS app or frameworks like Vue
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with jQuery and jQuery Mobile
- Enjoy the familiar API if you already use jQuery
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular JS and Ionic 1
- For web and mobile apps based on Angular 1.x
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular and Ionic 2/3/4
- Visual Studio and VS Code integration
- Royalty-free commercial usage
- Technical support is included with the license
- Use it when building with React JS
- Collection of UI components for web and mobile
- Royalty-free commercial usage
- Technical support is included with the license
Framework license
Select the development framework you are using. Get all 36 components with the license.
- Use it when building with plain and simple JS
- Compatible with vanilla JS app or frameworks like Vue
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with jQuery and jQuery Mobile
- Enjoy the familiar API if you already use jQuery
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular JS and Ionic 1
- For web and mobile apps based on Angular 1.x
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular and Ionic 2/3/4
- Visual Studio and VS Code integration
- Royalty-free commercial usage
- Technical support is included with the license
- Use it when building with React JS
- Collection of UI components for web and mobile
- Royalty-free commercial usage
- Technical support is included with the license
Select the framework you are interested in
Use Javascript when building with plain and simple JS.
Use jQuery when you have jQuery already included or if you are building with jQuery Mobile.
Use AngularJS when building with Angular 1.x or Ionic 1.
Use Angular when building with Angular 2/4/5/6/7/8/9 or Ionic 2/3/4.
Use it when you are building your app or website with React.
Do you need additional support seats?
The license comes with one support seat. ( +$100/seat )
Add the source code?
What framework are you using?
We have to set you up with a trial for this to run 👍
Step 1.Install the Mobiscroll CLI from npm
$ npm install -g @mobiscroll/cli
The CLI makes configuring your apps super simple 👍
Step 2.Run the following command in the root folder of your Ionic project
$ mobiscroll config ionic
$ mobiscroll config ionic --lite
You will be prompted to log in with your mobiscroll account. Set your password here
Create an Ionic 3 & Mobiscroll starter with the CLI:
Run this command for Ionic 4 & Mobiscroll starter:
Step 3.Copy the code into your app.
Step 4.Run ionic serve in the root folder of your app 🎉
$ ionic serve
And voilà, everything should be running smoothly.
Step 1.Install the Mobiscroll CLI from npm
$ npm install -g @mobiscroll/cli
The CLI makes configuring your apps super simple 👍
Step 2.Run the following command in the root folder of your Angular project
$ mobiscroll config angular
$ mobiscroll config angular --lite
You will be prompted to log in with your mobiscroll account. Set your password here
Step 3.Copy the code into your app. HTML goes into the markup, TS into Typescript.
Step 4.Run ng serve in the root folder of your app 🎉
$ ng serve
And voilà, everything should be running smoothly.
Extract the zip file and run the project like any Ionic app. Make sure to have Ionic CLI installed and open the terminal in the app root folder.
$ npm install
$ ionic serve
Let us know if we can help and enjoy!
Your password has been changed!
Everything is set up so that you can dig in right away and start exploring.
Please extract the zip file and simply open the demos in your favorite browser.
For instructions on how to install Mobiscroll in your project
follow this guide.
Let us know if we can help and enjoy!
Please extract the zip file and run the project like any Angular CLI app.
Make sure to have the Angular CLI installed.
For installation and usage, extract the zip file and open a terminal window and follow these steps.
$ npm install
$ ng serve --open
Let us know if we can help and enjoy! 👍
Everything is set up so that you can dig in right away and start exploring.
We have set up a trial so that you can try the demos locally.
The easiest way to get started is to follow the installation steps and by
grabbing the code directly from the demo page. Let us know if we can help and enjoy!
You'll find a fully functional Kitchen-sink Ionic app in the zip file.
The demos are using Babel's in-browser ES6 and JSX transformer.
Please extract the zip file and open the demos in your browser.
For instructions on how to install Mobiscroll in your project
follow this guide.
Let us know if we can help and enjoy!