UNPKG

metro4

Version:

The front-end framework for Build responsive, mobile-first projects on the web with the first front-end component library in Metro Style

333 lines (303 loc) 18.3 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="twitter:site" content="@metroui"> <meta name="twitter:creator" content="@pimenov_sergey"> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="Metro 4 Components Library"> <meta name="twitter:description" content="Metro 4 is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with responsive grid system, extensive prebuilt components, and powerful plugins built on jQuery."> <meta name="twitter:image" content="https://metroui.org.ua/images/m4-logo-social.png"> <meta property="og:url" content="https://metroui.org.ua/v4/index.html"> <meta property="og:title" content="Metro 4 Components Library"> <meta property="og:description" content="Metro 4 is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with responsive grid system, extensive prebuilt components, and powerful plugins built on jQuery."> <meta property="og:type" content="website"> <meta property="og:image" content="https://metroui.org.ua/images/m4-logo-social.png"> <meta property="og:image:secure_url" content="https://metroui.org.ua/images/m4-logo-social.png"> <meta property="og:image:type" content="image/png"> <meta property="og:image:width" content="968"> <meta property="og:image:height" content="504"> <meta name="author" content="Sergey Pimenov"> <meta name="description" content="The most popular HTML, CSS, and JS library in Metro style."> <meta name="keywords" content="HTML, CSS, JS, Metro, CSS3, Javascript, HTML5, UI, Library, Web, Development, Framework"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="icon" href="favicon.ico" type="image/x-icon"> <link href="metro/css/metro-all.css?ver=@@b-version" rel="stylesheet"> <link href="highlight/styles/github.css" rel="stylesheet"> <link href="docsearch/docsearch.min.css" rel="stylesheet"> <link href="css/site.css" rel="stylesheet"> <title>App bar - Metro 4 :: Popular HTML, CSS and JS library</title> </head> <body class="m4-cloak" data-role="htmlcontainer" data-html-source="header.html" data-insert-mode="prepend"> <div class="container-fluid"> <div class="row flex-xl-nowrap"> <div class="cell-md-3 cell-xl-2 pr-0 border-right bd-light" id="sidenav" data-role="htmlcontainer" data-html-source="sidenav.html" data-insert-mode="replace" data-on-load="initDocSearchEngine()"></div> <div class="d-none d-block-xl cell-xl-2 order-2 border-left bd-light toc-wrapper"> <h5>Table of contents</h5> <hr/> <ul class="toc-nav"> <li class="toc-entry"><a href="#">App bar</a></li> <li class="toc-entry"><a href="#_appbar_about">About</a></li> <li class="toc-entry"><a href="#_appbar_brand">Brand</a></li> <li class="toc-entry"><a href="#_appbar_static_items">Static items</a></li> <li class="toc-entry"><a href="#_appbar_menu">Menu</a></li> <li class="toc-entry"><a href="#_appbar_dropdown">Dropdown</a></li> <li class="toc-entry"><a href="#_appbar_hamburger">Hamburger</a></li> <li class="toc-entry"><a href="#_appbar_ie_bugs">IE11 and Edge bugs</a></li> </ul> </div> <main class="cell-md-9 cell-xl-8 order-1 pr-1-sx pl-1-sx pr-5-md pl-5-md"> <div class="place-right d-none d-block-lg" style="width: 200px;"> <img src="images/logo.png" class="w-100"> </div> <h1>App bar</h1> <p class="text-leader"> Create top application menu with Metro 4 app bar component. </p> <!-- ads-html --> <h3 id="_appbar_about">About</h3> <p> Create top application menu with Metro 4 app bar component. To create it you must create container (ex: <code>&lt;div&gt;</code> or <code>&lt;nav&gt;</code>) with role <code>data-role="appbar"</code>. Add <code>brand</code> identification, <code>static item</code> or/and <code>menu</code>. The app bar is displayed in <code>fixed top</code> position. </p> <div class="example"> <div class="pos-relative z-dropdown" data-role="appbar" data-expand-point="md"> <a href="#" class="brand no-hover"> <span style="width: 40px; height: 40px; line-height: 40px" class="text-center border bd-darkGray border-radius">m<sup>4</sup></span> </a> <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="#">Office 365</a></li> <li class="divider bg-lightGray"></li> <li><a href="#">Skype</a></li> </ul> </li> <li><a href="#">Blog</a></li> <li><a href="#">Contacts</a></li> </ul> </div> </div> <pre><code class="html"> &lt;div data-role="appbar" data-expand-point="md"&gt; &lt;a href="#" class="brand no-hover"&gt; &lt;span style="width: 55px;" class="p-2 border bd-dark border-radius"&gt; m&lt;sup&gt;4&lt;/sup&gt; &lt;/span&gt; &lt;/a&gt; &lt;ul class="app-bar-menu"&gt; &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt; &lt;a href="#" class="dropdown-toggle"&gt;Products&lt;/a&gt; &lt;ul class="d-menu" data-role="dropdown"&gt; &lt;li&gt;&lt;a href="#"&gt;Windows 10&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Office 365&lt;/a&gt;&lt;/li&gt; &lt;li class="divider bg-lightGray"&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Skype&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Blog&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Contacts&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p> By default <code>appbar</code> displayed in collapsed mode. To expand it you must use attribute <code>data-expand-point</code> and special media expand identifiers: <code>fs</code>, <code>sm</code>, <code>md</code>, <code>lg</code>, <code>xl</code> or <code>xxl</code>. More information about media break points you can read in <a href="media.html">this article</a>. </p> <pre><code class="html"> &lt;div data-role="appbar" data-expand-point="md"&gt; ... &lt;/div&gt; </code></pre> <p> If you need to persistent expanded appbar, use attribute <code>data-expand="true"</code> </p> <pre><code class="html"> &lt;div data-role="appbar" data-expand="true"&gt; ... &lt;/div&gt; </code></pre> <h3 id="_appbar_brand">Brand</h3> <p> To create <code>brand</code> you can use element with class <code>.brand</code>. If you no need hover for <code>brand element</code>, use class <code>.no-hover</code> for brand element. </p> <div class="example"> <div data-role="appbar" class="pos-relative z-dropdown"> <a href="#" class="brand">Brand name</a> <a href="#" class="brand no-hover">No hover</a> </div> </div> <pre><code class="html"> &lt;div data-role="appbar"&gt; &lt;a href="#" class="brand"&gt;Brand name&lt;/a&gt; &lt;a href="#" class="brand no-hover"&gt;Brand name&lt;/a&gt; &lt;/div&gt; </code></pre> <h3 id="_appbar_static_items">Static items</h3> <p> To create static items you must create element with class <code>.brand</code> or <code>.app-bar-item</code>. </p> <div class="example"> <div class="pos-relative z-dropdown" data-role="appbar"> <a href="#" class="brand no-hover"> <span style="width: 40px; height: 40px; line-height: 40px" class="text-center border bd-darkGray border-radius">m<sup>4</sup></span> </a> <div class="app-bar-container"> <a href="#" class="app-bar-item dropdown-toggle">Always</a> <ul class="d-menu" data-role="dropdown"> <li><a href="#">Windows 10</a></li> <li> <a href="#" class="dropdown-toggle">Office 365</a> <ul class="d-menu" data-role="dropdown"> <li><a href="#">Windows 10</a></li> <li><a href="#">Office 365</a></li> <li class="divider bg-lightGray"></li> <li><a href="#">Skype</a></li> </ul> </li> <li class="divider bg-lightGray"></li> <li><a href="#">Skype</a></li> </ul> </div> <a href="#" class="app-bar-item">Show</a> <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="#">Office 365</a></li> <li class="divider bg-lightGray"></li> <li><a href="#">Skype</a></li> </ul> </li> <li><a href="#">Blog</a></li> <li><a href="#">Contacts</a></li> </ul> </div> </div> <pre><code class="html"> &lt;div data-role="appbar"&gt; ... &lt;a href="#" class="app-bar-item"&gt;Always&lt;/a&gt; &lt;a href="#" class="app-bar-item"&gt;Show&lt;/a&gt; &lt;ul class="app-bar-menu"&gt; ... &lt;/ul&gt; &lt;/div&gt; </code></pre> <!-- ads-html --> <h3 id="_appbar_menu">Menu</h3> <p> To create app bar menu element you must create list with class <code>.app-bar-menu</code>. Each menu item must contains list item and anchor inside in a list item. </p> <div class="example"> <div class="pos-relative z-dropdown app-bar-expand-md" data-role="appbar"> <a href="#" class="brand no-hover"> <span style="width: 40px; height: 40px; line-height: 40px" class="text-center border bd-darkGray border-radius">m<sup>4</sup></span> </a> <ul class="app-bar-menu"> <li><a href="#">Home</a></li> <li><a href="#">Products</a></li> <li><a href="#">Blog</a></li> <li><a href="#">Contacts</a></li> </ul> </div> </div> <pre><code class="html"> &lt;div data-role="appbar"&gt; &lt;ul class="app-bar-menu"&gt; &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Products&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Blog&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Contacts&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <h3 id="_appbar_dropdown">Dropdown</h3> <p> To create dropped down sub menu you must create menu with class <code>.d-menu</code> and with role <code>data-role="dropdown"</code>. How to create menu read in <a href="menu.html">this article</a>. For <code>static</code> item you must use container with class <code>.app-bar-container</code> </p> <pre><code class="html"> &lt;div data-role="appbar"&gt; ... &lt;div class="app-bar-container"&gt; &lt;a href="#" class="app-bar-item dropdown-toggle"&gt;Always&lt;/a&gt; &lt;ul class="d-menu" data-role="dropdown"&gt; &lt;li&gt;&lt;a href="#"&gt;Windows 10&lt;/a&gt;&lt;/li&gt; &lt;li&gt; &lt;a href="#" class="dropdown-toggle"&gt;Office 365&lt;/a&gt; &lt;ul class="d-menu" data-role="dropdown"&gt; &lt;li&gt;&lt;a href="#"&gt;Windows 10&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Office 365&lt;/a&gt;&lt;/li&gt; &lt;li class="divider bg-lightGray"&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Skype&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="divider bg-lightGray"&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Skype&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; ... &lt;ul class="app-bar-menu"&gt; &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt; &lt;a href="#" class="dropdown-toggle"&gt;Products&lt;/a&gt; &lt;ul class="d-menu" data-role="dropdown"&gt; &lt;li&gt;&lt;a href="#"&gt;Windows 10&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Office 365&lt;/a&gt;&lt;/li&gt; &lt;li class="divider bg-lightGray"&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Skype&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Blog&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Contacts&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <h3 id="_appbar_hamburger">Hamburger</h3> <p> Hamburger button will be created automatically. You no need create it manually. </p> <h3 id="_appbar_ie_bugs">IE11 and Edge bugs</h3> <p> IE11 and Edge can be show <code>.app-bar-menu</code> incorrect. To fix it, you must add next style to page head. Unfortunately this bug is old, but still not corrected and is associated with the display of lists. </p> <pre><code> &lt;style&gt; .app-bar-menu li { list-style: none!important; } &lt;/style&gt; </code></pre> </main> </div> </div> <script src="docsearch/docsearch.min.js"></script> <script src="js/jquery-3.3.1.min.js"></script> <script src="metro/js/metro.js?ver=@@b-version"></script> <script src="highlight/highlight.pack.js"></script> <script src="js/clipboard.min.js"></script> <script src="js/site.js"></script> <!-- ads-script --> <!-- ga-script --> <!-- hit-ua --> </body> </html>