"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[874],{3905:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return d}});var a=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},l=Object.keys(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=a.createContext({}),m=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},c=function(e){var t=m(e.components);return a.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,l=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),u=m(n),d=i,h=u["".concat(s,".").concat(d)]||u[d]||p[d]||l;return n?a.createElement(h,r(r({ref:t},c),{},{components:n})):a.createElement(h,r({ref:t},c))}));function d(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var l=n.length,r=new Array(l);r[0]=u;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:i,r[1]=o;for(var m=2;m<l;m++)r[m]=n[m];return a.createElement.apply(null,r)}return a.createElement.apply(null,n)}u.displayName="MDXCreateElement"},2695:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(7462),i=n(3366),l=n(7294),r=["isBad","isGood","children","disableFullscreen","limitWidth"];function o(e){var t=e.isBad,n=e.isGood,o=e.children,s=e.disableFullscreen,m=e.limitWidth,c=(0,i.Z)(e,r),p=(0,l.useState)(!1),u=p[0],d=p[1];return l.createElement("div",{className:"preview-box-wrapper",style:m?{width:m,display:"table",margin:"0 auto"}:{}},!s&&l.createElement("button",{"aria-label":u?"Minimize the example":"Fullscreen the example",className:"preview-box-fullscreen-toggle",onClick:function(e){var t=e.target.closest(".preview-box-wrapper");u?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen(),d(!u)}},u?l.createElement("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",viewBox:"0 0 24 24"},l.createElement("path",{d:"M19.707 18.293a1 1 0 01-1.414 1.414L16 17.414V18a1 1 0 01-2 0v-3a1 1 0 011-1h3a1 1 0 010 2h-.586zM9 14H6a1 1 0 000 2h.586l-2.293 2.293a1 1 0 001.414 1.414L8 17.414V18a1 1 0 002 0v-3a1 1 0 00-1-1zm0-9a1 1 0 00-1 1v.586L5.707 4.293a1 1 0 00-1.414 1.414L6.586 8H6a1 1 0 000 2h3a1 1 0 001-1V6a1 1 0 00-1-1zm6 5h3a1 1 0 000-2h-.586l2.293-2.293a1 1 0 00-1.414-1.414L16 6.586V6a1 1 0 00-2 0v3a1 1 0 001 1z"})):l.createElement("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",viewBox:"26 26 48 48"},l.createElement("path",{d:"M54.347 57.882A8.96 8.96 0 0150 59a8.96 8.96 0 01-4.347-1.118L40.736 62.8c-.38.38-.257.701.29.701h.98A2.503 2.503 0 0144.5 66c0 1.39-1.122 2.5-2.507 2.5h-7.986a2.505 2.505 0 01-2.507-2.507v-7.986A2.502 2.502 0 0134 55.5a2.49 2.49 0 012.5 2.493v.98c0 .547.314.678.7.29l4.918-4.916A8.96 8.96 0 0141 50a8.96 8.96 0 011.118-4.347L37.2 40.736c-.38-.38-.701-.257-.701.29v.98A2.503 2.503 0 0134 44.5c-1.39 0-2.5-1.122-2.5-2.507v-7.986a2.505 2.505 0 012.507-2.507h7.986A2.502 2.502 0 0144.5 34a2.49 2.49 0 01-2.493 2.5h-.98c-.547 0-.678.314-.29.7l4.916 4.918A8.96 8.96 0 0150 41a8.96 8.96 0 014.347 1.118l4.917-4.917c.38-.38.257-.701-.29-.701h-.98A2.503 2.503 0 0155.5 34c0-1.39 1.122-2.5 2.507-2.5h7.986a2.505 2.505 0 012.507 2.507v7.986A2.502 2.502 0 0166 44.5a2.49 2.49 0 01-2.5-2.493v-.98c0-.547-.314-.678-.7-.29l-4.918 4.916A8.96 8.96 0 0159 50a8.96 8.96 0 01-1.118 4.347l4.917 4.917c.38.38.701.257.701-.29v-.98A2.503 2.503 0 0166 55.5c1.39 0 2.5 1.122 2.5 2.507v7.986a2.505 2.505 0 01-2.507 2.507h-7.986A2.502 2.502 0 0155.5 66a2.49 2.49 0 012.493-2.5h.98c.547 0 .678-.314.29-.7l-4.916-4.918zM50 54a4 4 0 100-8 4 4 0 000 8z"}))),t&&l.createElement("div",{className:"is-bad-example style-red"},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",viewBox:"2 2 12 12"},l.createElement("path",{d:"M3.3 12.7c.2.2.4.3.7.3s.5-.1.7-.3L8 9.4l3.3 3.3c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4L9.4 8l3.3-3.3c.4-.4.4-1 0-1.4s-1-.4-1.4 0L8 6.6 4.7 3.3c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4L6.6 8l-3.3 3.3c-.4.4-.4 1 0 1.4z"}))),n&&l.createElement("div",{className:"is-good-example style-green"},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",viewBox:"0 0 18 18"},l.createElement("path",{d:"M5.056 15.04a1.5 1.5 0 002.217-.119l10.17-12.476A1.5 1.5 0 0015.118.55L6.007 11.758l-3.453-3.41a1.5 1.5 0 10-2.109 2.133l4.611 4.56"}))),l.createElement("iframe",(0,a.Z)({width:"100%",className:"docus-preview-box"+(u?" is-fullscreen":""),srcDoc:o},c)))}},3408:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return s},contentTitle:function(){return m},metadata:function(){return c},toc:function(){return p},default:function(){return d}});var a=n(7462),i=n(3366),l=(n(7294),n(3905)),r=n(2695),o=["components"],s={title:"Menu"},m=void 0,c={unversionedId:"components/menu",id:"components/menu",isDocsHomePage:!1,title:"Menu",description:"Menu is a handy component, by default dropdown and navigation bar use this component and style it based on their usage.",source:"@site/docs/components/menu.mdx",sourceDirName:"components",slug:"/components/menu",permalink:"/docs/components/menu",editUrl:"https://github.com/amir2mi/flatifycss/tree/master/website/docs/components/menu.mdx",tags:[],version:"current",frontMatter:{title:"Menu"},sidebar:"tutorialSidebar",previous:{title:"Loading",permalink:"/docs/components/loading"},next:{title:"Modals",permalink:"/docs/components/modal"}},p=[{value:"Vertical",id:"vertical",children:[],level:2},{value:"Horizontal",id:"horizontal",children:[],level:2},{value:"Submenu",id:"submenu",children:[],level:2},{value:"Customization",id:"customization",children:[],level:2}],u={toc:p};function d(e){var t=e.components,n=(0,i.Z)(e,o);return(0,l.kt)("wrapper",(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("p",null,"Menu is a handy component, by default ",(0,l.kt)("a",{parentName:"p",href:"/docs/components/dropdown"},"dropdown")," and ",(0,l.kt)("a",{parentName:"p",href:"/docs/components/navbar"},"navigation bar")," use this component and style it based on their usage.",(0,l.kt)("br",{parentName:"p"}),"\n","Generally there is a ",(0,l.kt)("inlineCode",{parentName:"p"},".menu-items-wrapper")," parent element with ",(0,l.kt)("inlineCode",{parentName:"p"},".menu-item")," children."),(0,l.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,l.kt)("div",{parentName:"div",className:"admonition-heading"},(0,l.kt)("h5",{parentName:"div"},(0,l.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,l.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,l.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))),"Active & disabled states")),(0,l.kt)("div",{parentName:"div",className:"admonition-content"},(0,l.kt)("p",{parentName:"div"},"With ",(0,l.kt)("inlineCode",{parentName:"p"},".active")," and ",(0,l.kt)("inlineCode",{parentName:"p"},".disabled")," classes you can show active item of the list and disable a link."))),(0,l.kt)("h2",{id:"vertical"},"Vertical"),(0,l.kt)(r.Z,{height:"270px",children:'\n<!DOCTYPE html>\n<html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatifycss/dist/css/flatify.min.css" /> <title>Menu</title> </head> <body> <ul class="menu-items-wrapper"> <li class="menu-item active"><a>Home</a></li> <li class="menu-item"><a>Articles</a></li> <li class="menu-item"><a>Photos</a></li> <li class="menu-item"><a>Videos</a></li> <li class="menu-item disabled"><a>About Us</a></li> </ul> </body>\n</html>\n',mdxType:"PreviewBox"}),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-html",metastring:'title="index.html"',title:'"index.html"'},'<ul class="menu-items-wrapper">\n  <li class="menu-item active"><a>Home</a></li>\n  <li class="menu-item"><a>Articles</a></li>\n  <li class="menu-item"><a>Photos</a></li>\n  <li class="menu-item"><a>Videos</a></li>\n  <li class="menu-item disabled"><a>About Us</a></li>\n</ul>\n')),(0,l.kt)("h2",{id:"horizontal"},"Horizontal"),(0,l.kt)("p",null,"By adding the ",(0,l.kt)("inlineCode",{parentName:"p"},".flex-center")," menu will be horizontal."),(0,l.kt)(r.Z,{height:"110px",children:'\n<!DOCTYPE html>\n<html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatifycss/dist/css/flatify.min.css" /> <title>Menu</title> </head> <body> <ul class="menu-items-wrapper flex-center"> <li class="menu-item active"><a>Home</a></li> <li class="menu-item"><a>Articles</a></li> <li class="menu-item"><a>Photos</a></li> <li class="menu-item"><a>Videos</a></li> <li class="menu-item disabled"><a>About Us</a></li> </ul> </body>\n</html>\n',mdxType:"PreviewBox"}),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-html",metastring:'title="index.html"',title:'"index.html"'},'<ul class="menu-items-wrapper flex-center">\n  <li class="menu-item active"><a>Home</a></li>\n  <li class="menu-item"><a>Articles</a></li>\n  <li class="menu-item"><a>Photos</a></li>\n  <li class="menu-item"><a>Videos</a></li>\n  <li class="menu-item disabled"><a>About Us</a></li>\n</ul>\n')),(0,l.kt)("h2",{id:"submenu"},"Submenu"),(0,l.kt)("p",null,"Submenu is the second level of menu. Generally it has show/hide functionality but inside ",(0,l.kt)("a",{parentName:"p",href:"/docs/components/navbar"},"navigation bar")," component."),(0,l.kt)("div",{className:"admonition admonition-success alert alert--success"},(0,l.kt)("div",{parentName:"div",className:"admonition-heading"},(0,l.kt)("h5",{parentName:"div"},(0,l.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,l.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,l.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))),"Submenu arrow")),(0,l.kt)("div",{parentName:"div",className:"admonition-content"},(0,l.kt)("p",{parentName:"div"},"Submenu can have arrow, you can use ",(0,l.kt)("inlineCode",{parentName:"p"},".arrow-top"),", ",(0,l.kt)("inlineCode",{parentName:"p"},".arrow-bottom"),", ",(0,l.kt)("inlineCode",{parentName:"p"},".arrow-left"),", ",(0,l.kt)("inlineCode",{parentName:"p"},".arrow-right")," classes for different directions."))),(0,l.kt)(r.Z,{height:"280px",children:'\n<!DOCTYPE html>\n<html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatifycss/dist/css/flatify.min.css" /> <title>Menu</title> </head> <body> <div class="menu-items-wrapper"> <ul class="submenu arrow-top"> <li class="menu-item active"><a>Home</a></li> <li class="menu-item"><a>Articles</a></li> <li class="menu-item"><a>Photos</a></li> <li class="menu-item"><a>Videos</a></li> <li class="menu-item disabled"><a>About Us</a></li> </ul> </div> </body>\n</html>\n',mdxType:"PreviewBox"}),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-html",metastring:'title="index.html"',title:'"index.html"'},'<div class="menu-items-wrapper">\n  <ul class="submenu arrow-top">\n    <li class="menu-item active"><a>Home</a></li>\n    <li class="menu-item"><a>Articles</a></li>\n    <li class="menu-item"><a>Photos</a></li>\n    <li class="menu-item"><a>Videos</a></li>\n    <li class="menu-item disabled"><a>About Us</a></li>\n  </ul>\n</div>\n')),(0,l.kt)("h2",{id:"customization"},"Customization"),(0,l.kt)("p",null,"Menu, menu items and submenu have their own CSS variables to be customized, you see all possible options below."),(0,l.kt)("p",null,"Menu items wrapper:",(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-bg-color"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-txt-color"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-border-color")),(0,l.kt)("p",null,"Menu items:",(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-active-item-bg-color"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-active-item-txt-color"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-item-bg-color"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-item-bg-color__hover"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-item-bg-color__focus"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-item-txt-color"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-item-txt-color__hover"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__menu-item-txt-color__focus")),(0,l.kt)("p",null,"Submenu:",(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-bg-color"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-txt-color"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-border-color")),(0,l.kt)("p",null,"Submenu items:",(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-item-bg-color"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-item-bg-color__hover"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-item-bg-color__focus"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-item-txt-color"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-item-txt-color__hover"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-item-txt-color__focus")),(0,l.kt)("p",null,"Submenu animation (when they are inside ",(0,l.kt)("a",{parentName:"p",href:"/docs/components/navbar"},"navigation bar"),"):",(0,l.kt)("br",{parentName:"p"}),"\n","Change current animation:",(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-animation-show-duration"),(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-animation-show-delay"),(0,l.kt)("br",{parentName:"p"}),"\n","Or set a new animation:",(0,l.kt)("br",{parentName:"p"}),"\n",(0,l.kt)("inlineCode",{parentName:"p"},"--flatify__submenu-animation-show")))}d.isMDXComponent=!0}}]);