React Option List
Option List for React
Option List for React
Option List for React
Option List - Settings
class ListItem extends React.Component {
render() {
return <li data-icon={this.props.item.icon}>
<p>{this.props.item.text1}</p>
<p>{this.props.item.text2}</p>
</li>;
}
}
class OptionlistDemo extends React.Component {
constructor(props) {
super(props);
this.state = {
options: [{
selected: true,
icon: "connection",
text: "Wi-Fi"
}, {
selected: false,
icon: "ion-bluetooth",
text: "Bluetooth"
}, {
selected: false,
icon: "location",
text: "Location"
}, {
selected: false,
icon: "fa-rotate-left",
text: "Screen rotation"
}, {
selected: true,
icon: "volume-medium",
text: "Sound"
}, {
selected: false,
icon: "download",
text: "Data"
}, {
selected: false,
icon: "foundation-minus-circle",
text: "Blocking mode"
}, {
selected: false,
icon: "airplane",
text: "Airplane mode"
}, {
selected: true,
icon: "fa-leaf",
text: "Power saving"
}, {
selected: false,
icon: "alarm2",
text: "Alarm"
}, {
selected: false,
icon: "ion-android-system-windows",
text: "Multi window"
}],
items: [{
id: 1,
icon: "ion-usb",
text1: "Connected as a media device",
text2: "Touch for other USB options"
}, {
id: 2,
icon: "foundation-mail",
text1: "4 new messages",
text2: "hello@mobiscroll.com"
}, {
id: 3,
icon: "foundation-mail",
text1: "1 new message",
text2: "support@mobiscroll.com"
}, {
id: 4,
icon: "alarm2",
text1: "Time to wake up",
text2: "8:00 AM"
}, {
id: 5,
icon: "calendar",
text1: "Google I/O Keynote",
text2: "Moscone West"
}, {
id: 6,
icon: "download",
text1: "Download finished",
text2: "mobiscroll.custom-2.17.0.zip"
}]
};
}
stages = () => {
return {
left: [{
percent: 30,
icon: 'remove',
text: 'dismiss',
action: function (event, inst) {
inst.remove(event.target);
return false;
}
}],
right: [{
percent: -30,
icon: 'remove',
text: 'dismiss',
action: function (event, inst) {
inst.remove(event.target);
return false;
}
}]
};
}
toggleOption = (index) => {
var options = this.state.options;
options[index].selected = !options[index].selected;
this.setState({
options: options
});
mobiscroll.toast({
message: this.state.options[index].text + (this.state.options[index].selected ? ' ON' : ' OFF')
});
}
render() {
return (
<div>
<mobiscroll.Optionlist
lang=""
theme=""
itemWidth={72}
>
{this.state.options.map(function (option, index) {
return (
<mobiscroll.OptionItem
key={index}
icon={option.icon}
selected={option.selected}
onClick={this.toggleOption.bind(null, index)}>
{option.text}
</mobiscroll.OptionItem>
);
}, this)}
</mobiscroll.Optionlist>
<mobiscroll.Form theme="" lang="" >
<div>
<label>
<input defaultValue="55" type="range" data-role="range" data-icon='{ "left": "brightness-contrast" }'/>
</label>
<label>
<input defaultValue="85" type="range" data-role="range" data-icon='{ "left": "volume-medium" }'/>
</label>
</div>
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Notifications</mobiscroll.FormGroupTitle>
<mobiscroll.Listview
enhance={true}
itemType={ListItem}
data={this.state.items}
stages={this.stages()}
theme=""
lang=""
/>
</mobiscroll.FormGroup>
</mobiscroll.Form>
</div>
);
}
}
<div id="content"></div>
Option List - Scroll options
class OptionlistDemo extends React.Component {
render() {
return (
<div className="md-pic-edit">
<mobiscroll.Optionlist
lang=""
theme=""
display="top"
select="off"
layout="fixed"
itemWidth={83}
onItemTap={function (event, inst) {
mobiscroll.toast({
message: event.target.getAttribute('data-text')
});
}}
>
<mobiscroll.OptionItem icon="material-crop" data-text="Crop"></mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="material-brightness-medium" data-text="Brightness"></mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="material-rotate-right" data-text="Rotate"></mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="material-filter" data-text="Filter"></mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="material-palette" data-text="Paint"></mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="material-iso" data-text="ISO"></mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="material-wb-auto" data-text="Auto color"></mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="material-photo-size-select-large" data-text="Resize"></mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="material-texture" data-text="Texture"></mobiscroll.OptionItem>
</mobiscroll.Optionlist>
<div className="md-pic-overlay"></div>
</div>
);
}
}
<div id="content"></div>
/* pic */
.md-pic-edit .md-pic-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('/Content/img/photo_edit.png');
background-repeat: no-repeat;
background-size: cover;
background-origin: content-box;
}
Option List - Single/multiple select
class OptionlistDemo extends React.Component {
render() {
return (
<div>
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Single select</mobiscroll.FormGroupTitle>
<mobiscroll.Optionlist
lang=""
theme=""
select="single"
>
<mobiscroll.OptionItem icon="connection">Wifi</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="location">Location</mobiscroll.OptionItem>
<mobiscroll.OptionItem selected="true" icon="volume-medium">Sound</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="fa-rotate-left">Rotation</mobiscroll.OptionItem>
<mobiscroll.OptionItem disabled="true" icon="ion-bluetooth">Bluetooth</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="cogs">Settings</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="user4">Reading</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="download">Data</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="foundation-minus-circle">Blocking</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="fa-leaf">Power</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="ion-android-system-windows">Windows</mobiscroll.OptionItem>
</mobiscroll.Optionlist>
</mobiscroll.FormGroup>
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Multiple select</mobiscroll.FormGroupTitle>
<mobiscroll.Optionlist
lang=""
theme=""
select="multiple"
>
<mobiscroll.OptionItem selected="true" icon="material-format-bold"></mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="material-format-ital"></mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="material-format-underline"></mobiscroll.OptionItem>
</mobiscroll.Optionlist>
</mobiscroll.FormGroup>
</div>
);
}
}
<div id="content"></div>
Option List - Event handlers
EVENTS FIRED:
class OptionlistDemo extends React.Component {
onInit = (event, inst) => {
// Your custom event handler goes here
}
onMarkupReady = (event, inst) => {
// Your custom event handler goes here
}
onMove = (event, inst) => {
// Your custom event handler goes here
}
onItemTap = (event, inst) => {
// Your custom event handler goes here
}
onAnimationStart = (event, inst) => {
// Your custom event handler goes here
}
onAnimationEnd = (event, inst) => {
// Your custom event handler goes here
}
onGestureStart = (event, inst) => {
// Your custom event handler goes here
}
onGestureEnd = (event, inst) => {
// Your custom event handler goes here
}
render() {
return (
<mobiscroll.FormGroup>
<mobiscroll.FormGroupTitle>Multiple select</mobiscroll.FormGroupTitle>
<mobiscroll.Optionlist
lang=""
theme=""
onInit={this.onInit}
onMarkupReady={this.onMarkupReady}
onMove={this.onMove}
onItemTap={this.onItemTap}
onAnimationStart={this.onAnimationStart}
onAnimationEnd={this.onAnimationEnd}
onGestureStart={this.onGestureStart}
onGestureEnd={this.onGestureEnd}
>
<mobiscroll.OptionItem icon="connection">Wifi</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="location">Location</mobiscroll.OptionItem>
<mobiscroll.OptionItem selected="true" icon="volume-medium">Sound</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="fa-rotate-left">Rotation</mobiscroll.OptionItem>
<mobiscroll.OptionItem disabled="true" icon="ion-bluetooth">Bluetooth</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="cogs">Settings</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="user4">Reading</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="download">Data</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="foundation-minus-circle">Blocking</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="fa-leaf">Power</mobiscroll.OptionItem>
<mobiscroll.OptionItem icon="ion-android-system-windows">Windows</mobiscroll.OptionItem>
</mobiscroll.Optionlist>
</mobiscroll.FormGroup>
);
}
}
<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! 👍