What Is Framework7?
Framework7 is open source mobile HTML framework and used to develop hybrid mobile and web apps with iOS and Android devices. It is a free
and it was released in February 2016 licensed under MIT.
It is highly recommended to be familiar with
basics of HTML, CSS and JavaScript to
start creating apps with Framework7.
It is not compatible with all platforms and it's
focused only on iOS and Google Material design experience and
simplicity.
The history of framework 7 is not very older and
the first version was released in 2014.
The latest version-1.4.2 was
released in February 2016 licensed
under MIT.
Framework7, you can easily use with Angular and React frameworks.
Why We Use Framework7?
ü Framework7
is easier to develop apps for iOS and Android and learning is very easy.
ü Framework7
has many pre-styled widgets/components and built-in helper libraries.
What Are The Features Of Framework7?
ü Framework7
is a free and open source framework for mobile HTML.
ü Easy
to Use
ü Framework7
syntax is very much similar to JQuery.
ü Framework
7 provides ready to use UI elements and widgets like modals, popup and others.
ü IOS
specific framework as it provides IOS like UI interaction
ü Framework7
dynamically loads page from template via flexible Router API.
What Are The Advantages And Disadvantages Of Framework7?
ü We
can easily develop apps for iOS and Android without any expertise on
technologies
ü Framework7
has many pre-styled widgets/components
ü Framework7
has built-in helper libraries
ü Framework7
is not dependent on any third party library even for DOM manipulation.
ü Framework7
supports faster development via Bower.
What Are The Disadvantages Of Framework7?
ü Framework7
only supports platforms like iOS and Android devices.
ü The
support forums are a bit difficult to use.
ü It
does not support platforms other than IOS and android.
What Is Framework7 Environment?
Installation
-
To get started we need to install Framework7 and we
can install framework7 with two ways.
Ways
1
-Download From GitHub Repository
Ways
2
- Install From NPM
npm install framework7
Framework7 can also be imported as an ES-next
module -
//Import core framework
import Framework7 from 'framework7';
CDNs Libraries for Framework7 –
//CDN for iOS App layout:
<link
rel = "stylesheet"
href = "/css/framework7.ios.min.css"
/>
//Framework7 iOS CSS Library:
<link
rel = "stylesheet"
href = "/css/framework7.ios.colors.min.css"
/>
//CDNs for Android/Material App
Layout
<script
src = "/js/framework7.min.js"></script>
//Framework7 JS library
<script
src = "/css/framework7.material.min.css"></script>
How To Initialize Framework7 App?
In Framework7,
we should initialize our app and its looks like –
var
app = new
Framework7();
In the above I am using the app variable where we
store Framework7 initialized instance for easy access in the apps.
Framework7 also provides more customization on
initialization by passing object with parameters and its looks like -
var
app = new
Framework7({
// App root element
root: '#app',
// App Name
name: 'My
App',
// App id
id: 'com.myapp.test',
// Enable swipe panel
panel: {
swipe: 'left',
},
// Add default routes
routes: [
{
path: '/about/',
url: 'about.html',
},
],
// ... other parameters
});
What Are The Framework7 Layouts?
Framework7 supports three types of Navbar/Toolbar
layouts that are -
ü Static
Layout
ü Fixed
Layout
ü Through
Layout
ü Mixed
Layout
What Is Layout Grid In Framework7?
In Framework7, Layout Grid provides different
types of grid types to place the content as per user need. It also provides
different types of columns size.
What Is Content Block In Framework7?
Framework7 Content blocks can be used to add
extra content with different formats.
What Are List Views In Framework7?
Framework7 List views are powerful UI components
that present data in a scrollable list of multiple rows.
The
Framework7 List Views Are-
ü List
View Block
ü List
Item
ü List
Item Header/Footer
ü Link
Item
ü List
Button
ü List
Divider
ü Grouped
Lists
ü Simple
List
ü Links
List
ü Media
List
List View Block-
<div
class="list">
<ul>
... list elements here ...
</ul>
</div>
List Item -
<div
class="list
no-hairlines">
<ul>
... list elements here ...
</ul>
</div>
List Item Header/Footer -
<li>
<div
class="item-content">
<div
class="item-media">
<i class="icon
my-icon"></i>
</div>
<div
class="item-inner">
<div
class="item-title">
<!-- Item
header, must be first child of item-title -->
<div
class="item-header">Item
header text</div>
List element title
<!-- Item
footer, must be last child of item-title -->
<div
class="item-footer">Item
footer text</div>
</div>
<div
class="item-after">...</div>
</div>
</div>
</li>
Link Item -
<li>
<a href="#"
class="item-link">
<div
class="item-content">
<div
class="item-media">...</div>
<div
class="item-inner">...</div>
</div>
</a>
</li>
List Button -
<li>
<a class="item-link
list-button">List Button 1</a>
</li>
<li>
<a class="item-link
list-button">List Button 2</a>
</li>
List Divider -
<li
class="item-divider">Divider
title here</li>
Grouped Lists-
<div
class="list-group">
<ul>
<li class="list-group-title">First
group</li>
<li class="item-content">...</li>
<li class="item-content">...</div>
</li>
...
</ul>
</div>
Simple List -
<div
class="list
simple-list">
<ul>
<li>Item
1</li>
<li>Item
2</li>
...
</ul>
</div>
Links List -
<div
class="list
links-list">
<ul>
<li>
<a href="#">Link
Item 1</a>
</li>
...
</ul>
</div>
Media List -
<div
class="list
media-list">
<ul>
<li>
<div
class="item-content">
<div
class="item-media">
<img
src="/images/img.jpg">
</div>
<div
class="item-inner">
<div
class="item-title-row">
<div
class="item-title">Element
title</div>
<div
class="item-after">Element
label</div>
</div>
<div
class="item-subtitle">Subtitle</div>
<div
class="item-text">Additional
description text</div>
</div>
</div>
</li>
</ul>
</div>
What Is Virtual List Framework7?
Virtual List allows us to rendering lists of
elements without losing the apps performance that’s fully compatible with all
Framework7 components and its looks like –
1. Search
Bar,
2. Swipeouts
3. Sortable
4. Infinite
Scroll,
5. Pull
to Refresh
6. And
so on
Virtual List Components -
1. Virtual
List Layout
2. Virtual
List App Methods
3. Virtual
List Parameters
4. Virtual
List Methods & Properties
5. Virtual
List Events
What’s Are Router Events In Framework7?
Framework7 Router has a lot of useful events. Router
will fire the following DOM events only
on iOS-theme for swipe back pages.
Framework7
Router Events -
1. swipeback:move
2. swipeback:beforechange
3. swipeback:afterchange
4. swipeback:beforereset
5. swipeback:afterreset
6. swipeback:afterchange
7. swipeback:beforereset
8. swipeback:afterreset
References - https://framework7.io/docs/
I hope you are
enjoying with this post! Please share with you friends. Thank you so much!