logo

Keen Admin

Bootstrap 4 Admin Dashboard Framework

Keen Offcanvas

Overview

KTOffcanvas is a Keen's custom plugin defined in [keen]/theme/src/assets/js/theme/core/base/offcanvas.js.

Initialization

First parameter is the id, class, or tag of the HTML element. The second parameter is for the options.

var headerMenuOffcanvas = new KTOffcanvas(id, options)
var headerMenuOffcanvas = new KTOffcanvas('kt_header_menu_wrapper', {
    overlay: true,
    baseClass: 'kt-header-menu-wrapper',
    closeBy: 'kt_header_menu_mobile_close_btn',
    toggleBy: {
        target: 'kt_header_mobile_toggler',
        state: 'kt-header-mobile__toolbar-toggler--active'
    }
});

Options

var options = {
    overlay: true,
    baseClass: 'kt-header-menu-wrapper',
    closeBy: 'kt_header_menu_mobile_close_btn',
    toggleBy: {
        target: 'kt_header_mobile_toggler',
        state: 'kt-header-mobile__toolbar-toggler--active'
    }
}
Field Type Description
overlay boolean

Enable/disable offcanvas overlay

Sample
overlay: true
baseClass string

Set the base class for the offcanvas

Sample
baseClass: 'kt-header-menu-wrapper'
closeBy string

Define the element for the off canvas to be closed when this element is clicked

Sample
closeBy: 'kt_header_menu_mobile_close_btn'
toggleBy object

Define which element for the toggle and set the active state class name

Sample
toggleBy: {
    target: 'kt_header_mobile_toggler',
    state: 'kt-header-mobile__toolbar-toggler--active'
}

API Methods

Method Description
setDefaults(options)

Set default options

Input Parameters
Name Type Description
options object

A new options object for the menu

show()

Set show dropdown

hide()

Set hide dropdown

on(name, handler)

Register event

Input Parameters
Name Type Description
name string

Unique event name

handler function

Callback function handler for the event

one(name, handler)

Register event to be run once

Input Parameters
Name Type Description
name string

Unique event name

handler function

Callback function handler for the event

Keen’s Key Features

Keen empowers your project with virtually limitless array of options
to create endless unique projects.

Multi Demo

Choose a perfect design for your next project among hundreds of demos

Limitless Components

A huge collection of components to power your application with the latest UI/UX trands

Angular 8 & React Support

Enterprise ready Angular and React integration with built-in authentication module and many more

Bootstrap 4

Metronic deeply customizes Bootstrap with native look and feel

Exclusive Datatable Plugin

Our super sleek and intuitive Datatable comes packed with all advanced CRUD features

75,000+ Strong

Metronic is the only theme trusted by over 70,000 developers world wide

Continuous Updates

Lifetime updates with new demos and features is guaranteed

Quality Code

Metronic is written with a code structure that all developers will be able to pick up easily and fall in love