App / Core
This constructor returns main app Framework7 instance.
Lets look at the list of available parameters:
These are default app parameters for app core module.
Most of components that has JavaScript API may extend this list of parameters with the property named as component. For example Panel component extends app parameters with panel
property that accepts Panel specific parameters.
Example:
var app = new Framework7({
id: 'com.myapp.test',
// Extended by Panel component:
panel: {
swipe: 'left',
leftBreakpoint: 768,
rightBreakpoint: 1024,
},
// Extended by Dialog component:
dialog: {
title: 'My App',
},
// Extended by Statusbar component:
statusbar: {
iosOverlaysWebview: true,
},
});
Same as with app parameters most of components that has JavaScript API may extend this list of properties with the property named as component. For example Panel component extends app instance properties with panel
property that accepts Panel specific properties and methods.
Example:
app.panel.open('left');
// Hide statusbar
app.statusbar.hide();
App instance emits the following core events:
Example:
:root {
--f7-theme-color: #007aff;
--f7-theme-color-rgb: 0, 122, 255;
--f7-theme-color-shade: #0066d6;
--f7-theme-color-tint: #298fff;
--f7-safe-area-left: 0px;
--f7-safe-area-right: 0px;
--f7-safe-area-top: 0px;
--f7-safe-area-outer-left: 0px;
--f7-safe-area-outer-right: 0px;
--f7-device-pixel-ratio: 1;
}
@supports (left: env(safe-area-inset-left)) {
:root {
--f7-safe-area-top: env(safe-area-inset-top);
--f7-safe-area-bottom: env(safe-area-inset-bottom);
}
:root .ios-left-edge,
:root .ios-edges,
:root .safe-area-left,
:root .safe-areas,
:root .popup,
:root .sheet-modal,
:root .panel-left {
--f7-safe-area-left: env(safe-area-inset-left);
--f7-safe-area-outer-left: env(safe-area-inset-left);
}
:root .ios-right-edge,
:root .ios-edges,
:root .safe-area-right,
:root .safe-areas,
:root .popup,
:root .sheet-modal,
:root .panel-right {
--f7-safe-area-right: env(safe-area-inset-right);
--f7-safe-area-outer-right: env(safe-area-inset-right);
}
:root .no-safe-areas,
:root .no-safe-area-left,
:root .no-ios-edges,
:root .no-ios-left-edge {
--f7-safe-area-left: 0px;
--f7-safe-area-outer-left: 0px;
}
:root .no-safe-areas,
:root .no-safe-area-right,
:root .no-ios-edges,
:root .no-ios-right-edge {
--f7-safe-area-right: 0px;
--f7-safe-area-outer-right: 0px;
}
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
:root {
--f7-device-pixel-ratio: 2;
}
}
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 3dppx) {
:root {
--f7-device-pixel-ratio: 3;
}
/*====================
Fonts
==================== */
:root {
--f7-font-size: 14px;
}
--f7-font-family: -apple-system, SF Pro Text, SF UI Text, system-ui, Helvetica Neue, Helvetica, Arial, sans-serif;
--f7-text-color: #000;
--f7-line-height: 1.4;
}
.ios .theme-dark,
.ios.theme-dark {
--f7-text-color: #fff;
}
.md {
--f7-font-family: Roboto, system-ui, Noto, Helvetica, Arial, sans-serif;
--f7-text-color: #212121;
--f7-line-height: 1.5;
}
.md .theme-dark,
.md.theme-dark {
--f7-text-color: rgba(255, 255, 255, 0.87);
}
.aurora {
--f7-font-family: -apple-system, system-ui, Helvetica, Arial, sans-serif;
--f7-text-color: #000;
--f7-line-height: 1.5;
}
.aurora .theme-dark,
.aurora.theme-dark {
--f7-text-color: #fff;
}
/*====================
Bars
==================== */
:root {
/*
--f7-bars-link-color: var(--f7-theme-color);
*/
--f7-bars-bg-image: none;
--f7-bars-bg-color: #f7f7f8;
--f7-bars-bg-color-rgb: 247, 247, 248;
--f7-bars-text-color: #000;
--f7-bars-shadow-bottom-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.08) 40%, rgba(0, 0, 0, 0.04) 50%, rgba(0, 0, 0, 0) 90%, rgba(0, 0, 0, 0) 100%);
--f7-bars-shadow-top-image: linear-gradient(to top, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.08) 40%, rgba(0, 0, 0, 0.04) 50%, rgba(0, 0, 0, 0) 90%, rgba(0, 0, 0, 0) 100%);
}
.theme-dark {
--f7-bars-bg-color: #1b1b1b;
--f7-bars-text-color: #fff;
}
.ios {
--f7-bars-border-color: #c4c4c4;
}
.ios .theme-dark,
.ios.theme-dark {
--f7-bars-border-color: #282829;
}
.md {
--f7-bars-border-color: transparent;
}
.aurora {
--f7-bars-border-color: rgba(0, 0, 0, 0.2);
}
.aurora .theme-dark,
.aurora.theme-dark {