{"componentChunkName":"component---src-templates-tailwindclass-js","path":"/tailwindcss/classes/tailwind-flex-wrap/","result":{"data":{"site":{"siteMetadata":{"title":"Resources to help developers | Contrast | Devwares","docsLocation":""}},"mdx":{"fields":{"id":"dd54147a-5337-5163-ad3e-8ea7ac00f545","title":"Tailwind CSS Flex wrap","slug":"/classes/tailwind-flex-wrap/"},"body":"var _excluded = [\"components\"];\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {\n  \"lastUpdated\": \"11 May 2024\",\n  \"title\": \"Tailwind CSS Flex wrap\",\n  \"metaTitle\": \"Tailwind Flex wrap\",\n  \"metaDescription\": \"The tailwind flex wrap utility class allows you to control whether flex items should wrap or stay on a single line within a flex container.\",\n  \"canonicalUrl\": \"https://windframe.dev/tailwind/classes/tailwind-flex-wrap\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h1\", null, \"Tailwind Flex Wrap\"), mdx(\"p\", null, \"The tailwind flex wrap utility class in Tailwind CSS allows you to control whether flex items should wrap or stay on a single line within a flex container. It provides a set of classes that enable you to easily specify the wrapping behavior, allowing you to create flexible and responsive layouts.\"), mdx(\"h2\", null, \"Setting Tailwind Flex Wrap\"), mdx(\"p\", null, \"To set the tailwind flex wrap behavior of a flex container, you can use the flex class in combination with one of the following classes:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"flex-wrap\"), \": This allows flex items to wrap onto multiple lines if needed.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"flex-wrap-reverse\"), \": This allows flex items to wrap onto multiple lines in reverse order if needed.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"flex-nowrap\"), \": This prevents flex items from wrapping and keeps them on a single line.\"))), mdx(\"h2\", null, \"Tailwind Flex-wrap\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://windframe.dev/classes/flex/flex-wrap\"\n  }, \"Tailwind flex wrap\"), \" class allows flex items to wrap onto multiple lines if needed.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-html\"\n  }, \"<div class=\\\"flex flex-wrap....\\\">\\n  <div class=\\\"flex-1\\\">A</div>\\n  <div class=\\\"flex-1\\\">B</div>\\n  <div class=\\\"flex-1\\\">C</div>\\n</div>\\n\")), mdx(\"h2\", null, \"Preview\"), mdx(\"div\", {\n    className: \"rounded-t-xl overflow-hidden bg-blue-100 p-10 \"\n  }, mdx(\"div\", {\n    className: \"flex flex-wrap -m-2\"\n  }, mdx(\"div\", {\n    className: \"h-12 w-2/5 rounded-md  bg-blue-500 text-white flex items-center justify-center font-extrabold m-2\"\n  }, \"A\"), mdx(\"div\", {\n    className: \"h-12 w-2/5 rounded-md  bg-blue-500 text-white flex items-center justify-center font-extrabold m-2\"\n  }, \"B\"), mdx(\"div\", {\n    className: \"h-12 w-2/5 rounded-md  bg-blue-500 text-white flex items-center justify-center font-extrabold m-2\"\n  }, \"C\"))), mdx(\"h2\", null, \"Tailwind Flex Wrap Reverse\"), mdx(\"p\", null, \"Tailwind flex wrap reverse class allows flex items to wrap onto multiple lines in reverse order if needed\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-html\"\n  }, \"<div class=\\\"flex flex-wrap-reverse....\\\">\\n  <div class=\\\"flex....\\\">A</div>\\n  <div class=\\\"flex...\\\">B</div>\\n  <div class=\\\"flex...\\\">C</div>\\n</div>\\n\")), mdx(\"h2\", null, \"Preview\"), mdx(\"div\", {\n    className: \"rounded-t-xl overflow-hidden bg-green-100 p-10 \"\n  }, mdx(\"div\", {\n    className: \"flex flex-wrap-reverse -m-2\"\n  }, mdx(\"div\", {\n    className: \"h-12 w-2/5 rounded-md flex-none bg-green-500 text-white flex items-center justify-center font-extrabold m-2\"\n  }, \"A\"), mdx(\"div\", {\n    className: \"h-12 w-2/5 rounded-md flex-none bg-green-500 text-white flex items-center justify-center font-extrabold m-2\"\n  }, \"B\"), mdx(\"div\", {\n    className: \"h-12 w-2/5 rounded-md flex-none bg-green-500 text-white flex items-center justify-center font-extrabold m-2\"\n  }, \"C\"))), \"---\", mdx(\"h2\", null, \"Tailwind Flex-Nowrap\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://windframe.dev/classes/flex/flex-nonwrap\"\n  }, \"Tailwind flex nowrap\"), \" class prevents flex items from wrapping and keeps them on a single line\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-html\"\n  }, \"<div class=\\\"flex flex-nowrap....\\\">\\n  <div class=\\\"flex-none...\\\">A</div>\\n  <div class=\\\"flex-none...\\\">B</div>\\n  <div class=\\\"flex-none...\\\">C</div>\\n</div>\\n\")), mdx(\"h2\", null, \"Preview\"), mdx(\"div\", {\n    className: \"rounded-t-xl overflow-hidden bg-purple-100 p-10 \"\n  }, mdx(\"div\", {\n    className: \"flex flex-nowrap space-x-4\"\n  }, mdx(\"div\", {\n    className: \"h-12 w-2/5 rounded-md flex-none bg-purple-500 text-white flex items-center justify-center font-extrabold m-2\"\n  }, \"A\"), mdx(\"div\", {\n    className: \"h-12 w-2/5 rounded-md flex-none bg-purple-500 text-white flex items-center justify-center font-extrabold m-2\"\n  }, \"B\"), mdx(\"div\", {\n    className: \"h-12 w-2/5 rounded-md flex-none bg-purple-500 text-white flex items-center justify-center font-extrabold m-2\"\n  }, \"C\"))), \"---\", mdx(\"p\", null, \"That's it! You now have a good understanding of how to use the flex wrap utility classes in Tailwind CSS to control whether flex items should wrap or stay on a single line within a flex container.\"), mdx(\"h2\", null, \"Tailwind Flex Wrap Class Table\"), mdx(\"table\", null, mdx(\"thead\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"thead\"\n  }, mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Class\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Properties\"))), mdx(\"tbody\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"flex-wrap\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"flex-wrap: wrap;\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"flex-wrap-reverse\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"flex-wrap: wrap-reverse;\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"flex-nowrap\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"flex-wrap: nowrap;\")))), mdx(\"h2\", null, \"Windframe Tailwind blocks\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://app.windframe.dev/editor?id=footers2\"\n  }, \"footer\")));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#tailwind-flex-wrap","title":"Tailwind Flex Wrap","items":[{"url":"#setting-tailwind-flex-wrap","title":"Setting Tailwind Flex Wrap"},{"url":"#tailwind-flex-wrap-1","title":"Tailwind Flex-wrap"},{"url":"#preview","title":"Preview"},{"url":"#tailwind-flex-wrap-reverse","title":"Tailwind Flex Wrap Reverse"},{"url":"#preview-1","title":"Preview"},{"url":"#tailwind-flex-nowrap","title":"Tailwind Flex-Nowrap"},{"url":"#preview-2","title":"Preview"},{"url":"#tailwind-flex-wrap-class-table","title":"Tailwind Flex Wrap Class Table"},{"url":"#windframe-tailwind-blocks","title":"Windframe Tailwind blocks"}]}]},"parent":{"__typename":"File","relativePath":"classes/tailwind-flex-wrap.md"},"frontmatter":{"githubUrl":null,"metaTitle":"Tailwind Flex wrap","lastUpdated":"11 May 2024","metaDescription":"The tailwind flex wrap utility class allows you to control whether flex items should wrap or stay on a single line within a flex container."}}},"pageContext":{"id":"dd54147a-5337-5163-ad3e-8ea7ac00f545"}},"staticQueryHashes":["2619113677","2619113677","2619113677","2619113677","2619113677","2619113677","2619113677","2619113677","3309287076","3309287076","3706406642","3706406642","3706406642","4045616534","4045616534","956403285"]}