React Cards
Cards for React
Cards for React
Cards for React
Cards component for rendering any type of content: photos, text, video and forms in a consistent way.
Use it for organizing content and provide entry points with optional actions.
Shipping with useful features for creating effective layouts:
- Built from three blocks: header, content & footer
- Fully supports typograpy elements & classes
- Thumbnail, avatar, inline & cover image support
- Integrates with horizontal scroll view and list view
- Multiple theme support
- Lightweight footprint
- RTL Support
- Supports card collections
Cards demos available for other frameworks.
Viewing demos & code for
Cards - Basic
class CardsDemo extends React.Component {
action = (txt) => {
mobiscroll.toast({
message: txt + ' clicked'
});
}
render() {
return (
<div>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.CardTitle>Title</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle>Subtitle</mobiscroll.CardSubtitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
</mobiscroll.CardContent>
<mobiscroll.CardFooter>This is a footer</mobiscroll.CardFooter>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.CardContent>
<mobiscroll.CardTitle>Don't forget Jenifer's birthday</mobiscroll.CardTitle>
</mobiscroll.CardContent>
<mobiscroll.CardFooter>
<button onClick={() => { this.action('Call') }} className="mbsc-btn-flat" data-icon="phone">Call</button>
<button onClick={() => { this.action('Message') }} className="mbsc-btn-flat" data-icon="bubble">Message</button>
</mobiscroll.CardFooter>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
>
<img src="https://img.mobiscroll.com/demos/card_5.png" />
<mobiscroll.CardContent>
Explore the azure depths with a stay at the Manta Resort's underwater room.
</mobiscroll.CardContent>
<mobiscroll.CardFooter>
<button className="mbsc-btn-flat">Share</button>
<button className="mbsc-btn-flat">Explore</button>
</mobiscroll.CardFooter>
</mobiscroll.Card>
</div>
);
}
}
<div id="content"></div>
Cards - Images
class CardsDemo extends React.Component {
render() {
return (
<div>
<mobiscroll.Card
theme=""
lang=""
>
<img src="https://img.mobiscroll.com/demos/card_2.png" />
<mobiscroll.CardHeader>
<mobiscroll.CardTitle>Best animal adventure</mobiscroll.CardTitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
A young panda tests his climbing skills at the Chengdu Research Base.
</mobiscroll.CardContent>
<mobiscroll.CardFooter>
<button className="mbsc-btn-flat">Share</button>
<button className="mbsc-btn-flat">Explore</button>
</mobiscroll.CardFooter>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.CardTitle>15 minutes to work</mobiscroll.CardTitle>
</mobiscroll.CardHeader>
<img src="https://img.mobiscroll.com/demos/route.png" />
<mobiscroll.CardContent className="mbsc-btn-group-block">
<button className="mbsc-btn-flat mbsc-align-left" data-icon="ion-navigate">Navigate / 15 min. via Shotwell St</button>
<button className="mbsc-btn-flat mbsc-align-left" data-icon="fa-rotate-left">Alternative route / 18 mins</button>
</mobiscroll.CardContent>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
className="md-card-bg"
>
<img src="https://mobiscroll.comhttps://img.mobiscroll.com/demos/card_6.png" />
<h2 className="md-card-title mbsc-align-center">Las Vegas</h2>
<h5 className="md-card-subtitle mbsc-align-center mbsc-bold">63 apartments available</h5>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
>
<img className="mbsc-img-thumbnail mbsc-pull-right" width="90" height="90" src="https://img.mobiscroll.com/demos/card_3.png" />
<mobiscroll.CardHeader>
<mobiscroll.CardTitle>Best places</mobiscroll.CardTitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
A view across the Turnagain Arm on Alaska's Kenai Peninsula.
</mobiscroll.CardContent>
</mobiscroll.Card>
</div>
);
}
}
<div id="content"></div>
.md-card-bg .md-card-subtitle,
.md-card-bg .md-card-title {
position: absolute;
top: 50%;
color: #fff;
width: 100%;
}
.md-card-bg .md-card-title {
margin-top: -30px;
}
.md-card-bg .md-card-subtitle {
margin-top: 10px;
}
Cards - Video
class CardsDemo extends React.Component {
render() {
return (
<div>
<mobiscroll.Card
theme=""
lang=""
>
<video autoplay muted controls>
<source src="http://img.mobiscroll.com/demos/trailer_iphone.m4v" type="video/x-m4v" />
</video>
<mobiscroll.CardHeader>
<mobiscroll.CardTitle>Big Buck Bunny</mobiscroll.CardTitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
Open movie made with open source software. Check out it's trailer!
</mobiscroll.CardContent>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
>
<video autoplay muted controls>
<source src="http://img.mobiscroll.com/demos/trailer_iphone.m4v" type="video/x-m4v" />
</video>
<mobiscroll.CardFooter>
<button className="mbsc-btn-flat">Play</button>
<button className="mbsc-btn-flat">Reset</button>
</mobiscroll.CardFooter>
</mobiscroll.Card>
</div>
);
}
}
<div id="content"></div>
Cards - Lists
class ActionItem extends React.Component {
render() {
var children = null;
if (this.props.item.children && this.props.item.children.length > 0) {
children = <ul>
{this.props.item.children.map(function(child) {
return <ActionItem key={child.id} item={child} />;
})}
</ul>;
}
return <li data-id={this.props.item.id} data-icon={this.props.item.icon}> {this.props.item.title}
{children}
</li>;
}
}
class TodoItem extends React.Component {
render() {
return <li data-id={this.props.item.id}>
<input type="checkbox" data-role="none" defaultChecked={this.props.item.checked} />
{this.props.item.todo}
</li>;
}
}
class CardsDemo extends React.Component {
render() {
return (
<div>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.Listview
itemType={ActionItem}
data={this.state.actions}
theme=""
lang=""
swipe={false}
enhance={true}
/>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.Listview
itemType={TodoItem}
data={this.state.todos}
theme=""
lang=""
stages={this.todoStages()}
/>
</mobiscroll.Card>
</div>
);
}
constructor(props) {
super(props);
this.state = {
actions: [{
id: 1,
title: "Edit profile",
icon: 'line-user',
children: [{
id: 2,
title: 'Change password',
icon: 'line-key'
}, {
id: 3,
title: 'Change personal information',
icon: 'line-user'
}]
}, {
id: 4,
title: 'Settings',
icon: 'line-settings',
children: [{
id: 5,
title: 'Sound settings',
icon: 'line-megaphone'
}, {
id: 6,
title: 'Notification settings',
icon: 'line-params'
}, {
id: 7,
title: 'Change theme',
icon: 'line-t-shirt'
}]
}, {
id: 8,
title: 'Rate',
icon: 'line-heart',
children: [{
id: 9,
title: 'Rate this application',
icon: 'line-star'
}]
}, {
id: 10,
title: 'Tell a friend',
icon: 'line-bubble',
children: [{
id: 11,
title: 'Share it in Email',
icon: 'line-mail'
}, {
id: 12,
title: 'Share it on Social Media',
icon: 'line-world'
}]
}, {
id: 13,
title: 'Term of service',
icon: 'line-note',
children: [{
id: 14,
title: 'This application content is under WTFPL license.'
}]
}, {
id: 15,
title: 'Contact us',
icon: 'line-mail',
children: [{
id: 16,
title: 'Let us know if we can help',
icon: 'line-mail'
}]
}, {
id: 17,
title: 'About us',
icon: 'line-world',
children: [{
id: 18,
title: 'We are the Mobiscroll team.'
}]
}],
todos: [{
id: 19,
todo: 'Do the laundry',
checked: true
}, {
id: 20,
todo: 'Check out new Mobiscroll features',
checked: false
}, {
id: 21,
todo: 'Don\'t forget Mom\'s birthday',
checked: true
}, {
id: 22,
todo: 'Update my app with the latest Mobiscroll',
checked: false
}, {
id: 23,
todo: 'Buy new shoes',
checked: false
}, {
id: 24,
todo: 'Need ketchup for pizza',
checked: false
}],
nextId: 25
};
}
todoStages = () => {
return {
left: [{
key: 'stage1',
icon: 'plus',
color: '#31c6e7',
text: 'Add',
action: function (event, inst) {
this.state.todos.splice(event.index + 1, 0, {
id: this.state.nextId++,
todo: 'New Todo',
checked: false
});
this.setState({
todos: this.state.todos
});
}.bind(this)
}],
right: [{
key: 'stage2',
color: '#009688',
text: 'Remove',
icon: 'remove',
action: function (event, inst) {
this.state.todos.splice(event.index, 1);
this.setState({
todos: this.state.todos
});
return false;
}.bind(this)
}]
};
}
}
<div id="content"></div>
.mbsc-lv-cont .cd-todo-item {
padding: 0;
}
Cards - Social cards
class CardsDemo extends React.Component {
render() {
return (
<div>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.Avatar src="https://img.mobiscroll.com/demos/mr-profile2.png" />
<mobiscroll.CardTitle className="mbsc-bold">Carl Obama</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle> at 5:16 PM</mobiscroll.CardSubtitle>
</mobiscroll.CardHeader>
<img src="https://img.mobiscroll.com/demos/Blueberry.png" />
<mobiscroll.CardContent>
Yeaahhh :D :D :D I've made it. It took me 3 months to improve my blueberry cake. But it's perfect now. :P
</mobiscroll.CardContent>
<mobiscroll.CardFooter>
<button className="mbsc-btn mbsc-btn-flat" data-icon="heart"></button>
<button className="mbsc-btn mbsc-btn-flat" data-icon="thumbs-up2"></button>
<button className="mbsc-btn mbsc-btn-flat" data-icon="material-message"></button>
<button className="mbsc-btn mbsc-btn-flat" data-icon="tag"></button>
</mobiscroll.CardFooter>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.Avatar src="https://img.mobiscroll.com/demos/mrs-profile1.png" />
<mobiscroll.CardTitle className="mbsc-bold">Hortense Tinker</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle> at 4:55 PM</mobiscroll.CardSubtitle>
</mobiscroll.CardHeader>
<img src="https://img.mobiscroll.com/demos/card_1.png" />
<mobiscroll.CardContent>
Best places to seek silence !!! The Dhamma Giri, a vipassana meditation retreat.
</mobiscroll.CardContent>
<mobiscroll.CardFooter className="mbsc-align-right">
<button className="mbsc-btn mbsc-btn-flat" data-icon="fa-mail-reply"></button>
<button className="mbsc-btn mbsc-btn-flat" data-icon="star3">3</button>
<button className="mbsc-btn mbsc-btn-flat" data-icon="fa-retweet">5</button>
<button className="mbsc-btn mbsc-btn-flat" data-icon="fa-ellipsis-h"></button>
</mobiscroll.CardFooter>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.Avatar src="https://img.mobiscroll.com/demos/mrs-profile2.png" />
<mobiscroll.CardTitle className="mbsc-bold">Jenna Doe</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle> at 4:16 PM</mobiscroll.CardSubtitle>
</mobiscroll.CardHeader>
<img src="https://img.mobiscroll.com/demos/card_2.png" />
<mobiscroll.CardContent>
There is a new baby panda at the zoo.... :) :O :D
</mobiscroll.CardContent>
<mobiscroll.CardFooter className="mbsc-align-right">
<button className="mbsc-btn mbsc-btn-flat" data-icon="fa-mail-reply"></button>
<button className="mbsc-btn mbsc-btn-flat" data-icon="star3">19</button>
<button className="mbsc-btn mbsc-btn-flat" data-icon="fa-retweet">3</button>
<button className="mbsc-btn mbsc-btn-flat" data-icon="fa-ellipsis-h"></button>
</mobiscroll.CardFooter>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.Avatar src="https://img.mobiscroll.com/demos/mr-profile1.png" />
<mobiscroll.CardTitle className="mbsc-bold">John Bush</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle> at 2:23 PM</mobiscroll.CardSubtitle>
</mobiscroll.CardHeader>
<img src="https://img.mobiscroll.com/demos/account-background.jpg" />
<mobiscroll.CardContent>
Best trip ever!!! :D I'll definetly come back here. :)
</mobiscroll.CardContent>
<mobiscroll.CardFooter>
<button className="mbsc-btn mbsc-btn-flat">Like</button>
<button className="mbsc-btn mbsc-btn-flat">Share</button>
</mobiscroll.CardFooter>
</mobiscroll.Card>
</div>
);
}
}
<div id="content"></div>
Cards - Forms
class CardsDemo extends React.Component {
constructor(props) {
super(props);
this.state = {
volume: 70,
alarm: 60,
mobile: 30
}
}
volumeChange = (prop, values) => {
var state = this.state;
state[prop] = values;
this.setState(state);
}
render() {
return (
<div>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.CardTitle>Volume</mobiscroll.CardTitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
<mobiscroll.Slider value={this.state.volume} onChange={this.volumeChange.bind(this, 'volume')} data-icon='{ "left": "volume-medium" }' />
<mobiscroll.Slider value={this.state.alarm} onChange={this.volumeChange.bind(this, 'alarm')} data-icon='{ "left": "alarm2" }' />
<mobiscroll.Slider value={this.state.mobile} onChange={this.volumeChange.bind(this, 'mobile')} data-icon='{ "left": "mobile" }' />
</mobiscroll.CardContent>
</mobiscroll.Card>
<mobiscroll.Card
theme=""
lang=""
>
<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.Card
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.CardTitle>Calendar</mobiscroll.CardTitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
<mobiscroll.Calendar
type="hidden"
ref="calendar"
display="inline"
/>
</mobiscroll.CardContent>
</mobiscroll.Card>
</div>
);
}
}
<div id="content"></div>
Cards - Swipe away
class ListItem extends React.Component {
render() {
let content = "";
switch (this.props.item.type) {
case 'appNote':
content =
<mobiscroll.Card>
<mobiscroll.CardContent>
<mobiscroll.Avatar src={this.props.item.img} />
<mobiscroll.CardTitle>{this.props.item.title}</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle>{this.props.item.text}</mobiscroll.CardSubtitle>
</mobiscroll.CardContent>
</mobiscroll.Card>
break;
case 'reminder':
content =
<mobiscroll.Card>
<mobiscroll.CardHeader>
<mobiscroll.CardTitle>{this.props.item.title}</mobiscroll.CardTitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
{this.props.item.text}
</mobiscroll.CardContent>
<mobiscroll.CardFooter>
<button className="mbsc-btn-flat" data-icon="phone">Call</button>
<button className="mbsc-btn-flat" data-icon="bubble">Message</button>
</mobiscroll.CardFooter>
</mobiscroll.Card>
break;
}
return <li> {content} </li>;
}
}
class ListviewDemo extends React.Component {
constructor(props) {
super(props);
this.state = {
items: [{
title: 'Netflix',
text: 'Sherlock Series 3 is now avalable on Netflix',
img: 'https://img.mobiscroll.com/demos/netflix.png',
type: 'appNote',
id: 1
}, {
title: 'Angry birds',
text: 'Dont forget your daily Arena entry.',
img: 'https://img.mobiscroll.com/demos/angrybirds.png',
type: 'appNote',
id: 2
}, {
title: 'Today is Jenifer\'s birthday',
text: 'Don\'t forget she is turning 25!!!',
img: 'https://img.mobiscroll.com/demos/opencam.png',
type: 'reminder',
id: 3
}, {
title: 'Candycam',
text: 'A new update is available!',
img: 'https://img.mobiscroll.com/demos/candycam.png',
type: 'appNote',
id: 4
}, {
title: 'Subway Surf',
text: 'Is it your lucky day? 24-Hour Mega Jackpint Event happening right now!',
img: 'https://img.mobiscroll.com/demos/subwaysurf.png',
type: 'appNote',
id: 5
}, {
title: 'Mobiscroll',
text: 'The new Mobiscroll 4.0.0 is out!',
img: 'https://img.mobiscroll.com/demos/mbsc-logo.png',
type: 'appNote',
id: 6
}, {
title: 'Open Camera',
text: 'A new update is available!',
img: 'https://img.mobiscroll.com/demos/opencam.png',
type: 'appNote',
id: 7
}]
};
}
stages = () => {
var ids = 6;
return [{
percent: -20,
action: (event, inst) => {
inst.remove(event.target);
return false;
}
}, {
percent: 20,
action: (event, inst) => {
inst.remove(event.target);
return false;
}
}]
}
render() {
return (
<div>
<mobiscroll.Note color="primary">Swipe left/right to clear cards.</mobiscroll.Note>
<mobiscroll.Listview
className="mbsc-card-list"
theme=""
lang=""
itemType={ListItem}
data={this.state.items}
stages={this.stages()}
/>
</div>
);
}
}
<div id="content"></div>
Cards - Stacked cards
class ListItem extends React.Component {
render() {
var classes = (this.props.item.id % 2 == 0 ? 'custom-card-rotate-right' : (this.props.item.id % 3 == 0 ? 'custom-card-rotate-left' : '')) + ' custom-card';
return (
<li>
<mobiscroll.Card
className={classes}
lang=""
theme=""
>
<mobiscroll.CardHeader>
<mobiscroll.CardTitle>{this.props.item.title}</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle>{this.props.item.desc}</mobiscroll.CardSubtitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
<img draggable="false" src={this.props.item.img} />
</mobiscroll.CardContent>
</mobiscroll.Card>
</li>
);
}
}
class ListviewDemo extends React.Component {
constructor(props) {
super(props);
this.state = {
items: [{
id: 1,
title: 'Best places to seek silence',
desc: 'The Dhamma Giri, a vipassana meditation retreat.',
img: 'https://img.mobiscroll.com/demos/card_1.png'
}, {
id: 2,
title: 'Best animal adventure',
desc: 'A young panda tests his climbing skills at the Chengdu Research Base.',
img: 'https://img.mobiscroll.com/demos/card_2.png'
}, {
id: 3,
title: 'Best places to test your survival skills',
desc: 'A view across the Turnagain Arm on Alaska\'s Kenai Peninsula.',
img: 'https://img.mobiscroll.com/demos/card_3.png'
}, {
id: 4,
title: 'Most accessible destinations',
desc: 'The impressive Mayan site of Chichén Itzá.',
img: 'https://img.mobiscroll.com/demos/card_4.png'
}, {
id: 5,
title: 'The world’s most extraordinary sleepovers',
desc: 'Explore the azure depths with a stay at the Manta Resort\'s underwater room.',
img: 'https://img.mobiscroll.com/demos/card_5.png'
}]
};
}
stages = () => {
return [{
percent: -20,
action: (event, inst) => {
inst.remove(event.target);
return false;
}
}, {
percent: 20,
action: (event, inst) => {
inst.remove(event.target);
return false;
}
}];
}
cycleStages = () => {
return [{
percent: -20,
action: (event, inst) => {
inst.move(event.target, 0);
return false;
}
}, {
percent: 20,
action: (event, inst) => {
inst.move(event.target, 0);
return false;
}
}];
}
render() {
return (
<div>
<mobiscroll.Note color="primary">Swipe cards away left or right to clear stack.</mobiscroll.Note>
<mobiscroll.Listview
className="mbsc-card-list custom-card-deck"
lang=""
theme=""
itemType={ListItem}
data={this.state.items}
stages={this.stages()}
/>
<mobiscroll.Note color="primary">Swipe cards away for cyclic movement.</mobiscroll.Note>
<mobiscroll.Listview
className="mbsc-card-list custom-card-deck"
lang=""
theme=""
itemType={ListItem}
data={this.state.items}
stages={this.cycleStages()}
/>
</div>
);
}
}
<div id="content"></div>
.custom-card-deck,
.custom-card-deck .mbsc-lv-v {
height: 400px;
max-width: 500px;
margin: 15px auto;
}
.custom-card-deck .mbsc-lv-item {
position: absolute;
top: 0;
left: 0;
right: 0;
}
.custom-card-deck .mbsc-lv-item.mbsc-lv-item-swiping {
z-index: 10;
}
.custom-card-deck .custom-card {
height: 320px;
}
.custom-card-deck .custom-card-rotate-right {
transform: rotate(1deg);
}
.custom-card-deck .custom-card-rotate-left {
transform: rotate(-2deg);
}
.custom-card-deck .mbsc-card.custom-card {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
}
Cards - Content
class CardsDemo extends React.Component {
render() {
return (
<div class="mbsc-padding">
<h3>Sunrise</h3>
<p>Sunrise or sun up is the instant at which the upper edge of the Sun appears over the horizon in the morning. The term can also refer to the entire process of the Sun crossing the horizon and its accompanying atmospheric effects.</p>
<mobiscroll.Card theme="" lang="" >
<img src="https://img.mobiscroll.com/demos/bookpic.png" />
<mobiscroll.CardFooter>
A red sunrise near Swifts Creek, Australia
</mobiscroll.CardFooter>
</mobiscroll.Card>
<p>Although the Sun appears to "rise" from the horizon, it is actually the Earth's motion that causes the Sun to appear. The illusion of a moving Sun results from Earth observers being in a rotating reference frame; this apparent motion is so convincing that most cultures had mythologies and religions built around the geocentric model, which prevailed until astronomer Nicolaus Copernicus first formulated the heliocentric model in the 16th century.</p>
</div>
);
}
}
<div id="content"></div>
Cards - Tabs
class CardsDemo extends React.Component {
constructor(props) {
super(props);
this.state = {
selectedMenu: 'food'
};
}
render() {
var content;
switch (this.state.selectedMenu) {
case 'food':
content = <div>
<h4>Ina's Mac and Cheese</h4>
<p>
Here's what one recipe reviewer had to say: "This mac and cheese is all grown-up. It was tasty, cheesy and easy to make. Have made it a few times in the last 2 months and it is a hit each time."
</p>
</div>
break;
case 'tech':
content = <div>
<h4>Google Go</h4>
<p>
Google Go makes discovering, exploring, and sharing the best of the web easy and fast. Get answers quickly and reliably with Google Go, even on slow connections and smartphones with low space. At 5MB in size, it’s speedy to download and get started.
</p>
</div>;
break;
case 'travel':
content = <div>
<h4>Take Lots Of Photos</h4>
<p>
You may only see these places & meet these people once in your lifetime. Remember them forever with plenty of photos. Don’t worry about looking like a “tourist”. Are you traveling to look cool? No one cares. Great photos are the ultimate souvenir.
</p>
</div>;
break;
}
return (
<div>
<mobiscroll.Card
theme=""
lang=""
>
<mobiscroll.CardContent>
<mobiscroll.CardTitle>Daily tips</mobiscroll.CardTitle>
</mobiscroll.CardContent>
<mobiscroll.TabNav
lang=""
theme=""
display="inline"
>
<mobiscroll.NavItem selected={this.state.selectedMenu == 'food'} onClick={this.selectMenu.bind(null, 'food')}>Food</mobiscroll.NavItem>
<mobiscroll.NavItem selected={this.state.selectedMenu == 'tech'} onClick={this.selectMenu.bind(null, 'tech')}>Tech</mobiscroll.NavItem>
<mobiscroll.NavItem selected={this.state.selectedMenu == 'travel'} onClick={this.selectMenu.bind(null, 'travel')}>Travel</mobiscroll.NavItem>
</mobiscroll.TabNav>
<mobiscroll.CardContent>
{content}
</mobiscroll.CardContent>
<mobiscroll.CardFooter>
<button className="mbsc-btn-flat">Read more</button>
</mobiscroll.CardFooter>
</mobiscroll.Card>
</div>
);
}
selectMenu = (newMenu) => {
this.setState({ selectedMenu: newMenu });
}
}
<div id="content"></div>
.md-card-tab {
display: none;
}
.md-card-tab-sel {
display: block;
}
Cards - Collapsible
class CardsDemo extends React.Component {
constructor(props) {
super(props);
}
closeAll = () => {
this.refs.run1.instance.hide();
this.refs.run2.instance.hide();
this.refs.run3.instance.hide();
}
toggleFirst = () => {
this.refs.run1.instance.toggle();
}
render() {
return (
<div>
<mobiscroll.Note className="mbsc-align-center" color="primary">Use collapsible cards for segmenting long forms and to hide content.</mobiscroll.Note>
<mobiscroll.Form>
<div className="mbsc-btn-group-block">
<mobiscroll.Button onClick={this.toggleFirst}>Toggle first card</mobiscroll.Button>
<mobiscroll.Button onClick={this.closeAll}>Close all cards</mobiscroll.Button>
</div>
</mobiscroll.Form>
<mobiscroll.Card collapsible
ref="run1"
theme=""
lang=""
>
<mobiscroll.CardHeader>
<div>
<mobiscroll.CardSubtitle className="mbsc-bold mbsc-txt-s">27/07/2018</mobiscroll.CardSubtitle>
<div className="mbsc-bold">FRIDAY AFTERNOON RUN</div>
<div className="mbsc-grid mbsc-margin mbsc-txt-muted mbsc-bold mbsc-txt-s">
<div className="mbsc-row mbsc-no-padding">
<div className="mbsc-col">5.43km</div>
<div className="mbsc-col">5'44"/km</div>
<div className="mbsc-col">30:45</div>
</div>
</div>
</div>
</mobiscroll.CardHeader>
<mobiscroll.CardContent className="mbsc-no-padding">
<img src="https://img.mobiscroll.com/demos/run-1.png" />
<div className="mbsc-btn-group-block">
<button className="mbsc-btn-primary">View details</button>
<button className="mbsc-btn-secondary">Share your run</button>
</div>
</mobiscroll.CardContent>
</mobiscroll.Card>
<mobiscroll.Card collapsible open
ref="run2"
theme=""
lang=""
>
<mobiscroll.CardHeader>
<div>
<mobiscroll.CardSubtitle className="mbsc-bold mbsc-txt-s">30/07/2018</mobiscroll.CardSubtitle>
<div className="mbsc-bold">MONDAY AFTERNOON RUN</div>
<div className="mbsc-grid mbsc-margin mbsc-txt-muted mbsc-bold mbsc-txt-s">
<div className="mbsc-row mbsc-no-padding">
<div className="mbsc-col">4.28km</div>
<div className="mbsc-col">4'12"/km</div>
<div className="mbsc-col">26:41</div>
</div>
</div>
</div>
</mobiscroll.CardHeader>
<mobiscroll.CardContent className="mbsc-no-padding">
<img src="https://img.mobiscroll.com/demos/run-2.png" />
<div className="mbsc-btn-group-block">
<button className="mbsc-btn-primary">View details</button>
<button className="mbsc-btn-secondary">Share your run</button>
</div>
</mobiscroll.CardContent>
</mobiscroll.Card>
<mobiscroll.Card collapsible
ref="run3"
theme=""
lang=""
>
<mobiscroll.CardHeader>
<div>
<mobiscroll.CardSubtitle className="mbsc-bold mbsc-txt-s">01/08/2018</mobiscroll.CardSubtitle>
<div className="mbsc-bold">WEDNESDAY AFTERNOON RUN</div>
<div className="mbsc-grid mbsc-margin mbsc-txt-muted mbsc-bold mbsc-txt-s">
<div className="mbsc-row mbsc-no-padding">
<div className="mbsc-col">7.02km</div>
<div className="mbsc-col">3'59"/km</div>
<div className="mbsc-col">37:41</div>
</div>
</div>
</div>
</mobiscroll.CardHeader>
<mobiscroll.CardContent className="mbsc-no-padding">
<img src="https://img.mobiscroll.com/demos/run-3.png" />
<div className="mbsc-btn-group-block">
<button className="mbsc-btn-primary">View details</button>
<button className="mbsc-btn-secondary">Share your run</button>
</div>
</mobiscroll.CardContent>
</mobiscroll.Card>
</div>
);
}
}
<div id="content"></div>
Cards - Accordion
class ListItem extends React.Component {
render() {
return <React.Fragment>
<li data-icon="material-email">
<p>Email</p>
<h4><a href="mailto:{this.props.item.email}">{this.props.item.email}</a></h4>
</li>
<li data-icon="material-phone-iphone">
<p>Mobile</p>
<h4><a href="tel:{this.props.item.phone}">{this.props.item.phone}</a></h4>
</li>
</React.Fragment>
}
}
class FormsDemo extends React.Component {
render() {
return (
<div>
<mobiscroll.Note className="mbsc-align-center" color="primary">Use the accordion on forms to open only one panel at a time.</mobiscroll.Note>
<mobiscroll.Form>
<div className="mbsc-btn-group-block">
<mobiscroll.Button onClick={this.toggleLast}>Toggle last panel</mobiscroll.Button>
<mobiscroll.Button onClick={this.closeAll}>Close all panels</mobiscroll.Button>
</div>
</mobiscroll.Form>
<mobiscroll.Accordion>
<mobiscroll.Card collapsible open
ref="cont1"
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.Avatar src="https://img.mobiscroll.com/demos/f2.png" />
<mobiscroll.CardTitle className="mbsc-bold">Adeline Sharman</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle>Bigcorp Inc.</mobiscroll.CardSubtitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
<mobiscroll.Listview
itemType={ListItem}
data={[this.state.items[0]]}
theme=""
lang=""
swipe={true}
enhance={true}
/>
</mobiscroll.CardContent>
</mobiscroll.Card>
<mobiscroll.Card collapsible
ref="cont2"
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.Avatar src="https://img.mobiscroll.com/demos/m2.png" />
<mobiscroll.CardTitle className="mbsc-bold">Carl Hambledon</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle>Washaway Ltd.</mobiscroll.CardSubtitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
<mobiscroll.Listview
itemType={ListItem}
data={[this.state.items[1]]}
theme=""
lang=""
swipe={true}
enhance={true}
/>
</mobiscroll.CardContent>
</mobiscroll.Card>
<mobiscroll.Card collapsible
ref="cont3"
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.Avatar src="https://img.mobiscroll.com/demos/f1.png" />
<mobiscroll.CardTitle className="mbsc-bold">Hortense Tinker</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle>Tinker Records</mobiscroll.CardSubtitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
<mobiscroll.Listview
itemType={ListItem}
data={[this.state.items[2]]}
theme=""
lang=""
swipe={true}
enhance={true}
/>
</mobiscroll.CardContent>
</mobiscroll.Card>
<mobiscroll.Card collapsible
ref="cont4"
theme=""
lang=""
>
<mobiscroll.CardHeader>
<mobiscroll.Avatar src="https://img.mobiscroll.com/demos/m1.png" />
<mobiscroll.CardTitle className="mbsc-bold">Barry Lyon</mobiscroll.CardTitle>
<mobiscroll.CardSubtitle>Road Scrapers Inc</mobiscroll.CardSubtitle>
</mobiscroll.CardHeader>
<mobiscroll.CardContent>
<mobiscroll.Listview
itemType={ListItem}
data={[this.state.items[3]]}
theme=""
lang=""
swipe={true}
enhance={true}
/>
</mobiscroll.CardContent>
</mobiscroll.Card>
</mobiscroll.Accordion>
</div>
);
}
constructor(props) {
super(props);
this.state = {
items: [{
email: 'adeline-s@bigcorp.com',
phone: '(202) 555-0147',
},
{
email: 'carl.h@washaway.com',
phone: '(202) 553-5247',
},
{
email: 'hortense@tinker.com',
phone: '(202) 555-0137',
},
{
email: 'barry.ly@roads.com',
phone: '(302) 663-5247',
}]
}
}
closeAll = () => {
this.refs.cont1.instance.hide();
this.refs.cont2.instance.hide();
this.refs.cont3.instance.hide();
this.refs.cont4.instance.hide();
}
toggleLast = () => {
this.refs.cont4.instance.toggle();
}
}
<div id="content"></div>
Cards - Masonry layout
mobiscroll.settings = {
lang: '',
theme: ''
}
class CardsDemo extends React.Component {
render() {
return (
<div className="mbsc-grid-lg mbsc-grid-fixed mbsc-no-padding md-grid-cards">
<div className="mbsc-row">
<div className="mbsc-col">
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-1.jpg" />
</mobiscroll.Card>
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-2.jpg" />
</mobiscroll.Card>
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-3.jpg" />
</mobiscroll.Card>
</div>
<div className="mbsc-col">
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-4.jpg" />
</mobiscroll.Card>
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-5.jpg" />
</mobiscroll.Card>
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-6.jpg" />
</mobiscroll.Card>
</div>
<div className="mbsc-col">
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-7.jpg" />
</mobiscroll.Card>
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-8.jpg" />
</mobiscroll.Card>
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-9.jpg" />
</mobiscroll.Card>
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-10.jpg" />
</mobiscroll.Card>
</div>
<div className="mbsc-col">
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-11.jpg" />
</mobiscroll.Card>
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-12.jpg" />
</mobiscroll.Card>
<mobiscroll.Card>
<img src="https://img.mobiscroll.com/demos/world-cup-13.jpg" />
</mobiscroll.Card>
</div>
</div>
</div>
);
}
}
<div id="content"></div>
Cards - Grid layout
mobiscroll.settings = {
lang: '',
theme: ''
}
class AppItem extends React.Component {
render = () => {
var app = this.props.app;
return <mobiscroll.Card>
<img src={app.img} draggable="false" />
<mobiscroll.CardContent>{app.name}</mobiscroll.CardContent>
</mobiscroll.Card>;
}
}
class CardItem extends React.Component {
render = () => {
var app = this.props.app;
return <div className="mbsc-col-12 mbsc-col-sm-6 mbsc-col-lg-4 mbsc-col-xl-3">
<mobiscroll.Card>
<img src={app.img} draggable="false" />
<mobiscroll.CardContent>
<div className="mbsc-card-title">{app.name}</div>
<p class="mbsc-txt-muted">{app.about}</p>
</mobiscroll.CardContent>
</mobiscroll.Card>
</div>;
}
}
class CardsDemo extends React.Component {
render = () => {
return <div className="mbsc-padding">
<h3>Scrollable list</h3>
<mobiscroll.ScrollView layout="fixed" itemWidth={134} snap={false}>
{this.props.birds.map(function(app) {
return <AppItem app={app} key={app.id} />;
})}
</mobiscroll.ScrollView>
<h3>Grid view</h3>
<div className="mbsc-grid">
<div className="mbsc-row mbsc-justify-content-center mbsc-no-padding">
{this.props.animals.map(function(app) {
return <CardItem app={app} key={app.id} />;
})}
</div>
</div>
</div>;
}
static defaultProps = {
birds: [{
id: 1,
img: 'https://img.mobiscroll.com/demos/gridlayout/toucan.jpg',
name: 'Toucan'
}, {
id: 2,
img: 'https://img.mobiscroll.com/demos/gridlayout/kingfisher.jpg',
name: 'Kingfisher'
}, {
id: 3,
img: 'https://img.mobiscroll.com/demos/gridlayout/swift.jpg',
name: 'Swift'
}, {
id: 4,
img: 'https://img.mobiscroll.com/demos/gridlayout/humming.jpg',
name: 'Humming bird'
}, {
id: 5,
img: 'https://img.mobiscroll.com/demos/gridlayout/columbidae.jpg',
name: 'Columbidae'
}, {
id: 6,
img: 'https://img.mobiscroll.com/demos/gridlayout/hornbill.jpg',
name: 'Hornbill'
}, {
id: 7,
img: 'https://img.mobiscroll.com/demos/gridlayout/spoonbill.jpg',
name: 'Spoonbill'
}, {
id: 8,
img: 'https://img.mobiscroll.com/demos/gridlayout/bee-eater.jpg',
name: 'Bee-eater'
}, {
id: 9,
img: 'https://img.mobiscroll.com/demos/gridlayout/parrot.jpg',
name: 'Parrot'
}, {
id: 10,
img: 'https://img.mobiscroll.com/demos/gridlayout/goose.jpg',
name: 'Goose bird'
}, {
id: 11,
img: 'https://img.mobiscroll.com/demos/gridlayout/woodpecker.jpg',
name: 'Woodpecker'
}, {
id: 12,
img: 'https://img.mobiscroll.com/demos/gridlayout/penguin.jpg',
name: 'Penguin'
}],
animals: [{
id: 1,
img: 'https://img.mobiscroll.com/demos/gridlayout/okapi.jpg',
name: 'Okapi',
about: 'The okapi is an animal native to the Democratic Republic of Congo in Africa.'
}, {
id: 2,
img: 'https://img.mobiscroll.com/demos/gridlayout/dragon.jpg',
name: 'The Blue Dragon',
about: 'These little dragon-like creatures can be found in the Indian Pacific Oceans.'
}, {
id: 3,
img: 'https://img.mobiscroll.com/demos/gridlayout/wolf.jpg',
name: 'The Maned Wolf',
about: 'The maned wolf is often found in south, CW, and SE parts of Brazil.'
}, {
id: 4,
img: 'https://img.mobiscroll.com/demos/gridlayout/fossa.jpg',
name: 'Fossa',
about: 'A carnivorous animal located in Madagascar related to the Mongoose.'
}, {
id: 5,
img: 'https://img.mobiscroll.com/demos/gridlayout/shark.jpg',
name: 'Goblin Shark',
about: 'Last representative of sharks that lived about 125 million years ago.'
}, {
id: 6,
img: 'https://img.mobiscroll.com/demos/gridlayout/deer.jpg',
name: 'Leaf Deer',
about: 'The leaf deer is usually found in dense forests in the NW of Putao.'
}, {
id: 7,
img: 'https://img.mobiscroll.com/demos/gridlayout/spidercrab.jpg',
name: 'Japanese Spider Crab',
about: 'As the name suggestions, it inhabits the waters surrounding Japan.'
}, {
id: 8,
img: 'https://img.mobiscroll.com/demos/gridlayout/rabbit.jpg',
name: 'Angora Rabbit',
about: 'These rabbits originated in Turkey but managed to spread throughout Europe.'
}, {
id: 9,
img: 'https://img.mobiscroll.com/demos/gridlayout/axolotl.jpg',
name: 'Axolotl',
about: 'The "Mexican salamander" is often spotted in lakes around Mexico.'
}, {
id: 10,
img: 'https://img.mobiscroll.com/demos/gridlayout/liger.jpg',
name: 'Liger',
about: 'The liger is a real animal created by a lion and a tiger mating.'
}, {
id: 11,
img: 'https://img.mobiscroll.com/demos/gridlayout/panda.jpg',
name: 'Red Panda',
about: 'This cute, small panda lives in the eastern Himalayas and SW China.'
}, {
id: 12,
img: 'https://img.mobiscroll.com/demos/gridlayout/superbird.jpg',
name: 'Superbird',
about: 'Found in New Guinea, it is unsure how many of these birds there are.'
}]
};
}
<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! 👍