Documentation v8.1.1

Preview Downloads Purchase

Overview

Metronic exclusive components are written in Javascript without any jQuery dependency in order to make it easier to integrate with SPA frameworks such as Angular, React and Vue. However the Metronic HTML version stil uses jQuery as majority popular jQuery plugins are still on demand. During the build process the Javascript code from the source folder is minified and moved to the assets folder.

Components

The components folder in src/js/componentscontains Metronic exclusive components written in Javascript without any jQuery dependency. All components can be used by Angular, React and Vue versions.

Layout

The layout folder in src/js/layout/contains Javascript files that handle the Layout partials(Aside, Header, Footer, Subheader, etc).

Compilation

  • Metronic compiles layout, components(including the Bootstrap & custom components) Javascript code into the main bundle: dist/assets/js/scripts.bundle.js.
  • The custom Javascript code is compiled separately into CSS folder: dist/assets/js/custom
  • All 3rd-party plugins Javascript code are bundled into the plugins Javascript bundle file and globally included in all pages. dist/assets/plugins/global/plugins.bundle.js`.

Components Dynamic Initialization

All In-house and 3rd-party components defined in src/js/components/folder need to be initializated when the HTML elements are dynamically populated in DOM via AJAX:
// In-house components initialization
KTMenu.createInstances();
KTDrawer.createInstances();
KTScroll.createInstances();
KTScrolltop.createInstances();
KTSticky.createInstances();
KTDialer.createInstances();
KTImageInput.createInstances();
KTPasswordMeter.createInstances();
KTSwapper.createInstances();
KTToggle.createInstances();
Method Type Description
KTMenu.createInstances() Mandatory Menu
KTDrawer.createInstances() Mandatory Drawer
KTScroll.createInstances() Mandatory Scroll
KTScrolltop.createInstances() Mandatory Scrolltop
KTSticky.createInstances() Mandatory Sticky
KTDialer.createInstances() Optional Dialer
KTImageInput.createInstances() Optional Image Input
KTPasswordMeter.createInstances() Optional Password Meter
KTSwapper.createInstances() Optional Swapper
KTToggle.createInstances() Optional Toggle

Layout Dynamic Initialization

The Layout partials(e.g: Aside, Search, Toolbar, etc) need to be initializated(if defined) when the layout is populated dynamically in DOM via AJAX. Look for available layout classes in src/js/layout/folder.
// Boostrap & 3rd-party components initialization
KTApp.init();

// Boostrap & 3rd-party components dynamic creation
KTApp.createInstances();

// Layout partials initialization(if applicable)
KTAppSidebar.init();
KTAppSearch.init();
Method Type Description
KTApp.init() Mandatory Boostrap & 3rd-party components initialization defined in src/js/layout/app.js
KTApp.createInstances() Optional Creates instances of Boostrap & 3rd-party components as defined src/js/layout/app.js
KTAppSidebar.init() Optional Sidebar initialization defined in src/js/layout/sidebar.js
KTAppSearch.init() Optional Search initialization defined in src/js/layout/search.js

Demos

Metronic Licenses

License FAQs
Regular License
For single end product used by you or one client
$ 39
Extended License
For single SaaS app with paying users
$ 969
Custom License
Reach us for custom license offers.
Buy Now
Learn & Get Inspired

Support at devs.keenthemes.com

Join our developers community to find answer to your question and help others. FAQs
Get Support
Documentation & Videos
From guides and video tutorials, to live demos and code examples to get started.
Plugins & Components
Check out our 300+ in-house components and customized 3rd-party plugins.
Layout Builder
Build your layout, preview it and export the HTML for server side integration.
Metronic Downloads
Download your prefered framework and demo with one click.
What's New
Latest features and improvements added with our users feedback in mind.