Appbar

@@adsense
Special thanks to Daniel Milbrandt for adding flexible to appbar.

Appbar container

Create appbar container

                <div class="app-bar">
                ...
                </div>
            

Appbar elements

To create app-bar elements you can use next classes: for single element .app-bar-element, for multi (menu) app-bar-menu, for divider app-bar-divider

Create app-bar elements

                <div class="app-bar">
                    <a class="app-bar-element" href="...">Home</a>

                    <span class="app-bar-divider"></span>

                    <ul class="app-bar-menu">
                        <li><a href="">Home</a></li>
                        <li>
                            <a href="" class="dropdown-toggle">Products</a>
                            <ul class="d-menu" data-role="dropdown">
                                <li><a href="">Windows 10</a></li>
                                <li><a href="">Spartan</a></li>
                                <li><a href="">Outlook</a></li>
                                <li><a href="">Office 2015</a></li>
                                <li class="divider"></li>
                                <li><a href="" class="dropdown-toggle">Other Products</a>
                                    <ul class="d-menu" data-role="dropdown">
                                        <li><a href="">Internet Explorer 10</a></li>
                                        <li><a href="">Skype</a></li>
                                        <li><a href="">Surface</a></li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li><a href="">Support</a></li>
                        <li><a href="">Help</a></li>
                    </ul>
                </div>
            

Flexible Appbar

Default styled
Custom Styled

The appbar comes with configurable full featured flexible menu support by default. Add data-role="appbar" to activate this. The elements which should be collapsed must be in a menu with app-bar-menu class.

Create appbar with flexible menu support.

                    <div class="app-bar" data-role="appbar">
                        <a class="app-bar-element" href="...">Home</a>

                        <span class="app-bar-divider"></span>

                        <ul class="app-bar-menu">
                            <li><a href="">Home</a></li>
                            <li><a href="">Support</a></li>
                            <li><a href="">Help</a></li>
                            ...very long list here ...
                        </ul>
                    </div>
                

Features

Feature Description Code
Fully Automated Use data-role="appbar". The Appbar creates a pull down button on the right side if the menu entries do not fit into the bar. The Appbar refreshes automatically, if the user resize the window, or extern content like images are loaded into the appbar. If you have problems with the pullbutton which is created, see Custom Pull Button section.

                                <div class="appbar" data-role="appbar">
                                    <ul class="app-bar-menu">
                                        <li><a href="">Home</a></li>
                                        ...
                                    </ul>
                                </div>
                            
Disable Use the no-flexible class to deactivate the flexible behavior. You can deactivate whole menus or picked menu entries. They will stay always. Even the whole appbar container can be marked as no-flexible.

                                <div class="appbar" data-role="appbar">
                                    <ul class="app-bar-menu">
                                        <li>...</li>
                                        <li class="no-flexible">...</li>
                                        <li>...</li>
                                    </ul>
                                    <ul class="app-bar-menu no-flexible">
                                        <li>...</li>
                                        <li>...</li>
                                        <li>...</li>
                                    </ul>
                                </div>
                            
Custom Pull Button
Righter placement.
An appbar creates only a pull button if there is no one. It is floated right, and placed as last element. so if you have already a important element placed there with place-right it does not struggle with it. Otherwise it is placed right as possible. However, if you have placed a app-bar-menu right, you wish the pull button even righter. Because it is both floated you have to create the automatic button manually before all right placed menus.

                                <div class="appbar" data-role="appbar">
                                    <ul class="app-bar-menu">
                                        ...
                                    </ul>

                                    <div class="app-bar-pullbutton automatic"></div>

                                    <ul class="app-bar-menu place-right">
                                        ...
                                    </ul>
                                    
                                </div>
                            
Custom Pull Button
Own Style
Create your own styled button with <div class="app-bar-pullbutton">

                                <div class="appbar" data-role="appbar">
                                    <ul class="app-bar-menu">
                                        ...
                                    </ul>
                                    <div class="app-bar-pullbutton">
                                        More
                                        <span class="mif-plus"></span>
                                    </div>
                                </div>
                            
Clean Layout You can give data-flexclean="true" to the appbar, which will collapse all menu entries into the flexible menu. If you want to make an exception for one or two elements use the no-flexible class for these elements.

                                <div class="appbar" data-role="appbar" data-flexclean="true">
                                    <ul class="app-bar-menu">
                                        <li>Link</li>
                                        <li>Link2</li>
                                        <li class="no-flexible">Help</li>
                                    </ul>
                                </div>
                            
Order data-flexorder="3", data-flexdirection="reverse"Usually the elements disappear in the order found in the dom. Usually the right, will go first. You can overwrite this by using the data-flexorder attribute. The lower the value of the flexorder attribute is the later is it sorted into the flex menu. You can use this with the app-bar-menu and with its containing children in a cascading way. For app-bar-menu there is also the data-flexdirection attribute to reverse the order. Than the smaller the value is the earlies disappears. If no data-flexorder attribute is given, element's dom index + 1 is assigned by default. So there is no need to give them all an order if only a few of them need a special one. The following example is configured so: The Entry with 3.1 disappear first, because 3.x has a reversed order. 2.1 and 2.3 will stay always because they have a no-flexible class. After that you can see that 1.1 moves because it has a greater flexorder than 1.2 which has is own index + 1 as flexorder. Resize the window to see an effect. You can zoom in if the window can not become smaller.

                                <div class="appbar" data-role="appbar">
                                    <ul class="app-bar-menu">
                                        <li data-flexorder="5">1</li>
                                        <li>2</li>
                                        <li data-flexorder="1">3</li>
                                    </ul>
                                    <ul class="app-bar-menu" data-flexorder="5">
                                        <li class="no-flexible">1</li>
                                        <li>2</li>
                                        <li class="no-flexible">3</li>
                                    </ul>
                                    <ul class="app-bar-menu" data-flexdirection="reverse">
                                        <li>1</li>
                                        <li>2</li>
                                        <li>3</li>
                                    </ul>
                                </div>
                            
Own Style for Flex Menu data-flexstyle="YOUR_OWN_CLASS" e.g.data-flexstyle="sidebar2"The flex menu creates a menu with the app-bar-menu style class. You can overwrite this behaviour and give your own class with the data-flexstyle attribute. "sidebar2" is an option you can use out of the box. data-flexstyle="app-bar-menu YOUR_CLASS" can be used if you want only little changes. The order example shows the default app-bar-menu, the introduction example is made with the sidebar2 style.

                                <div class="appbar" data-role="appbar" data-flexstyle="sidebar2">
                                ...
                                
Create app-bar elements

                <div class="app-bar" data-role="appbar">
                    <a class="app-bar-element" href="...">Home</a>

                    <span class="app-bar-divider"></span>

                    <ul class="app-bar-menu">
                        <li><a href="">Home</a></li>
                        <li><a href="">Support</a></li>
                        <li><a href="">Help</a></li>
                    </ul>

                    <span class="app-bar-pullbutton"></span>
                </div>
            

Drop container

To create appbar drop container you can put inside app-bar-element toggle and container. Container can has class app-bar-drop-container.

Enter

Login to service...

Drop container with tiles

                <div class="app-bar">
                    <a class="app-bar-element">
                        <span id="toggle-tiles-dropdown" class="mif-apps mif-2x"></span>
                        <div class="app-bar-drop-container"
                                data-role="dropdown"
                                data-toggle-element="#toggle-tiles-dropdown"
                                data-no-close="false" style="width: 324px;">
                            <div class="tile-container bg-white">
                                <div class="tile-small bg-cyan">
                                    <div class="tile-content iconic">
                                        <span class="icon mif-onedrive"></span>
                                    </div>
                                </div>
                                <div class="tile-small bg-yellow">
                                    <div class="tile-content iconic">
                                        <span class="icon mif-google"></span>
                                    </div>
                                </div>
                                <div class="tile-small bg-red">
                                    <div class="tile-content iconic">
                                        <span class="icon mif-facebook"></span>
                                    </div>
                                </div>
                                <div class="tile-small bg-green">
                                    <div class="tile-content iconic">
                                        <span class="icon mif-twitter"></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </a>
                </div>
            
Drop container with form

                <div class="app-bar">
                    <div class="app-bar-element place-right">
                        <a class="dropdown-toggle fg-white"><span class="mif-enter"></span> Enter</a>
                        <div class="app-bar-drop-container bg-white fg-dark place-right"
                                data-role="dropdown" data-no-close="true">
                            <div class="padding20">
                                <form>
                                    <h4 class="text-light">Login to service...</h4>
                                    <div class="input-control text">
                                        <span class="mif-user prepend-icon"></span>
                                        <input type="text">
                                    </div>
                                    <div class="input-control text">
                                        <span class="mif-lock prepend-icon"></span>
                                        <input type="password">
                                    </div>
                                    <label class="input-control checkbox small-check">
                                        <input type="checkbox">
                                        <span class="check"></span>
                                        <span class="caption">Remember me</span>
                                    </label>
                                    <div class="form-actions">
                                        <button class="button">Login</button>
                                        <button class="button link">Cancel</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                

Drop container have additional property data-on-close. If this property is true container not closed on click on container.

Drop-up

To create appbar in drop-up mode you can add class drop-up to appbar.


                <div class="app-bar drop-up">...</div>
                

Fixed bar

You can create fixed (top or bottom) navigation bar with built in subclasses .fixed-top, .fixed-bottom. If you use fixed position for application bar you can set manually margin or padding for main content from appbar.


                    <div class="app-bar fixed-top">...</div>

                    <div class="main-content" style="margin-top: 3.125rem">
                        ...
                    </div>

                    or

                    <div class="main-content" style="padding-top: 3.125rem">
                        ...
                    </div>
                    

Place element on right

To place appbar element on right you must add class place-right to element.


                <div class="app-bar">
                    <a class="app-bar-element place-right">Home</a>
                </div>
                

Color schemes

This future required metro-schemes.css

Darcula

                    <div class="app-bar darcula">...</div>
                
Pink

                    <div class="app-bar pink">...</div>
                
Navy

                    <div class="app-bar navy">...</div>
                
Red

                    <div class="app-bar red">...</div>
                
Green

                    <div class="app-bar green">...</div>
                
Orange

                    <div class="app-bar orange">...</div>
                

Small dropdown


                    <div class="app-bar">
                        <ul class="app-bar-menu small-dropdown">
                        ...
                        </ul>
                    </div>