{"id":3928,"date":"2023-02-23T06:04:27","date_gmt":"2023-02-23T06:04:27","guid":{"rendered":"https:\/\/rengga.dev\/blog\/?p=3928"},"modified":"2023-06-10T11:32:22","modified_gmt":"2023-06-10T11:32:22","slug":"tailwind-dashboard-with-alpine-js","status":"publish","type":"post","link":"https:\/\/rengga.dev\/blog\/tailwind-dashboard-with-alpine-js\/","title":{"rendered":"Tailwind &#8211; Dashboard with Alpine.js"},"content":{"rendered":"<div class=\"flex flex-grow flex-col gap-3\">\n<div class=\"min-h-[20px] flex flex-col items-start gap-4 whitespace-pre-wrap\">\n<div class=\"markdown prose w-full break-words dark:prose-invert light\">\n<div class=\"flex flex-grow flex-col gap-3\">\n<div class=\"min-h-[20px] flex flex-col items-start gap-4 whitespace-pre-wrap\">\n<div class=\"markdown prose w-full break-words dark:prose-invert light\">\n<div class=\"flex flex-grow flex-col gap-3\">\n<div class=\"min-h-[20px] flex flex-col items-start gap-4 whitespace-pre-wrap\">\n<div class=\"markdown prose w-full break-words dark:prose-invert light\">\n<p>A Tailwind Dashboard with Alpine.js is a web application dashboard built using the Tailwind CSS framework and the Alpine.js JavaScript library. Tailwind CSS is a popular utility-first CSS framework that provides a set of pre-designed CSS classes to help you quickly build responsive and customizable user interfaces. Alpine.js is a lightweight JavaScript framework that allows you to easily add interactivity to your web applications.<\/p>\n<p>Together, Tailwind CSS and Alpine.js provide a powerful combination for building modern, responsive, and interactive web applications. With Tailwind CSS, you can easily style your web application dashboard using pre-designed CSS classes that are designed to work well together. Alpine.js allows you to add interactivity to your dashboard using declarative syntax, which means you can write less code and achieve more functionality.<\/p>\n<p>To create a Tailwind Dashboard with Alpine.js, you can start by using a pre-designed dashboard template built with Tailwind CSS. You can then add interactivity to your dashboard using Alpine.js. For example, you can use Alpine.js to create a dropdown menu, show and hide elements based on user interaction, or update the content of your dashboard dynamically.<\/p>\n<p>Here&#8217;s an example of a Tailwind Dashboard with Alpine.js:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">&lt;div x-data=\"{ activeTab: 'tab1' }\"&gt;\r\n  &lt;div class=\"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8\"&gt;\r\n    &lt;div class=\"py-6\"&gt;\r\n      &lt;div class=\"mb-4\"&gt;\r\n        &lt;button x-on:click=\"activeTab = 'tab1'\" :class=\"{ 'bg-gray-900 text-white': activeTab === 'tab1', 'text-gray-700 hover:text-gray-900': activeTab !== 'tab1' }\" class=\"px-3 py-2 rounded-md text-sm font-medium\"&gt;Tab 1&lt;\/button&gt;\r\n        &lt;button x-on:click=\"activeTab = 'tab2'\" :class=\"{ 'bg-gray-900 text-white': activeTab === 'tab2', 'text-gray-700 hover:text-gray-900': activeTab !== 'tab2' }\" class=\"px-3 py-2 rounded-md text-sm font-medium\"&gt;Tab 2&lt;\/button&gt;\r\n        &lt;button x-on:click=\"activeTab = 'tab3'\" :class=\"{ 'bg-gray-900 text-white': activeTab === 'tab3', 'text-gray-700 hover:text-gray-900': activeTab !== 'tab3' }\" class=\"px-3 py-2 rounded-md text-sm font-medium\"&gt;Tab 3&lt;\/button&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div x-show=\"activeTab === 'tab1'\"&gt;\r\n        &lt;!-- Content for Tab 1 --&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div x-show=\"activeTab === 'tab2'\"&gt;\r\n        &lt;!-- Content for Tab 2 --&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div x-show=\"activeTab === 'tab3'\"&gt;\r\n        &lt;!-- Content for Tab 3 --&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"su-row\">\n<div class=\"su-column su-column-size-1-2\"><div class=\"su-column-inner su-u-clearfix su-u-trim\"><div class=\"su-button-center\"><a href=\"https:\/\/tailwindcomponents.com\/component\/resposive-dashboard\/landing\" class=\"su-button su-button-style-glass su-button-wide\" style=\"color:#FFFFFF;background-color:#CD1110;border-color:#a40e0d;border-radius:50px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#FFFFFF;padding:8px 24px;font-size:18px;line-height:27px;border-color:#dc5958;border-radius:50px;text-shadow:1px 1px 1px #000000\"><i class=\"sui sui-github-square\" style=\"font-size:18px;color:#FFFFFF\"><\/i> Demo Page<\/span><\/a><\/div><\/div><\/div>\n<div class=\"su-column su-column-size-1-2\"><div class=\"su-column-inner su-u-clearfix su-u-trim\"><\/div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A Tailwind Dashboard with Alpine.js is a web application dashboard built using <a class=\"read-more\" href=\"https:\/\/rengga.dev\/blog\/tailwind-dashboard-with-alpine-js\/\" title=\"Tailwind &#8211; Dashboard with Alpine.js\" itemprop=\"url\"><\/a><\/p>\n","protected":false},"author":1,"featured_media":3929,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"quote","meta":{"footnotes":""},"categories":[11,20],"tags":[479,480,481,103,392],"newstopic":[],"class_list":{"0":"post-3928","1":"post","2":"type-post","3":"status-publish","4":"format-quote","5":"has-post-thumbnail","7":"category-html-css","8":"category-javascript","9":"tag-alpine-js","10":"tag-dashboard-tailwind","11":"tag-tailwind-dashboard-with-alpine-js","12":"tag-web-design","13":"tag-web-design-2023","14":"post_format-post-format-quote"},"_links":{"self":[{"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/posts\/3928","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/comments?post=3928"}],"version-history":[{"count":3,"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/posts\/3928\/revisions"}],"predecessor-version":[{"id":4050,"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/posts\/3928\/revisions\/4050"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/media\/3929"}],"wp:attachment":[{"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/media?parent=3928"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/categories?post=3928"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/tags?post=3928"},{"taxonomy":"newstopic","embeddable":true,"href":"https:\/\/rengga.dev\/blog\/wp-json\/wp\/v2\/newstopic?post=3928"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}