{"componentChunkName":"component---src-templates-tailwindclass-js","path":"/tailwindcss/classes/tailwind-min-height/","result":{"data":{"site":{"siteMetadata":{"title":"Resources to help developers | Contrast | Devwares","docsLocation":""}},"mdx":{"fields":{"id":"4fe4da43-9219-5bbe-83ae-8da8e187c9df","title":"Tailwind CSS Min-Height","slug":"/classes/tailwind-min-height/"},"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\": \"14 May 2024\",\n  \"title\": \"Tailwind CSS Min-Height\",\n  \"metaTitle\": \"Tailwind Min-Height\",\n  \"metaDescription\": \"The min-height utility class in Tailwind CSS allows you to control the minimum height of elements.\",\n  \"canonicalUrl\": \"https://windframe.dev/tailwind/classes/tailwind-min-height\"\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 Min Height\"), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"min-height\"), \" utility class in Tailwind CSS allows you to control the minimum height of elements. It provides a set of classes that enable you to set the minimum height to specific values, percentages, or use predefined min-height utilities for common use cases.\"), mdx(\"h2\", null, \"Setting Min-Height\"), mdx(\"p\", null, \"To set the minimum height of an element, you can use the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"min-h-{size}\"), \" class, where {size} can be one of the following options:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"min-h-{value}\"), \": This sets the minimum height to a specific value in pixels.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"min-h-screen\"), \": This sets the minimum height to the full height of the viewport.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"min-h-full\"), \": This sets the minimum height to 100% of the parent container.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"min-h-0\"), \": This sets the minimum height to 0, effectively hiding the element if there is no content.\"))), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-html\"\n  }, \"<div class=\\\"min-h-64...\\\">\\n  This div has a minimum height of 64 pixels.\\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: \"h-24 min-h-64 bg-green-500 rounded-md flex items-center justify-center text-white font-extrabold\"\n  }, \" This div has a minimum height of 64 pixels\")), \"---\", mdx(\"h2\", null, \"Percentage-based Min-Height\"), mdx(\"p\", null, \"Tailwind CSS also provides utility classes for setting minimum height as a percentage of the parent container's height. You can use the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"min-h-{percentage}\"), \" class to achieve this. Here's an example:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-html\"\n  }, \"<div class=\\\"min-h-full\\\">\\n  This div has a minimum height of 100% of its parent container.\\n</div>\\n\")), mdx(\"h2\", null, \"Preview\"), mdx(\"div\", {\n    className: \"rounded-t-xl overflow-hidden bg-yellow-100 p-10 \"\n  }, mdx(\"div\", {\n    className: \"h-16 min-h-full bg-yellow-500 rounded-md flex items-center justify-center text-white font-extrabold\"\n  }, \" This div has a minimum height of 100% of its parent container.\")), mdx(\"h2\", null, \"Responsive Min-Height\"), mdx(\"p\", null, \"Tailwind CSS allows you to control the minimum height of elements responsively at different breakpoints. To use responsive \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"min-height\"), \" classes, you can append the breakpoint prefix to the min-height classes. For example, \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"md:min-h-48\"), \" sets the minimum height to 48 pixels starting from the medium breakpoint and above. Here's an example:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-html\"\n  }, \"<div class=\\\"min-h-64 md:min-h-48\\\">\\n  This div has a minimum height of 64 pixels by default, and 48 pixels starting from the medium\\n  breakpoint.\\n</div>\\n\")), mdx(\"p\", null, \"In the above example, the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"min-h-64\"), \" class is applied by default, setting the minimum height to 64 pixels. However, starting from the medium breakpoint and above, the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"md:min-h-48\"), \" class is applied, changing the minimum height to 48 pixels.\"), mdx(\"h2\", null, \"Tailwind Min-height 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  }, \"min-h-0\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"min-height: 0px;\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"min-h-full\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"min-height: 100%;\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"min-h-screen\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"min-height: 100vh;\")))), mdx(\"h2\", null, \"Windframe Tailwind blocks\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://app.windframe.dev/editor?id=pricing2\"\n  }, \"Pricing\")));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#tailwind-min-height","title":"Tailwind Min Height","items":[{"url":"#setting-min-height","title":"Setting Min-Height"},{"url":"#preview","title":"Preview"},{"url":"#percentage-based-min-height","title":"Percentage-based Min-Height"},{"url":"#preview-1","title":"Preview"},{"url":"#responsive-min-height","title":"Responsive Min-Height"},{"url":"#tailwind-min-height-table","title":"Tailwind Min-height Table"},{"url":"#windframe-tailwind-blocks","title":"Windframe Tailwind blocks"}]}]},"parent":{"__typename":"File","relativePath":"classes/tailwind-min-height.md"},"frontmatter":{"githubUrl":null,"metaTitle":"Tailwind Min-Height","lastUpdated":"14 May 2024","metaDescription":"The min-height utility class in Tailwind CSS allows you to control the minimum height of elements."}}},"pageContext":{"id":"4fe4da43-9219-5bbe-83ae-8da8e187c9df"}},"staticQueryHashes":["2619113677","2619113677","2619113677","2619113677","2619113677","2619113677","2619113677","2619113677","3309287076","3309287076","3706406642","3706406642","3706406642","4045616534","4045616534","956403285"]}