React Scroller
Scroller for React
Scroller for React
Scroller for React
Scroller - Price Range
class ScrollerDemo extends React.Component {
render() {
var fromValues = [],
toValues = [];
for (var i = 0; i <= 1000; i += 20) {
fromValues.push({
display: '$' + i,
value: i
});
}
toValues = fromValues.slice();
toValues.shift();
toValues.push({
display: 'over $1000'
});
return (
<div>
<mobiscroll.Scroller
ref="scroller"
theme=""
lang=""
width={150}
wheels={[
[{
circular: false,
data: fromValues,
label: 'From'
}, {
circular: false,
data: toValues,
label: 'To'
}]
]}
showLabel={true}
minWidth={130}
cssClass="md-pricerange"
validate={function (event, inst) {
var i,
values = event.values,
disabledValues = [];
for (i = 0; i < toValues.length; ++i) {
if (toValues[i].value <= values[0]) {
disabledValues.push(toValues[i].value);
}
}
return {
disabled: [
[], disabledValues
]
}
}}
formatValue={function (data) {
return '$' + data[0] + ' - $' + data[1];
}}
parseValue={function (valueText) {
if (valueText) {
return valueText.replace(/\s/gi, '').split('-');
}
return [0, 20];
}}
placeholder="Please Select..."
/>
</div>
);
}
}
<div id="content">
Scroller - Custom Units
class ScrollerDemo extends React.Component {
render() {
var units = ['oz', 'g', 'serving'],
prevUnit = 'oz',
wheel = [
[{
circular: false,
data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
}, {
circular: false,
data: ['-', '1/4', '1/2', '3/4']
}, {
circular: false,
data: units
}]
];
return (
<div>
<mobiscroll.Scroller
ref="scroller"
theme=""
lang=""
wheels={wheel}
validate={function (event, inst) {
var i,
mult = 1,
index = event.index,
currUnit = event.values[2],
disabled = [];
if (currUnit == 'g' && (prevUnit == 'oz' || prevUnit == 'serving')) {
mult = 28;
} else if ((currUnit != 'oz' || currUnit != 'serving') && prevUnit == 'g') {
mult = 1 / 28;
}
if (currUnit != 'serving') {
disabled.push('1/4', '1/2', '3/4');
}
if (index == 2 && currUnit != prevUnit) {
for (i = 0; i < wheel[0][0].data.length; ++i) {
wheel[0][0].data[i] = Math.round(wheel[0][0].data[i] * mult);
}
inst.settings.wheels = wheel;
inst._tempWheelArray[0] = inst._tempWheelArray[0] * mult;
inst.changeWheel({
0: wheel[0][0]
});
prevUnit = currUnit;
}
return {
disabled: [
[], disabled, []
]
}
}}
parseValue={function (val) {
var hasUnit;
if (val) {
val = val.toString().split(' ');
hasUnit = units.indexOf(val[1]) !== -1;
return [val[0], (hasUnit ? '' : val[1].replace('-', '')), (hasUnit ? val[1] : val[2])];
}
return [0, '-', 'oz'];
}}
formatValue={function (data) {
return (data[2] == 'serving' && data[0] == 0 && data[1] ? '' : data[0]) + (data[1] ? ' ' + data[1].replace('-', '') : '') + ' ' + data[2];
}}
placeholder="Please Select..."
/>
</div>
);
}
}
<div id="content">
Scroller - Date range
class ScrollerDemo extends React.Component {
render() {
var fromValues = ['Before 1960', 1970, 1980, 1990, 1995, 2000, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015],
toValues = [1970, 1980, 1990, 1995, 2000, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016];
return (
<div>
<mobiscroll.Scroller
ref="scroller"
theme=""
lang=""
rows={12}
wheels={[
[{
circular: false,
data: fromValues,
label: 'From'
}, {
circular: false,
data: toValues,
label: 'To'
}]
]}
showLabel={true}
minWidth={130}
cssClass="md-daterange"
validate={function (event, inst) {
var i,
values = event.values,
disabledValues = [];
for (i = 0; i < toValues.length; ++i) {
if (toValues[i] <= values[0]) {
disabledValues.push(toValues[i]);
}
}
return {
disabled: [
[], disabledValues
]
}
}}
formatValue={function (data) {
return data[0] + ' - ' + data[1];
}}
parseValue={function (valueText) {
if (valueText) {
return valueText.replace(/\s/gi, '').split('-');
}
return [1990, 2010];
}}
placeholder="Please Select..."
/>
</div>
);
}
}
<div id="content">
Scroller - Event handlers
EVENTS FIRED:
class ScrollerDemo extends React.Component {
onInit = (event, inst) => {
// Your custom event handler goes here
}
onMarkupReady = (event, inst) => {
// Your custom event handler goes here
}
onBeforeShow = (event, inst) => {
// Your custom event handler goes here
}
onPosition = (event, inst) => {
// Your custom event handler goes here
}
onShow = (event, inst) => {
// Your custom event handler goes here
}
onSet = (event, inst) => {
// Your custom event handler goes here
}
onItemTap = (event, inst) => {
// Your custom event handler goes here
}
onDestroy = (event, inst) => {
// Your custom event handler goes here
}
onClose = (event, inst) => {
// Your custom event handler goes here
}
onCancel = (event, inst) => {
// Your custom event handler goes here
}
onBeforeClose = (event, inst) => {
// Your custom event handler goes here
}
onClear = (event, inst) => {
// Your custom event handler goes here
}
onChange = (event, inst) => {
// Your custom event handler goes here
}
validate = (data, inst) => {
// Your custom event handler goes here
}
render() {
return (
<div>
<mobiscroll.Scroller
ref="scroller"
theme=""
lang=""
onInit={this.onInit}
onMarkupReady={this.onMarkupReady}
onBeforeShow={this.onBeforeShow}
onPosition={this.onPosition}
onShow={this.onShow}
onSet={this.onSet}
onItemTap={this.onItemTap}
onDestroy={this.onDestroy}
onClose={this.onClose}
onCancel={this.onCancel}
onBeforeClose={this.onBeforeClose}
onClear={this.onClear}
onChange={this.onChange}
validate={this.validate}
wheels={[
[{
data: ['0', '1', '2', '3', '4', '5', '6', '7']
}, {
data: [{
value: 0,
display: 'a'
}, {
value: 1,
display: 'b'
}, {
value: 2,
display: 'c'
}, {
value: 3,
display: 'd'
}]
}]
]}
placeholder="Please Select..."
/>
</div>
);
}
}
<div id="content"></div>
Scroller - Display modes
mobiscroll.settings = {
lang: '',
theme: ''
};
class ScrollerDemo extends React.Component {
render() {
return (
<mobiscroll.Form >
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Try different display modes</mobiscroll.FormGroupTitle>
<label>
Bottom
<mobiscroll.Scroller
display="bottom"
wheels={[
[{
label: 'First wheel',
data: ['0', '1', '2', '3', '4', '5', '6', '7']
}, {
label: 'Second wheel',
data: [{
value: 0,
display: 'a'
}, {
value: 1,
display: 'b'
}, {
value: 2,
display: 'c'
}, {
value: 3,
display: 'd'
}]
}]
]}
placeholder="Please Select..."
/>
</label>
<label>
Top
<mobiscroll.Scroller
display="top"
wheels={[
[{
label: 'First wheel',
data: ['0', '1', '2', '3', '4', '5', '6', '7']
}, {
label: 'Second wheel',
data: [{
value: 0,
display: 'a'
}, {
value: 1,
display: 'b'
}, {
value: 2,
display: 'c'
}, {
value: 3,
display: 'd'
}]
}]
]}
placeholder="Please Select..."
/>
</label>
<label>
Center
<mobiscroll.Scroller
display="center"
wheels={[
[{
label: 'First wheel',
data: ['0', '1', '2', '3', '4', '5', '6', '7']
}, {
label: 'Second wheel',
data: [{
value: 0,
display: 'a'
}, {
value: 1,
display: 'b'
}, {
value: 2,
display: 'c'
}, {
value: 3,
display: 'd'
}]
}]
]}
placeholder="Please Select..."
/>
</label>
<label>
Bubble
<mobiscroll.Scroller
display="bubble"
wheels={[
[{
label: 'First wheel',
data: ['0', '1', '2', '3', '4', '5', '6', '7']
}, {
label: 'Second wheel',
data: [{
value: 0,
display: 'a'
}, {
value: 1,
display: 'b'
}, {
value: 2,
display: 'c'
}, {
value: 3,
display: 'd'
}]
}]
]}
placeholder="Please Select..."
/>
</label>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup className="mbsc-padding">
<p className="mbsc-thin">With inline display you can embed the Scroller component in almost any markup or form.</p>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Embedded scroller picker</mobiscroll.FormGroupTitle>
<mobiscroll.Scroller
type="hidden"
display="inline"
layout="liquid"
wheels={[
[{
label: 'First wheel',
data: ['0', '1', '2', '3', '4', '5', '6', '7']
}, {
label: 'Second wheel',
data: [{
value: 0,
display: 'a'
}, {
value: 1,
display: 'b'
}, {
value: 2,
display: 'c'
}, {
value: 3,
display: 'd'
}]
}]
]}
placeholder="Please Select..."
/>
</mobiscroll.FormGroup>
</mobiscroll.Form>
);
}
}
<div id="content"></div>
Scroller - Desktop
mobiscroll.settings = {
lang: '',
theme: ''
};
class DateDemo extends React.Component {
render() {
var wheelData = [
[{
data: ['0', '1', '2', '3', '4', '5', '6', '7']
}, {
data: [{
value: 0,
display: 'a'
}, {
value: 1,
display: 'b'
}, {
value: 2,
display: 'c'
}, {
value: 3,
display: 'd'
}]
}]
]
return (
<mobiscroll.Form>
<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 inset>
<mobiscroll.FormGroupTitle>Pop-up positioning</mobiscroll.FormGroupTitle>
<label>
Top
<mobiscroll.Scroller
touchUi={false}
display="top"
wheels={wheelData}
placeholder="Please select..."
/>
</label>
<label>
Bottom
<mobiscroll.Scroller
touchUi={false}
display="bottom"
wheels={wheelData}
placeholder="Please select..."
/>
</label>
<label>
Anchored
<mobiscroll.Scroller
touchUi={false}
wheels={wheelData}
placeholder="Please select..."
/>
</label>
<label>
Center
<mobiscroll.Scroller
touchUi={false}
display="center"
wheels={wheelData}
placeholder="Please select..."
/>
</label>
</mobiscroll.FormGroup>
</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.FormGroup inset>
<mobiscroll.FormGroupTitle>With buttons</mobiscroll.FormGroupTitle>
<label>
Set button
<mobiscroll.Scroller
display="center"
touchUi={false}
wheels={wheelData}
buttons={['set']}
placeholder="Please select..."
/>
</label>
<label>
Set/Cancel
<mobiscroll.Scroller
display="center"
touchUi={false}
wheels={wheelData}
buttons={['set', 'cancel']}
placeholder="Please select..."
/>
</label>
</mobiscroll.FormGroup>
</div>
</div>
</div>
</mobiscroll.Form>
);
}
}
<div id="content"></div>
Scroller - Theming capabilities
mobiscroll.settings = {
theme: '',
lang: ''
};
class ScrollerDemo extends React.Component {
render () {
var wheelData = [
[{
data: ['0', '1', '2', '3', '4', '5', '6', '7']
}, {
data: [{
value: 0,
display: 'a'
}, {
value: 1,
display: 'b'
}, {
value: 2,
display: 'c'
}, {
value: 3,
display: 'd'
}]
}]
]
return (
<mobiscroll.Form>
<div className="mbsc-grid-fixed mbsc-grid-lg">
<div className="mbsc-row">
<div className="mbsc-col">
<mobiscroll.FormGroup inset>
<mobiscroll.FormGroupTitle>iOS Theme</mobiscroll.FormGroupTitle>
<label>
Light
<mobiscroll.Scroller
theme="ios"
display="center"
touchUi={false}
wheels={wheelData}
placeholder="Please Select..."
/>
</label>
<label>
Dark
<mobiscroll.Scroller
theme="ios-dark"
display="center"
touchUi={false}
wheels={wheelData}
placeholder="Please Select..."
/>
</label>
</mobiscroll.FormGroup>
</div>
<div className="mbsc-col">
<mobiscroll.FormGroup inset>
<mobiscroll.FormGroupTitle>Material Theme</mobiscroll.FormGroupTitle>
<label>
Light
<mobiscroll.Scroller
theme="material"
display="center"
touchUi={false}
wheels={wheelData}
placeholder="Please Select..."
/>
</label>
<label>
Dark
<mobiscroll.Scroller
theme="material-dark"
display="center"
touchUi={false}
wheels={wheelData}
placeholder="Please Select..."
/>
</label>
</mobiscroll.FormGroup>
</div>
</div>
<div className="mbsc-row">
<div className="mbsc-col">
<mobiscroll.FormGroup inset>
<mobiscroll.FormGroupTitle>Windows Theme</mobiscroll.FormGroupTitle>
<label>
Light
<mobiscroll.Scroller
theme="windows"
display="center"
touchUi={false}
wheels={wheelData}
placeholder="Please Select..."
/>
</label>
<label>
Dark
<mobiscroll.Scroller
theme="windows-dark"
display="center"
touchUi={false}
wheels={wheelData}
placeholder="Please Select..."
/>
</label>
</mobiscroll.FormGroup>
</div>
<div className="mbsc-col">
<mobiscroll.FormGroup inset>
<mobiscroll.FormGroupTitle>Mobiscroll Theme</mobiscroll.FormGroupTitle>
<label>
Light
<mobiscroll.Scroller
theme="mobiscroll"
display="center"
touchUi={false}
wheels={wheelData}
placeholder="Please Select..."
/>
</label>
<label>
Dark
<mobiscroll.Scroller
theme="mobiscroll-dark"
display="center"
touchUi={false}
wheels={wheelData}
placeholder="Please Select..."
/>
</label>
</mobiscroll.FormGroup>
</div>
</div>
</div>
</mobiscroll.Form>
);
}
}
<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 2/4/5/6/7 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 2/4/5/6/7 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 or Ionic 2/3/4.
Use it when you are building your app or website with React.
Do you need additional support seats?
The framework license comes with one support seat. ( +$50/seat )
Add the source code?
What framework are you using?
We have to set you up with a trial for this to run 👍
What framework are you using?
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:
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.
We have set up a trial so that you can try the demos locally.
Extract the zip file and open the demo in your favorite browser.
To install Mobiscroll in your project
follow instructions from this page.
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.
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 demos are using Babel's in-browser ES6 and JSX transformer.
Extract the zip file and open the demo in your browser. To install Mobiscroll in your project
follow instructions from this page.
Let us know if we can help and enjoy! 👍