The best jQuery plugin for creating side menus and the easiest way for doing your menu responsive

Sidr effect preview image

You will be able to create multiple sidrs on both sides of your web to make responsives menus (or not, it works perfectly on desktop too). It uses CSS3 transitions (and fallbacks to $.animate with older browsers) and it supports multiple source types.

Get started

Like any other plugin, you must include it after the jQuery script. For a better performance load them at the bottom of your page or in an asynchronous way.

You have to include a Sidr Theme stylesheet too, choose between the dark or the light one, or if you prefer create one by your own.

<!DOCTYPE html>
    <!-- Your other stuff  (you can have problems if you don't add minimum scale in the viewport) -->
    <meta name="viewport" content="width=device-width,minimum-scale=1">
    <!-- Include a Sidr bundled CSS theme -->
    <link rel="stylesheet" href="//">
    <!-- More stuff -->
    <!-- Include jQuery -->
    <script src="//"></script>
    <!-- Include the Sidr JS -->
    <script src="//"></script>

Using bower or NPM

Instead of downloading the plugin, you can install it with bower or with npm:

bower install sidr --save
npm install sidr --save

From a CDN

If you want to load the scripts from a CDN to save bandwith or improve the performance you can use jsDelivr.

Demos & Usage

Here are described differents ways of usage for this plugin, you can read and adapt them to your website’s requeriments. Below are described all options with details.

The Simplest Usage

Simple menu

Create a div called sidr and place your menu there. Then activate the plugin binding it to a link. By default, the menu wont’t be visible and it will be displayed or hidden by clicking on the link.

<a id="simple-menu" href="#sidr">Toggle menu</a>

<div id="sidr">
  <!-- Your content -->
    <li><a href="#">List 1</a></li>
    <li class="active"><a href="#">List 2</a></li>
    <li><a href="#">List 3</a></li>

$(document).ready(function() {

Create Multiple Menus

Left Menu Right Menu

You can create as many menus as you want in the same page, and you can place them at the right or left side. When creating more than one menu, you need to name them. As it is shown in the example, if you don’t create the menu div container, the plugin will create it for you.

<a id="left-menu" href="#left-menu">Left Menu</a>
<a id="right-menu" href="#right-menu">Right Menu</a>

$(document).ready(function() {
      name: 'sidr-left',
      side: 'left' // By default
      name: 'sidr-right',
      side: 'right'

The Menu Content

Existing content Load remotelly Callback loaded

There are four ways to load content in the menus, choose yours with the source option.

  • We have shown the first way at the ‘Simplest Usage’ demo, no more than placing the content into the div menu.
  • The most common way is to load existing html into the menu, you can add as many selectors as you want and they will be loaded in order.
  • There is the possibility to load remote content easily via AJAX.
  • If you need a more complex way to load content into the menu you can just create a callback function.
<a id="existing-content-menu" href="#existing-content-menu">Existing content</a>
<a id="remote-content-menu" href="#remote-content-menu">Load remotelly</a>
<a id="callback-menu" href="#callback-menu">Callback loaded</a>

<header id="demoheader">
    <h1>Demos &amp; Usage</h1>

<div id="demo-content">
    <p>Here are described differents ways of usage for this plugin, you can
    read and adapt them to your website's requeriments. Below are described
    all options with details.</p>

$(document).ready(function() {
      name: 'sidr-existing-content',
      source: '#demoheader, #demo-content'
      name: 'sidr-remote-content',
      source: ''
      name: 'sidr-callback',
      source: function(name) {
        return '<h1>' + name + ' menu</h1><p>Yes! You can use a callback too ;)</p>';

Responsive Menus

Responsive Menu

The major reason for creating this plugin was just being able to easily add existing content (like a menu, a search box, social icons,…) to a menu in small screens. Simply load existing html into a sidr, and then, hide this html and show the menu button with media queries.

#mobile-header {
    display: none;
@media only screen and (max-width: 767px){
    #mobile-header {
        display: block;

<div id="mobile-header">
    <a id="responsive-menu-button" href="#sidr-main">Menu</a>

<div id="navigation">
    <nav class="nav">
            <li><a href="#download">Download</a></li>
            <li><a href="#getstarted">Get started</a></li>
            <li><a href="#usage">Demos &amp; Usage</a></li>
            <li><a href="#documentation">Documentation</a></li>
            <li><a href="#themes">Themes</a></li>
            <li><a href="#support">Support</a></li>

      name: 'sidr-main',
      source: '#navigation'

Open/Close Programatically

There are some methods you can use to open or close menus as you want, or to bind them to any event. For example, in this page the right/left swipe touch event opens or closes the responsive menu (Note: this plugin doesn’t implement touch events, in this case I’m using an external library).

<!-- For this example I include an external library to handle touch events -->
<script src="//"></script>

    $('body').swipe( {
        //Single swipe handler for left swipes
        swipeLeft: function () {
            $.sidr('close', 'sidr-main');
        swipeRight: function () {
            $.sidr('open', 'sidr-main');
        //Default is 75px, set to 0 for demo so any distance triggers swipe
        threshold: 45


You can see other recipes in the code repository:



Description: It creates a sidr menu and binds the toggle function to the selector.

jQuery(selector).sidr( [options] )

options (Object)

A map of options to pass to the method.

name (String) Default: 'sidr'

Name for the sidr.

side (String) Default: 'left'

Left or right, the location for the sidebar.

source (String|Function) Default: null

A jQuery selector, an url or a callback function.

renaming (Boolean) Default: true

When filling the sidr with existing content, choose to rename or not the classes and ids.

body (String) Default: 'body' [ Version 1.1.0 an above ]

For displacing the page the 'body' element is animated by default, you can select another element to animate with this option.

displace (Boolean) Default: true [ Version 1.2.0 an above ]

Displace the body content or not.

timing (String) Default: 'ease' [ Version 2.1.0 an above ]

Timing function for CSS transitions.

method (String) Default: 'toggle' [ Version 2.1.0 an above ]

The action to execute when clicking the button. 'toggle', 'open' and 'close' are allowed.

bind (String) Default: 'touchstart click' [ Version 2.2.0 an above ]

The event(s) to trigger the menu. Only 1 event will be triggered each 100ms, so only the first one will be triggered if there are 2 at the same time.

onOpen (function) Default: function() {} [ Version 1.2.0 an above ]

Callback that will be executed when the menu starts opening.

onOpenEnd (function) Default: function() {} [ Version 2.1.0 an above ]

Callback that will be executed when the menu ends opening.

onClose (function) Default: function() {} [ Version 1.2.0 an above ]

Callback that will be executed when the menu starts closing.

onCloseEnd (function) Default: function() {} [ Version 2.1.0 an above ]

Callback that will be executed when the menu ends closing.


Description: A generic sidr controller. Can be used to access the sidr methods: open, close, toggle or status

jQuery.sidr( [method] [, name] [, complete] )

method (String) Default: 'toggle'

Choose between 'toggle', 'open', 'close' or 'status'. [ Status is only available in version 2.1.0 an above ]

name (String) Default: 'sidr'

Name of the target sidr.

complete (Function) Default: none

A function to call once the animation is complete.

return null || Object [ Version 2.2.0 an above ]

It returns null when methods 'toggle', 'open' or 'close' are called, or an object when status is called:

    moving: (boolean), // A boolean indicating if the menu is currently being moved
    opened: (string || false) // Name of the opened menu or false if all are closed


There are two themes (two stylesheets) included with the plugin, a dark one and a light one. You can use them, create a new one or override them with your own styles.


The following responsive sites are using Sidr in an original way to implement their menu:

Sidr Menu on FOX Broadcasting Company website

FOX Broadcasting Company

Sidr Menu on United States Courts website

United States Courts

Sidr Menu on San Diego State University website

San Diego State University

If you’ve created a website or an application using this plugin and you want to show it in this section, send me an email with the url to [email protected].


Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change you make.