<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sidebar menu responsive Arsip - Farhanhidayat.com</title>
	<atom:link href="https://farhanhidayat.com/tag/sidebar-menu-responsive/feed/" rel="self" type="application/rss+xml" />
	<link>https://farhanhidayat.com/tag/sidebar-menu-responsive/</link>
	<description></description>
	<lastBuildDate>Wed, 29 Apr 2026 16:32:34 +0000</lastBuildDate>
	<language>id</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://farhanhidayat.com/wp-content/uploads/2024/11/cropped-Favicon-Farhanhidayat-32x32.png</url>
	<title>sidebar menu responsive Arsip - Farhanhidayat.com</title>
	<link>https://farhanhidayat.com/tag/sidebar-menu-responsive/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>5 Sidebar Menu Responsive Siap Pakai (HTML, CSS, JS)</title>
		<link>https://farhanhidayat.com/sidebar-menu-html-css-js/</link>
					<comments>https://farhanhidayat.com/sidebar-menu-html-css-js/#respond</comments>
		
		<dc:creator><![CDATA[Farhan Hidayat]]></dc:creator>
		<pubDate>Wed, 29 Apr 2026 16:32:34 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[contoh sidebar menu]]></category>
		<category><![CDATA[responsive web design]]></category>
		<category><![CDATA[sidebar dashboard responsive]]></category>
		<category><![CDATA[sidebar menu HTML CSS JS]]></category>
		<category><![CDATA[sidebar menu responsive]]></category>
		<category><![CDATA[template sidebar responsive]]></category>
		<guid isPermaLink="false">https://farhanhidayat.com/?p=2489</guid>

					<description><![CDATA[<p>Sidebar menu responsive jadi salah satu elemen penting dalam desain website modern, terutama untuk dashboard dan halaman dengan banyak navigasi. Selain itu, penggunaan sidebar yang tepat bisa bikin tampilan lebih rapi dan mudah diakses di berbagai device. Nah, di artikel ini kamu akan menemukan sidebar menu HTML CSS JS yang siap pakai, praktis, dan bisa [&#8230;]</p>
<p>Artikel <a href="https://farhanhidayat.com/sidebar-menu-html-css-js/">5 Sidebar Menu Responsive Siap Pakai (HTML, CSS, JS)</a> pertama kali tampil pada <a href="https://farhanhidayat.com">Farhanhidayat.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sidebar menu responsive jadi salah satu elemen penting dalam desain website modern, terutama untuk dashboard dan halaman dengan banyak navigasi. Selain itu, penggunaan sidebar yang tepat bisa bikin tampilan lebih rapi dan mudah diakses di berbagai device. Nah, di artikel ini kamu akan menemukan sidebar menu HTML CSS JS yang siap pakai, praktis, dan bisa langsung kamu gunakan tanpa ribet.</p>
<hr />
<h2 id="kenapa-sidebar-menu-responsive-itu-penting">Kenapa Sidebar Menu Responsive Itu Penting?</h2>
<p>Pertama-tama, banyak website masih punya masalah pada bagian navigasi. Misalnya, menu yang tidak nyaman diakses di HP atau tampilan yang berantakan saat dibuka di layar kecil. Akibatnya, user jadi kesulitan dan cepat meninggalkan website.</p>
<p>Di sisi lain, sidebar responsive hadir sebagai solusi yang lebih fleksibel. Dengan desain yang bisa menyesuaikan ukuran layar, navigasi jadi lebih rapi dan mudah digunakan. Selain itu, sidebar juga membantu meningkatkan user experience karena semua menu tersusun dengan jelas.</p>
<hr />
<h2 id="5-sidebar-menu-html-css-js-siap-pakai">5 Sidebar Menu HTML CSS JS Siap Pakai</h2>
<p>Sekarang kita masuk ke bagian yang paling ditunggu. Berikut ini beberapa contoh sidebar yang bisa langsung kamu gunakan.</p>
<h3 id="1-sidebar-simple-minimalis">1. Sidebar Simple &amp; Minimalis</h3>
<p><img fetchpriority="high" decoding="async" class="alignnone wp-image-2490 size-full" src="https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Simple-Minimalis.webp" alt="" width="700" height="525" srcset="https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Simple-Minimalis.webp 700w, https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Simple-Minimalis-300x225.webp 300w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<h4 id="full-code-sidebar-simple-minimalis-ui-modern">Full Code – Sidebar Simple &amp; Minimalis (UI Modern)</h4>
<p><strong>HTML</strong></p>
<pre class="ei-lighter-js"><code class="language-html">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  &lt;title&gt;Minimo Dashboard&lt;/title&gt;
  &lt;link rel="stylesheet" href="style.css" /&gt;
  &lt;link href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css" rel="stylesheet"&gt;
&lt;/head&gt;
&lt;body&gt;

  &lt;div class="dashboard"&gt;

    &lt;aside class="sidebar" id="sidebar"&gt;
      &lt;div class="brand"&gt;
        &lt;i class='bx bx-home-alt-2'&gt;&lt;/i&gt;
        &lt;span&gt;Minimo&lt;/span&gt;
      &lt;/div&gt;

      &lt;nav&gt;
        &lt;a class="active"&gt;&lt;i class='bx bx-home-alt'&gt;&lt;/i&gt; Dashboard&lt;/a&gt;
        &lt;a&gt;&lt;i class='bx bx-bar-chart-alt-2'&gt;&lt;/i&gt; Analytics&lt;/a&gt;
        &lt;a&gt;&lt;i class='bx bx-shopping-bag'&gt;&lt;/i&gt; Products&lt;/a&gt;
        &lt;a&gt;&lt;i class='bx bx-cart'&gt;&lt;/i&gt; Orders&lt;/a&gt;
        &lt;a&gt;&lt;i class='bx bx-user'&gt;&lt;/i&gt; Customers&lt;/a&gt;
        &lt;a&gt;&lt;i class='bx bx-cog'&gt;&lt;/i&gt; Settings&lt;/a&gt;
        &lt;a&gt;&lt;i class='bx bx-log-out'&gt;&lt;/i&gt; Logout&lt;/a&gt;
      &lt;/nav&gt;
    &lt;/aside&gt;

    &lt;main class="main"&gt;
      &lt;header&gt;
        &lt;button class="menu-btn" id="menuBtn"&gt;
          &lt;i class='bx bx-menu'&gt;&lt;/i&gt;
        &lt;/button&gt;

        &lt;div class="profile"&gt;
          &lt;i class='bx bx-user'&gt;&lt;/i&gt;
        &lt;/div&gt;
      &lt;/header&gt;

      &lt;section class="content"&gt;
        &lt;h1&gt;Dashboard&lt;/h1&gt;
        &lt;p&gt;Welcome back, Admin!&lt;/p&gt;

        &lt;div class="cards"&gt;
          &lt;div class="card"&gt;
            &lt;div class="top-card"&gt;
              &lt;div class="icon blue"&gt;&lt;i class='bx bx-group'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;span&gt;Total Users&lt;/span&gt;
            &lt;/div&gt;
            &lt;h2&gt;1,250&lt;/h2&gt;
            &lt;b&gt;+12%&lt;/b&gt;
          &lt;/div&gt;

          &lt;div class="card"&gt;
            &lt;div class="top-card"&gt;
              &lt;div class="icon green"&gt;&lt;i class='bx bx-cart'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;span&gt;Orders&lt;/span&gt;
            &lt;/div&gt;
            &lt;h2&gt;320&lt;/h2&gt;
            &lt;b&gt;+8%&lt;/b&gt;
          &lt;/div&gt;

          &lt;div class="card"&gt;
            &lt;div class="top-card"&gt;
              &lt;div class="icon purple"&gt;&lt;i class='bx bx-dollar-circle'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;span&gt;Revenue&lt;/span&gt;
            &lt;/div&gt;
            &lt;h2&gt;$12,850&lt;/h2&gt;
            &lt;b&gt;+15%&lt;/b&gt;
          &lt;/div&gt;

          &lt;div class="card"&gt;
            &lt;div class="top-card"&gt;
              &lt;div class="icon orange"&gt;&lt;i class='bx bx-package'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;span&gt;Products&lt;/span&gt;
            &lt;/div&gt;
            &lt;h2&gt;58&lt;/h2&gt;
            &lt;b&gt;+5%&lt;/b&gt;
          &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class="bottom"&gt;
          &lt;div class="chart-box"&gt;
            &lt;div class="box-head"&gt;
              &lt;h3&gt;Sales Overview&lt;/h3&gt;
              &lt;button&gt;This Week &lt;i class='bx bx-chevron-down'&gt;&lt;/i&gt;&lt;/button&gt;
            &lt;/div&gt;
            &lt;canvas id="salesChart"&gt;&lt;/canvas&gt;
          &lt;/div&gt;

          &lt;div class="orders-box"&gt;
            &lt;h3&gt;Recent Orders&lt;/h3&gt;

            &lt;div class="order"&gt;
              &lt;div class="order-icon blue"&gt;&lt;i class='bx bx-user'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;div&gt;
                &lt;h4&gt;#ORD-001&lt;/h4&gt;
                &lt;p&gt;John Doe&lt;/p&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class="order"&gt;
              &lt;div class="order-icon green"&gt;&lt;i class='bx bx-receipt'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;div&gt;
                &lt;h4&gt;#ORD-002&lt;/h4&gt;
                &lt;p&gt;Jane Smith&lt;/p&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class="order"&gt;
              &lt;div class="order-icon purple"&gt;&lt;i class='bx bx-shopping-bag'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;div&gt;
                &lt;h4&gt;#ORD-003&lt;/h4&gt;
                &lt;p&gt;Michael Lee&lt;/p&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class="order"&gt;
              &lt;div class="order-icon yellow"&gt;&lt;i class='bx bx-package'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;div&gt;
                &lt;h4&gt;#ORD-004&lt;/h4&gt;
                &lt;p&gt;Sarah Wilson&lt;/p&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class="order"&gt;
              &lt;div class="order-icon pink"&gt;&lt;i class='bx bx-envelope'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;div&gt;
                &lt;h4&gt;#ORD-005&lt;/h4&gt;
                &lt;p&gt;David Brown&lt;/p&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/section&gt;
    &lt;/main&gt;

    &lt;div class="overlay" id="overlay"&gt;&lt;/div&gt;
  &lt;/div&gt;

  &lt;script src="https://cdn.jsdelivr.net/npm/chart.js"&gt;&lt;/script&gt;
  &lt;script src="script.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<p><strong>CSS</strong></p>
<pre class="ei-lighter-js"><code class="language-css">@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  background: linear-gradient(135deg, #eef5ff, #f8fbff);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  color: #17233c;
  padding: 40px 0;
}

.dashboard {
  width: 92%;
  max-width: 1180px;
  min-height: 760px;
  height: auto;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(64, 93, 135, 0.25);
  display: flex;
  overflow: visible;
  position: relative;
}

.sidebar {
  width: 260px;
  background: rgba(255, 255, 255, 0.95);
  border-right: 1px solid #edf1f7;
  padding: 34px 24px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 36px;
}

.brand i {
  font-size: 30px;
  color: #1677ff;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

nav a {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-radius: 12px;
  color: #697386;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

nav a i {
  font-size: 23px;
}

nav a.active,
nav a:hover {
  background: #edf4ff;
  color: #1677ff;
}

.main {
  flex: 1;
  min-width: 0;
  overflow: visible;
}

header {
  height: 88px;
  border-bottom: 1px solid #edf1f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
}

.menu-btn {
  border: none;
  background: transparent;
  font-size: 34px;
  color: #6b7a90;
  cursor: pointer;
}

.profile {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #eef2f8;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #8c98aa;
  font-size: 28px;
}

.content {
  padding: 34px 40px 70px;
}

.content h1 {
  font-size: 34px;
  margin-bottom: 8px;
}

.content &gt; p {
  font-size: 17px;
  color: #6d7585;
  margin-bottom: 32px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  min-height: 150px;
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 16px;
  padding: 24px 18px;
  box-shadow: 0 12px 28px rgba(80, 105, 145, 0.1);
  position: relative;
}

.top-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card .icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 25px;
}

.card span {
  color: #677184;
  font-weight: 500;
}

.card h2 {
  font-size: 28px;
  margin-top: 28px;
}

.card b {
  position: absolute;
  right: 20px;
  bottom: 35px;
  color: #23bf63;
  font-size: 14px;
}

.blue {
  background: #eaf3ff;
  color: #1677ff;
}

.green {
  background: #e9faef;
  color: #22b85f;
}

.purple {
  background: #f0ebff;
  color: #715cff;
}

.orange {
  background: #fff1e8;
  color: #ff7b22;
}

.yellow {
  background: #fff6dd;
  color: #f6a800;
}

.pink {
  background: #ffe8f1;
  color: #ff4e8a;
}

.bottom {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
}

.chart-box,
.orders-box {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #edf1f7;
  box-shadow: 0 12px 28px rgba(80, 105, 145, 0.1);
}

.chart-box {
  min-height: 360px;
  padding: 28px;
}

.box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.box-head h3,
.orders-box h3 {
  font-size: 18px;
}

.box-head button {
  border: 1px solid #e1e7f0;
  background: #fff;
  color: #677184;
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
}

.orders-box {
  padding: 28px;
}

.order {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 23px;
}

.order-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.order h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.order p {
  font-size: 13px;
  color: #70798a;
}

canvas {
  width: 100% !important;
  height: 250px !important;
}

.overlay {
  display: none;
}

/* Tablet */
@media (max-width: 1024px) {
  body {
    padding: 30px 20px;
  }

  .dashboard {
    width: 100%;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .bottom {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    padding: 20px 14px;
  }

  .dashboard {
    width: 100%;
    min-height: 720px;
    height: auto;
    border-radius: 28px;
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    left: -270px;
    top: 20px;
    bottom: 20px;
    width: 250px;
    z-index: 100;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(30, 50, 90, 0.25);
    transition: 0.35s ease;
    overflow-y: auto;
  }

  .sidebar.show {
    left: 14px;
  }

  .overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 45, 0.18);
    z-index: 90;
  }

  header {
    height: 76px;
    padding: 0 22px;
  }

  .profile {
    display: none;
  }

  .content {
    padding: 26px 22px 80px;
  }

  .content h1 {
    font-size: 30px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .card {
    min-height: 145px;
  }

  .bottom {
    grid-template-columns: 1fr;
  }

  .chart-box {
    min-height: 340px;
    padding: 22px;
  }

  .orders-box {
    padding: 22px;
  }

  canvas {
    height: 230px !important;
  }
}

/* Small Mobile */
@media (max-width: 420px) {
  .content {
    padding: 24px 18px 80px;
  }

  .box-head {
    gap: 12px;
  }

  .box-head button {
    padding: 9px 12px;
    font-size: 12px;
  }

  .card h2 {
    font-size: 26px;
  }
}</code></pre>
<p><strong>JS</strong></p>
<pre class="ei-lighter-js"><code class="language-javascript">const ctx = document.getElementById('salesChart');

new Chart(ctx, {
  type: 'line',
  data: {
    labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    datasets: [{
      data: [1800, 3000, 4100, 3500, 4600, 5900, 5400],
      borderColor: '#1677ff',
      backgroundColor: 'rgba(22, 119, 255, 0.12)',
      fill: true,
      tension: 0.35,
      borderWidth: 3,
      pointRadius: 4,
      pointBackgroundColor: '#ffffff',
      pointBorderColor: '#1677ff',
      pointBorderWidth: 2
    }]
  },
  options: {
    responsive: true,
    maintainAspectRatio: false,
    plugins: {
      legend: {
        display: false
      }
    },
    scales: {
      y: {
        beginAtZero: true,
        max: 8000,
        ticks: {
          callback: function(value) {
            return value === 0 ? '0' : value / 1000 + 'K';
          },
          color: '#6d7585'
        },
        grid: {
          color: '#edf1f7'
        },
        border: {
          display: false
        }
      },
      x: {
        ticks: {
          color: '#6d7585'
        },
        grid: {
          display: false
        },
        border: {
          display: false
        }
      }
    }
  }
});

const sidebar = document.getElementById('sidebar');
const menuBtn = document.getElementById('menuBtn');
const overlay = document.getElementById('overlay');

menuBtn.addEventListener('click', () =&gt; {
  sidebar.classList.add('show');
  overlay.classList.add('show');
});

overlay.addEventListener('click', () =&gt; {
  sidebar.classList.remove('show');
  overlay.classList.remove('show');
});</code></pre>
<p>Sidebar ini cocok banget untuk pemula. Selain ringan, tampilannya juga bersih dan fokus pada fungsi utama. Jadi, kamu bisa langsung pakai tanpa banyak penyesuaian.</p>
<hr />
<h3 id="2-sidebar-toggle-hide-show">2. Sidebar Toggle (Hide &amp; Show)</h3>
<p><img decoding="async" class="alignnone wp-image-2491 size-full" src="https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Toggle-Hide-Show.webp" alt="" width="700" height="525" srcset="https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Toggle-Hide-Show.webp 700w, https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Toggle-Hide-Show-300x225.webp 300w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<h4 id="full-code-sidebar-toggle-hide-show">Full Code &#8211; Sidebar Toggle (Hide &amp; Show)</h4>
<p><strong>HTML</strong></p>
<pre class="ei-lighter-js"><code class="language-html">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  &lt;title&gt;Sidebar Toggle&lt;/title&gt;
  &lt;link rel="stylesheet" href="style.css" /&gt;
  &lt;link href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css" rel="stylesheet"&gt;
&lt;/head&gt;
&lt;body&gt;

  &lt;section class="hero"&gt;
    &lt;h1&gt;SIDEBAR TOGGLE&lt;/h1&gt;
    &lt;h2&gt;&lt;span&gt;HIDE&lt;/span&gt; &amp; &lt;b&gt;SHOW&lt;/b&gt;&lt;/h2&gt;

    &lt;div class="buttons"&gt;
      &lt;button onclick="showSidebar()" class="show-btn"&gt;SHOW SIDEBAR&lt;/button&gt;
      &lt;button onclick="hideSidebar()" class="hide-btn"&gt;HIDE SIDEBAR&lt;/button&gt;
    &lt;/div&gt;

    &lt;div class="demo-wrapper"&gt;
      &lt;div class="dashboard"&gt;

        &lt;aside class="sidebar" id="sidebar"&gt;
          &lt;div class="brand"&gt;
            &lt;i class='bx bx-home-alt-2'&gt;&lt;/i&gt;
            &lt;span&gt;Minimo&lt;/span&gt;
          &lt;/div&gt;

          &lt;nav&gt;
            &lt;a class="active"&gt;&lt;i class='bx bx-home-alt'&gt;&lt;/i&gt;&lt;span&gt;Dashboard&lt;/span&gt;&lt;/a&gt;
            &lt;a&gt;&lt;i class='bx bx-bar-chart-alt-2'&gt;&lt;/i&gt;&lt;span&gt;Analytics&lt;/span&gt;&lt;/a&gt;
            &lt;a&gt;&lt;i class='bx bx-shopping-bag'&gt;&lt;/i&gt;&lt;span&gt;Products&lt;/span&gt;&lt;/a&gt;
            &lt;a&gt;&lt;i class='bx bx-cart'&gt;&lt;/i&gt;&lt;span&gt;Orders&lt;/span&gt;&lt;/a&gt;
            &lt;a&gt;&lt;i class='bx bx-user'&gt;&lt;/i&gt;&lt;span&gt;Customers&lt;/span&gt;&lt;/a&gt;
            &lt;a&gt;&lt;i class='bx bx-cog'&gt;&lt;/i&gt;&lt;span&gt;Settings&lt;/span&gt;&lt;/a&gt;
            &lt;a&gt;&lt;i class='bx bx-log-out'&gt;&lt;/i&gt;&lt;span&gt;Logout&lt;/span&gt;&lt;/a&gt;
          &lt;/nav&gt;
        &lt;/aside&gt;

        &lt;main class="main"&gt;
          &lt;header&gt;
            &lt;button class="menu-btn" onclick="toggleSidebar()"&gt;
              &lt;i class='bx bx-menu'&gt;&lt;/i&gt;
            &lt;/button&gt;

            &lt;div class="profile"&gt;
              &lt;i class='bx bx-user'&gt;&lt;/i&gt;
            &lt;/div&gt;
          &lt;/header&gt;

          &lt;section class="content"&gt;
            &lt;h3&gt;Dashboard&lt;/h3&gt;
            &lt;p&gt;Welcome back, Admin!&lt;/p&gt;

            &lt;div class="cards"&gt;
              &lt;div class="card"&gt;
                &lt;div class="top-card"&gt;
                  &lt;div class="icon blue"&gt;&lt;i class='bx bx-group'&gt;&lt;/i&gt;&lt;/div&gt;
                  &lt;span&gt;Total Users&lt;/span&gt;
                &lt;/div&gt;
                &lt;h4&gt;1,250&lt;/h4&gt;
                &lt;b&gt;+12%&lt;/b&gt;
              &lt;/div&gt;

              &lt;div class="card"&gt;
                &lt;div class="top-card"&gt;
                  &lt;div class="icon green"&gt;&lt;i class='bx bx-cart'&gt;&lt;/i&gt;&lt;/div&gt;
                  &lt;span&gt;Orders&lt;/span&gt;
                &lt;/div&gt;
                &lt;h4&gt;320&lt;/h4&gt;
                &lt;b&gt;+8%&lt;/b&gt;
              &lt;/div&gt;

              &lt;div class="card"&gt;
                &lt;div class="top-card"&gt;
                  &lt;div class="icon purple"&gt;&lt;i class='bx bx-dollar-circle'&gt;&lt;/i&gt;&lt;/div&gt;
                  &lt;span&gt;Revenue&lt;/span&gt;
                &lt;/div&gt;
                &lt;h4&gt;$12,850&lt;/h4&gt;
                &lt;b&gt;+15%&lt;/b&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class="bottom"&gt;
              &lt;div class="chart-box"&gt;
                &lt;h4&gt;Sales Overview&lt;/h4&gt;
                &lt;canvas id="salesChart"&gt;&lt;/canvas&gt;
              &lt;/div&gt;

              &lt;div class="orders-box"&gt;
                &lt;h4&gt;Recent Orders&lt;/h4&gt;

                &lt;div class="order"&gt;
                  &lt;div class="order-icon blue"&gt;&lt;i class='bx bx-user'&gt;&lt;/i&gt;&lt;/div&gt;
                  &lt;div&gt;
                    &lt;h5&gt;#ORD-001&lt;/h5&gt;
                    &lt;p&gt;John Doe&lt;/p&gt;
                  &lt;/div&gt;
                &lt;/div&gt;

                &lt;div class="order"&gt;
                  &lt;div class="order-icon green"&gt;&lt;i class='bx bx-receipt'&gt;&lt;/i&gt;&lt;/div&gt;
                  &lt;div&gt;
                    &lt;h5&gt;#ORD-002&lt;/h5&gt;
                    &lt;p&gt;Jane Smith&lt;/p&gt;
                  &lt;/div&gt;
                &lt;/div&gt;

                &lt;div class="order"&gt;
                  &lt;div class="order-icon purple"&gt;&lt;i class='bx bx-shopping-bag'&gt;&lt;/i&gt;&lt;/div&gt;
                  &lt;div&gt;
                    &lt;h5&gt;#ORD-003&lt;/h5&gt;
                    &lt;p&gt;Michael Lee&lt;/p&gt;
                  &lt;/div&gt;
                &lt;/div&gt;

                &lt;div class="order"&gt;
                  &lt;div class="order-icon yellow"&gt;&lt;i class='bx bx-package'&gt;&lt;/i&gt;&lt;/div&gt;
                  &lt;div&gt;
                    &lt;h5&gt;#ORD-004&lt;/h5&gt;
                    &lt;p&gt;Sarah Wilson&lt;/p&gt;
                  &lt;/div&gt;
                &lt;/div&gt;

                &lt;div class="order"&gt;
                  &lt;div class="order-icon pink"&gt;&lt;i class='bx bx-envelope'&gt;&lt;/i&gt;&lt;/div&gt;
                  &lt;div&gt;
                    &lt;h5&gt;#ORD-005&lt;/h5&gt;
                    &lt;p&gt;David Brown&lt;/p&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/section&gt;
        &lt;/main&gt;

      &lt;/div&gt;

      &lt;button class="circle-toggle" onclick="toggleSidebar()"&gt;
        &lt;i class='bx bx-transfer-alt'&gt;&lt;/i&gt;
      &lt;/button&gt;
    &lt;/div&gt;

    &lt;div class="floating-info"&gt;
      &lt;div class="floating-icon" onclick="toggleSidebar()"&gt;
        &lt;i class='bx bx-menu'&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;h4&gt;Click to Toggle Sidebar&lt;/h4&gt;
        &lt;p&gt;Hide or Show Easily&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/section&gt;

  &lt;script src="https://cdn.jsdelivr.net/npm/chart.js"&gt;&lt;/script&gt;
  &lt;script src="script.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<p><strong>CSS</strong></p>
<pre class="ei-lighter-js"><code class="language-css">@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&amp;display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  background: linear-gradient(135deg, #f7fbff, #eef6ff);
  color: #17233c;
}

.hero {
  width: 100%;
  min-height: 100vh;
  padding: 35px 35px 70px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(44px, 6vw, 78px);
  font-weight: 800;
  letter-spacing: 2px;
  color: #101b2e;
  text-shadow: 0 8px 18px rgba(20, 35, 60, 0.12);
}

.hero h2 {
  font-size: clamp(28px, 3.5vw, 46px);
  margin-top: 5px;
  font-weight: 800;
}

.hero h2 span {
  color: #ff5b54;
}

.hero h2 b {
  color: #25b86a;
}

.buttons {
  width: 78%;
  max-width: 1000px;
  margin: 30px auto 18px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.buttons button {
  border: none;
  color: #fff;
  padding: 14px 34px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(50, 100, 220, 0.28);
}

.show-btn {
  background: linear-gradient(135deg, #2f8bff, #235dff);
}

.hide-btn {
  background: linear-gradient(135deg, #7e55ff, #6338df);
}

.demo-wrapper {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  position: relative;
}

.dashboard {
  width: 100%;
  min-height: 640px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 22px;
  box-shadow: 0 28px 65px rgba(35, 67, 120, 0.24);
  display: flex;
  overflow: hidden;
  text-align: left;
}

.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0e1b2e, #081524);
  padding: 30px 22px;
  flex-shrink: 0;
  transition: width 0.35s ease, padding 0.35s ease;
}

.sidebar.hide {
  width: 74px;
  padding: 22px 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 34px;
  white-space: nowrap;
}

.brand i {
  color: #297cff;
  font-size: 30px;
}

.sidebar.hide .brand span,
.sidebar.hide nav a span {
  display: none;
}

.sidebar.hide .brand,
.sidebar.hide nav a {
  justify-content: center;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

nav a {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-radius: 9px;
  color: #d7dde8;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

nav a i {
  font-size: 23px;
}

nav a.active,
nav a:hover {
  background: linear-gradient(135deg, #338cff, #245cff);
  color: #fff;
}

.main {
  flex: 1;
  min-width: 0;
  background: #fff;
}

header {
  height: 68px;
  border-bottom: 1px solid #edf1f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
}

.menu-btn {
  border: none;
  background: transparent;
  color: #7a8aa0;
  font-size: 28px;
  cursor: pointer;
}

.profile {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eef2f8;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #8c98aa;
  font-size: 24px;
}

.content {
  padding: 26px;
}

.content h3 {
  font-size: 28px;
  margin-bottom: 8px;
}

.content &gt; p {
  color: #6d7585;
  font-size: 15px;
  margin-bottom: 25px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 25px;
}

.card {
  min-height: 115px;
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 14px;
  padding: 20px 16px;
  box-shadow: 0 12px 28px rgba(80, 105, 145, 0.1);
  position: relative;
}

.top-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
}

.card span {
  color: #677184;
  font-size: 13px;
  font-weight: 500;
}

.card h4 {
  font-size: 24px;
  margin-top: 22px;
}

.card b {
  position: absolute;
  right: 18px;
  bottom: 25px;
  color: #23bf63;
  font-size: 13px;
}

.blue {
  background: #eaf3ff;
  color: #1677ff;
}

.green {
  background: #e9faef;
  color: #22b85f;
}

.purple {
  background: #f0ebff;
  color: #715cff;
}

.yellow {
  background: #fff6dd;
  color: #f6a800;
}

.pink {
  background: #ffe8f1;
  color: #ff4e8a;
}

.bottom {
  display: grid;
  grid-template-columns: 1.7fr 0.8fr;
  gap: 18px;
}

.chart-box,
.orders-box {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #edf1f7;
  box-shadow: 0 12px 28px rgba(80, 105, 145, 0.1);
  padding: 22px;
}

.chart-box {
  min-height: 300px;
}

.chart-box h4,
.orders-box h4 {
  font-size: 16px;
  margin-bottom: 18px;
}

canvas {
  width: 100% !important;
  height: 230px !important;
}

.order {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.order-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.order h5 {
  font-size: 12px;
}

.order p {
  font-size: 11px;
  color: #70798a;
}


.floating-info {
  margin: -15px auto 0;
  width: 360px;
  min-height: 96px;
  background: #fff;
  border-radius: 50px;
  box-shadow: 0 18px 45px rgba(50, 80, 130, 0.2);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 28px 12px 12px;
  text-align: left;
  position: relative;
  z-index: 3;
}

.floating-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2e8bff, #235dff);
  color: #fff;
  font-size: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(35, 93, 255, 0.28);
}

.floating-info h4 {
  font-size: 18px;
  margin-bottom: 5px;
}

.floating-info p {
  font-size: 16px;
  color: #626d7e;
}

/* Tablet */
@media (max-width: 1024px) {
  .buttons {
    width: 100%;
  }

  .dashboard {
    min-height: auto;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .bottom {
    grid-template-columns: 1fr;
  }

  .circle-toggle {
    display: none;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .hero {
    padding: 30px 16px 60px;
  }

  .buttons {
    flex-direction: column;
    align-items: center;
  }

  .buttons button {
    width: 230px;
  }

  .dashboard {
    border-radius: 20px;
  }

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 240px;
    z-index: 99;
    border-radius: 0 22px 22px 0;
  }

  .sidebar.hide {
    width: 240px;
    padding: 30px 22px;
    left: -260px;
  }

  .sidebar.show-mobile {
    left: 0;
  }

  .sidebar.show-mobile span {
    display: inline;
  }

  .sidebar.show-mobile .brand,
  .sidebar.show-mobile nav a {
    justify-content: flex-start;
  }

  .main {
    width: 100%;
  }

  .content {
    padding: 22px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .bottom {
    grid-template-columns: 1fr;
  }

  .orders-box {
    display: block;
  }

  .floating-info {
    width: 100%;
    max-width: 360px;
    margin-top: 25px;
  }
}</code></pre>
<p><strong>JS</strong></p>
<pre class="ei-lighter-js"><code class="language-javascript">const sidebar = document.getElementById("sidebar");

function isMobile() {
  return window.innerWidth &lt;= 768;
}

function showSidebar() {
  if (isMobile()) {
    sidebar.classList.add("show-mobile");
    sidebar.classList.remove("hide");
  } else {
    sidebar.classList.remove("hide");
  }
}

function hideSidebar() {
  if (isMobile()) {
    sidebar.classList.remove("show-mobile");
    sidebar.classList.add("hide");
  } else {
    sidebar.classList.add("hide");
  }
}

function toggleSidebar() {
  if (isMobile()) {
    sidebar.classList.toggle("show-mobile");
    sidebar.classList.remove("hide");
  } else {
    sidebar.classList.toggle("hide");
  }
}

window.addEventListener("resize", () =&gt; {
  if (!isMobile()) {
    sidebar.classList.remove("show-mobile");
  } else {
    sidebar.classList.add("hide");
  }
});

const ctx = document.getElementById("salesChart");

new Chart(ctx, {
  type: "line",
  data: {
    labels: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
    datasets: [{
      data: [1800, 3000, 4100, 3500, 4600, 5900, 5300],
      borderColor: "#1677ff",
      backgroundColor: "rgba(22, 119, 255, 0.12)",
      fill: true,
      tension: 0.35,
      borderWidth: 3,
      pointRadius: 4,
      pointBackgroundColor: "#ffffff",
      pointBorderColor: "#1677ff",
      pointBorderWidth: 2
    }]
  },
  options: {
    responsive: true,
    maintainAspectRatio: false,
    plugins: {
      legend: { display: false }
    },
    scales: {
      y: {
        beginAtZero: true,
        max: 8000,
        ticks: {
          callback: value =&gt; value === 0 ? "0" : value / 1000 + "K",
          color: "#6d7585"
        },
        grid: { color: "#edf1f7" },
        border: { display: false }
      },
      x: {
        ticks: { color: "#6d7585" },
        grid: { display: false },
        border: { display: false }
      }
    }
  }
});</code></pre>
<p>Selanjutnya, ada sidebar dengan fitur buka-tutup. Dengan begitu, kamu bisa menghemat ruang, terutama di tampilan mobile. Biasanya, fitur ini dibuat dengan JavaScript sederhana.</p>
<hr />
<h3 id="3-sidebar-dashboard-modern">3. Sidebar Dashboard Modern</h3>
<p><img decoding="async" class="alignnone wp-image-2493 size-full" src="https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Dashboard-Modern.webp" alt="" width="700" height="525" srcset="https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Dashboard-Modern.webp 700w, https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Dashboard-Modern-300x225.webp 300w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<h4 id="full-code-sidebar-dashboard-modern">Full Code &#8211; Sidebar Dashboard Modern</h4>
<p><strong>HTML</strong></p>
<pre class="ei-lighter-js"><code class="language-html">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  &lt;title&gt;Minimo Dashboard&lt;/title&gt;
  &lt;link rel="stylesheet" href="style.css" /&gt;
  &lt;link href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css" rel="stylesheet"&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class="dashboard"&gt;
  &lt;aside class="sidebar"&gt;
    &lt;div class="logo"&gt;
      &lt;div class="logo-icon"&gt;&lt;/div&gt;
      &lt;h2&gt;Minimo&lt;/h2&gt;
    &lt;/div&gt;

    &lt;nav&gt;
      &lt;a class="active"&gt;&lt;i class='bx bx-home-alt'&gt;&lt;/i&gt;Dashboard&lt;/a&gt;
      &lt;a&gt;&lt;i class='bx bx-bar-chart-alt-2'&gt;&lt;/i&gt;Analytics&lt;/a&gt;
      &lt;a&gt;&lt;i class='bx bx-briefcase'&gt;&lt;/i&gt;Products&lt;/a&gt;
      &lt;a&gt;&lt;i class='bx bx-cart'&gt;&lt;/i&gt;Orders&lt;/a&gt;
      &lt;a&gt;&lt;i class='bx bx-user'&gt;&lt;/i&gt;Customers&lt;/a&gt;
      &lt;a&gt;&lt;i class='bx bx-badge-check'&gt;&lt;/i&gt;Reports&lt;/a&gt;
      &lt;a&gt;&lt;i class='bx bx-cog'&gt;&lt;/i&gt;Settings&lt;/a&gt;
    &lt;/nav&gt;

    &lt;div class="logout"&gt;
      &lt;i class='bx bx-power-off'&gt;&lt;/i&gt;
      Logout
    &lt;/div&gt;

    &lt;div class="upgrade"&gt;
      &lt;h3&gt;👑 Upgrade to Pro&lt;/h3&gt;
      &lt;p&gt;Unlock all features&lt;/p&gt;
      &lt;button&gt;Upgrade Now&lt;/button&gt;
    &lt;/div&gt;
  &lt;/aside&gt;

  &lt;main class="main"&gt;
    &lt;header&gt;
      &lt;button class="menu-btn" id="menuBtn"&gt;
        &lt;i class='bx bx-menu'&gt;&lt;/i&gt;
      &lt;/button&gt;

      &lt;div class="header-right"&gt;
        &lt;div class="search"&gt;
          &lt;input type="text" placeholder="Search..." /&gt;
          &lt;i class='bx bx-search'&gt;&lt;/i&gt;
        &lt;/div&gt;

        &lt;div class="bell"&gt;
          &lt;i class='bx bx-bell'&gt;&lt;/i&gt;
          &lt;span&gt;3&lt;/span&gt;
        &lt;/div&gt;

        &lt;img class="avatar" src="https://randomuser.me/api/portraits/men/32.jpg" alt="Profile"&gt;
      &lt;/div&gt;
    &lt;/header&gt;

    &lt;section class="content"&gt;
      &lt;h1&gt;Dashboard&lt;/h1&gt;
      &lt;p&gt;Welcome back, Admin! 👋&lt;/p&gt;

      &lt;div class="stats"&gt;
        &lt;div class="stat-card"&gt;
          &lt;div class="stat-top"&gt;
            &lt;div class="icon purple"&gt;&lt;i class='bx bx-group'&gt;&lt;/i&gt;&lt;/div&gt;
            &lt;div&gt;
              &lt;span&gt;Total Users&lt;/span&gt;
              &lt;h2&gt;2,543&lt;/h2&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="mini"&gt;
            &lt;b&gt;↑ 12.5%&lt;/b&gt;
            &lt;canvas id="miniUsers"&gt;&lt;/canvas&gt;
          &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class="stat-card"&gt;
          &lt;div class="stat-top"&gt;
            &lt;div class="icon green"&gt;&lt;i class='bx bx-cart'&gt;&lt;/i&gt;&lt;/div&gt;
            &lt;div&gt;
              &lt;span&gt;Orders&lt;/span&gt;
              &lt;h2&gt;1,320&lt;/h2&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="mini"&gt;
            &lt;b&gt;↑ 8.2%&lt;/b&gt;
            &lt;canvas id="miniOrders"&gt;&lt;/canvas&gt;
          &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class="stat-card"&gt;
          &lt;div class="stat-top"&gt;
            &lt;div class="icon blue"&gt;&lt;i class='bx bx-dollar-circle'&gt;&lt;/i&gt;&lt;/div&gt;
            &lt;div&gt;
              &lt;span&gt;Revenue&lt;/span&gt;
              &lt;h2&gt;$24,780&lt;/h2&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="mini"&gt;
            &lt;b&gt;↑ 15.3%&lt;/b&gt;
            &lt;canvas id="miniRevenue"&gt;&lt;/canvas&gt;
          &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class="stat-card"&gt;
          &lt;div class="stat-top"&gt;
            &lt;div class="icon orange"&gt;&lt;i class='bx bx-package'&gt;&lt;/i&gt;&lt;/div&gt;
            &lt;div&gt;
              &lt;span&gt;Products&lt;/span&gt;
              &lt;h2&gt;865&lt;/h2&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="mini"&gt;
            &lt;b&gt;↑ 6.7%&lt;/b&gt;
            &lt;canvas id="miniProducts"&gt;&lt;/canvas&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="middle"&gt;
        &lt;div class="chart-card"&gt;
          &lt;div class="card-head"&gt;
            &lt;h3&gt;Sales Overview&lt;/h3&gt;
            &lt;button&gt;This Week &lt;i class='bx bx-chevron-down'&gt;&lt;/i&gt;&lt;/button&gt;
          &lt;/div&gt;
          &lt;canvas id="salesChart"&gt;&lt;/canvas&gt;
        &lt;/div&gt;

        &lt;div class="orders-card"&gt;
          &lt;div class="card-head"&gt;
            &lt;h3&gt;Recent Orders&lt;/h3&gt;
            &lt;button&gt;View All&lt;/button&gt;
          &lt;/div&gt;

          &lt;div class="order"&gt;
            &lt;img src="https://randomuser.me/api/portraits/men/11.jpg"&gt;
            &lt;div&gt;
              &lt;h4&gt;#ORD-001&lt;/h4&gt;
              &lt;p&gt;John Doe&lt;/p&gt;
            &lt;/div&gt;
            &lt;div class="price"&gt;
              &lt;h5&gt;$250.00&lt;/h5&gt;
              &lt;span class="completed"&gt;Completed&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;

          &lt;div class="order"&gt;
            &lt;img src="https://randomuser.me/api/portraits/women/12.jpg"&gt;
            &lt;div&gt;
              &lt;h4&gt;#ORD-002&lt;/h4&gt;
              &lt;p&gt;Jane Smith&lt;/p&gt;
            &lt;/div&gt;
            &lt;div class="price"&gt;
              &lt;h5&gt;$150.00&lt;/h5&gt;
              &lt;span class="pending"&gt;Pending&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;

          &lt;div class="order"&gt;
            &lt;img src="https://randomuser.me/api/portraits/men/13.jpg"&gt;
            &lt;div&gt;
              &lt;h4&gt;#ORD-003&lt;/h4&gt;
              &lt;p&gt;Michael Lee&lt;/p&gt;
            &lt;/div&gt;
            &lt;div class="price"&gt;
              &lt;h5&gt;$320.00&lt;/h5&gt;
              &lt;span class="completed"&gt;Completed&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;

          &lt;div class="order"&gt;
            &lt;img src="https://randomuser.me/api/portraits/women/14.jpg"&gt;
            &lt;div&gt;
              &lt;h4&gt;#ORD-004&lt;/h4&gt;
              &lt;p&gt;Sarah Wilson&lt;/p&gt;
            &lt;/div&gt;
            &lt;div class="price"&gt;
              &lt;h5&gt;$180.00&lt;/h5&gt;
              &lt;span class="processing"&gt;Processing&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="products-card"&gt;
        &lt;div class="card-head"&gt;
          &lt;h3&gt;Top Products&lt;/h3&gt;
          &lt;button&gt;View All&lt;/button&gt;
        &lt;/div&gt;

        &lt;div class="products"&gt;
          &lt;div class="product"&gt;
            &lt;img src="https://pngimg.com/uploads/headphones/headphones_PNG101929.png"&gt;
            &lt;div&gt;
              &lt;h4&gt;Wireless Headphones&lt;/h4&gt;
              &lt;p&gt;$59.99&lt;/p&gt;
              &lt;div class="bar"&gt;&lt;span style="width:70%"&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;small&gt;320 sold&lt;/small&gt;
          &lt;/div&gt;

          &lt;div class="product"&gt;
            &lt;img src="https://pngimg.com/uploads/watches/watches_PNG101455.png"&gt;
            &lt;div&gt;
              &lt;h4&gt;Smart Watch&lt;/h4&gt;
              &lt;p&gt;$89.99&lt;/p&gt;
              &lt;div class="bar"&gt;&lt;span style="width:65%"&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;small&gt;280 sold&lt;/small&gt;
          &lt;/div&gt;

          &lt;div class="product"&gt;
            &lt;img src="https://pngimg.com/uploads/backpack/backpack_PNG6353.png"&gt;
            &lt;div&gt;
              &lt;h4&gt;Backpack&lt;/h4&gt;
              &lt;p&gt;$49.99&lt;/p&gt;
              &lt;div class="bar"&gt;&lt;span style="width:55%"&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;small&gt;210 sold&lt;/small&gt;
          &lt;/div&gt;

          &lt;div class="product"&gt;
            &lt;img src="https://pngimg.com/uploads/photo_camera/photo_camera_PNG101605.png"&gt;
            &lt;div&gt;
              &lt;h4&gt;Camera&lt;/h4&gt;
              &lt;p&gt;$699.99&lt;/p&gt;
              &lt;div class="bar"&gt;&lt;span style="width:40%"&gt;&lt;/span&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;small&gt;185 sold&lt;/small&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/section&gt;
  &lt;/main&gt;
&lt;/div&gt;

&lt;script src="https://cdn.jsdelivr.net/npm/chart.js"&gt;&lt;/script&gt;
&lt;script src="script.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<p><strong>CSS</strong></p>
<pre class="ei-lighter-js"><code class="language-css">@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&amp;display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  background: linear-gradient(135deg, #eef3ff, #f9fbff);
  color: #111a2e;
  padding: 40px;
}

.dashboard {
  max-width: 1380px;
  min-height: 850px;
  margin: auto;
  background: #fff;
  display: flex;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(77, 90, 180, 0.22);
}

.sidebar {
  width: 255px;
  background: linear-gradient(180deg, #08142a, #0a1c37);
  color: #fff;
  padding: 34px 26px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 42px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #3d7dff, #6b5cff);
  clip-path: polygon(50% 0%, 92% 25%, 92% 75%, 50% 100%, 8% 75%, 8% 25%);
}

.logo h2 {
  font-size: 22px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

nav a,
.logout {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  color: #d6deee;
  border-radius: 10px;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}

nav a i,
.logout i {
  font-size: 24px;
}

nav a.active,
nav a:hover {
  background: linear-gradient(135deg, #405cff, #5949ff);
  color: #fff;
}

.logout {
  margin-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.18);
  border-radius: 0;
  padding-top: 35px;
}

.upgrade {
  margin-top: 80px;
  background: linear-gradient(135deg, #5247ff, #635cff);
  border-radius: 12px;
  padding: 22px 18px;
}

.upgrade h3 {
  font-size: 17px;
  margin-bottom: 18px;
}

.upgrade p {
  color: #e4e8ff;
  margin-bottom: 22px;
}

.upgrade button {
  width: 100%;
  border: none;
  background: rgba(255,255,255,0.25);
  color: #fff;
  padding: 14px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

.main {
  flex: 1;
  min-width: 0;
  background: #fafcff;
}

header {
  height: 88px;
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid #e9edf5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 34px;
}

.menu-btn {
  border: none;
  background: transparent;
  color: #758298;
  font-size: 34px;
  cursor: pointer;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.search {
  width: 215px;
  height: 46px;
  border: 1px solid #e2e7f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #fbfcff;
}

.search input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 14px;
}

.search i {
  font-size: 22px;
  color: #7a86a0;
}

.bell {
  position: relative;
  font-size: 28px;
  color: #6d7891;
}

.bell span {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #4f5cff;
  color: #fff;
  font-size: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #4f5cff;
}

.content {
  padding: 34px 44px 40px;
}

.content h1 {
  font-size: 36px;
  margin-bottom: 8px;
}

.content &gt; p {
  color: #68748b;
  font-size: 17px;
  margin-bottom: 30px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
  margin-bottom: 26px;
}

.stat-card,
.chart-card,
.orders-card,
.products-card {
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(87, 105, 150, 0.09);
}

.stat-card {
  min-height: 180px;
  padding: 24px 20px;
}

.stat-top {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  font-size: 30px;
}

.purple {
  background: #f0eaff;
  color: #6a48ff;
}

.green {
  background: #e8f9ef;
  color: #21ad5b;
}

.blue {
  background: #eaf1ff;
  color: #3677ff;
}

.orange {
  background: #fff0e3;
  color: #ff7a1a;
}

.stat-card span {
  color: #6e7890;
  font-size: 15px;
  font-weight: 600;
}

.stat-card h2 {
  font-size: 30px;
  margin-top: 10px;
}

.mini {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 22px;
}

.mini b {
  color: #23b865;
  font-size: 13px;
}

.mini canvas {
  width: 130px !important;
  height: 45px !important;
}

.middle {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 24px;
  margin-bottom: 18px;
}

.chart-card {
  min-height: 355px;
  padding: 24px;
}

.orders-card {
  padding: 24px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.card-head h3 {
  font-size: 18px;
}

.card-head button {
  border: 1px solid #e5e9f1;
  background: #fff;
  color: #4f7cff;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
}

#salesChart {
  width: 100% !important;
  height: 260px !important;
}

.order {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.order img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.order h4,
.price h5 {
  font-size: 14px;
}

.order p {
  font-size: 12px;
  color: #758097;
  margin-top: 5px;
}

.price {
  text-align: right;
}

.price span {
  font-size: 12px;
  font-weight: 600;
}

.completed {
  color: #26b35d;
}

.pending {
  color: #f0a000;
}

.processing {
  color: #2878ff;
}

.products-card {
  padding: 20px 24px;
}

.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.product {
  border: 1px solid #edf1f7;
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
}

.product img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.product h4 {
  font-size: 13px;
  margin-bottom: 8px;
}

.product p {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.product small {
  align-self: end;
  color: #69758d;
  font-size: 11px;
}

.bar {
  width: 90px;
  height: 5px;
  background: #e9edf5;
  border-radius: 20px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: #5261ff;
  border-radius: 20px;
}

@media (max-width: 1100px) {
  body {
    padding: 20px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .middle {
    grid-template-columns: 1fr;
  }

  .products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    padding: 14px;
  }

  .dashboard {
    display: block;
    min-height: auto;
  }

  .sidebar {
    width: 100%;
    border-radius: 0;
  }

  header {
    padding: 0 20px;
  }

  .header-right {
    gap: 12px;
  }

  .search {
    display: none;
  }

  .content {
    padding: 28px 20px 40px;
  }

  .stats,
  .products {
    grid-template-columns: 1fr;
  }

  .product {
    grid-template-columns: 60px 1fr;
  }

  .product small {
    grid-column: 2;
  }
}</code></pre>
<p><strong>JS</strong></p>
<pre class="ei-lighter-js"><code class="language-javascript">function createMiniChart(id, color, data) {
  const ctx = document.getElementById(id);

  new Chart(ctx, {
    type: "line",
    data: {
      labels: ["1", "2", "3", "4", "5", "6", "7", "8"],
      datasets: [{
        data: data,
        borderColor: color,
        borderWidth: 3,
        tension: 0.45,
        pointRadius: 0,
        fill: false
      }]
    },
    options: {
      responsive: true,
      maintainAspectRatio: false,
      plugins: {
        legend: { display: false },
        tooltip: { enabled: false }
      },
      scales: {
        x: { display: false },
        y: { display: false }
      }
    }
  });
}

createMiniChart("miniUsers", "#6a48ff", [4, 5, 4, 5, 5, 7, 6, 8]);
createMiniChart("miniOrders", "#21ad5b", [3, 4, 6, 4, 5, 7, 5, 8]);
createMiniChart("miniRevenue", "#3677ff", [4, 5, 7, 6, 8, 5, 6, 7]);
createMiniChart("miniProducts", "#ff7a1a", [3, 5, 4, 7, 6, 8, 7, 9]);

const salesCtx = document.getElementById("salesChart");

new Chart(salesCtx, {
  type: "line",
  data: {
    labels: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
    datasets: [{
      data: [5000, 11500, 9000, 12500, 16500, 14000, 24000],
      borderColor: "#4d5cff",
      backgroundColor: "rgba(77, 92, 255, 0.12)",
      fill: true,
      tension: 0.25,
      borderWidth: 3,
      pointRadius: 4,
      pointBackgroundColor: "#fff",
      pointBorderColor: "#4d5cff",
      pointBorderWidth: 3
    }]
  },
  options: {
    responsive: true,
    maintainAspectRatio: false,
    plugins: {
      legend: { display: false }
    },
    scales: {
      y: {
        beginAtZero: true,
        max: 25000,
        ticks: {
          callback: value =&gt; value === 0 ? "$0" : "$" + value / 1000 + "k",
          color: "#69758d"
        },
        grid: {
          color: "#edf1f7"
        },
        border: {
          display: false
        }
      },
      x: {
        ticks: {
          color: "#69758d"
        },
        grid: {
          display: false
        },
        border: {
          display: false
        }
      }
    }
  }
});</code></pre>
<p>Kalau kamu bikin admin panel, tipe ini wajib dicoba. Biasanya sudah dilengkapi icon dan struktur menu yang rapi. Hasilnya, tampilan website terlihat lebih profesional.</p>
<hr />
<h3 id="4-sidebar-dengan-animasi-smooth">4. Sidebar dengan Animasi Smooth</h3>
<p><img decoding="async" class="alignnone wp-image-2494 size-full" src="https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-dengan-Animasi-Smooth.webp" alt="" width="700" height="525" srcset="https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-dengan-Animasi-Smooth.webp 700w, https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-dengan-Animasi-Smooth-300x225.webp 300w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<h4 id="full-coding-sidebar-animasi-smooth">FULL CODING &#8211; Sidebar Animasi Smooth</h4>
<p><strong>HTML</strong></p>
<pre class="ei-lighter-js"><code class="language-html">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  &lt;title&gt;Sidebar Animasi Smooth&lt;/title&gt;
  &lt;link rel="stylesheet" href="style.css" /&gt;
  &lt;link href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css" rel="stylesheet"&gt;
&lt;/head&gt;
&lt;body&gt;

  &lt;section class="hero"&gt;
    &lt;div class="title"&gt;
      &lt;h1&gt;SIDEBAR &lt;span&gt;ANIMASI SMOOTH&lt;/span&gt;&lt;/h1&gt;
      &lt;p&gt;Responsive • HTML • CSS • JavaScript&lt;/p&gt;
    &lt;/div&gt;

    &lt;div class="dashboard"&gt;
      &lt;aside class="sidebar" id="sidebar"&gt;
        &lt;div class="brand"&gt;
          &lt;div class="brand-icon"&gt;&lt;i class='bx bx-cube'&gt;&lt;/i&gt;&lt;/div&gt;
          &lt;h2&gt;Minimo&lt;/h2&gt;
        &lt;/div&gt;

        &lt;nav&gt;
          &lt;a class="active"&gt;&lt;i class='bx bxs-home'&gt;&lt;/i&gt;&lt;span&gt;Dashboard&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-bar-chart-alt-2'&gt;&lt;/i&gt;&lt;span&gt;Analytics&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-shopping-bag'&gt;&lt;/i&gt;&lt;span&gt;Products&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-cart'&gt;&lt;/i&gt;&lt;span&gt;Orders&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-user'&gt;&lt;/i&gt;&lt;span&gt;Customers&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-cog'&gt;&lt;/i&gt;&lt;span&gt;Settings&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-log-out'&gt;&lt;/i&gt;&lt;span&gt;Logout&lt;/span&gt;&lt;/a&gt;
        &lt;/nav&gt;
      &lt;/aside&gt;

      &lt;main class="main"&gt;
        &lt;header&gt;
          &lt;button class="toggle-btn" id="toggleBtn"&gt;
            &lt;i class='bx bx-menu'&gt;&lt;/i&gt;
          &lt;/button&gt;

          &lt;div class="profile"&gt;
            &lt;i class='bx bx-user'&gt;&lt;/i&gt;
          &lt;/div&gt;
        &lt;/header&gt;

        &lt;section class="content"&gt;
          &lt;h2&gt;Dashboard&lt;/h2&gt;
          &lt;p&gt;Welcome back, Admin!&lt;/p&gt;

          &lt;div class="cards"&gt;
            &lt;div class="card"&gt;
              &lt;div class="card-top"&gt;
                &lt;div class="icon blue"&gt;&lt;i class='bx bx-group'&gt;&lt;/i&gt;&lt;/div&gt;
                &lt;span&gt;Total Users&lt;/span&gt;
              &lt;/div&gt;
              &lt;h3&gt;1,250&lt;/h3&gt;
              &lt;b&gt;+12%&lt;/b&gt;
            &lt;/div&gt;

            &lt;div class="card"&gt;
              &lt;div class="card-top"&gt;
                &lt;div class="icon green"&gt;&lt;i class='bx bx-cart'&gt;&lt;/i&gt;&lt;/div&gt;
                &lt;span&gt;Orders&lt;/span&gt;
              &lt;/div&gt;
              &lt;h3&gt;320&lt;/h3&gt;
              &lt;b&gt;+8%&lt;/b&gt;
            &lt;/div&gt;

            &lt;div class="card"&gt;
              &lt;div class="card-top"&gt;
                &lt;div class="icon purple"&gt;&lt;i class='bx bx-dollar-circle'&gt;&lt;/i&gt;&lt;/div&gt;
                &lt;span&gt;Revenue&lt;/span&gt;
              &lt;/div&gt;
              &lt;h3&gt;$12,850&lt;/h3&gt;
              &lt;b&gt;+15%&lt;/b&gt;
            &lt;/div&gt;

            &lt;div class="card"&gt;
              &lt;div class="card-top"&gt;
                &lt;div class="icon orange"&gt;&lt;i class='bx bx-package'&gt;&lt;/i&gt;&lt;/div&gt;
                &lt;span&gt;Products&lt;/span&gt;
              &lt;/div&gt;
              &lt;h3&gt;58&lt;/h3&gt;
              &lt;b&gt;+7%&lt;/b&gt;
            &lt;/div&gt;
          &lt;/div&gt;

          &lt;div class="bottom"&gt;
            &lt;div class="chart-box"&gt;
              &lt;div class="box-head"&gt;
                &lt;h3&gt;Sales Overview&lt;/h3&gt;
                &lt;button&gt;This Week &lt;i class='bx bx-chevron-down'&gt;&lt;/i&gt;&lt;/button&gt;
              &lt;/div&gt;
              &lt;canvas id="salesChart"&gt;&lt;/canvas&gt;
            &lt;/div&gt;

            &lt;div class="orders-box"&gt;
              &lt;h3&gt;Recent Orders&lt;/h3&gt;

              &lt;div class="order"&gt;
                &lt;div class="order-icon blue"&gt;&lt;i class='bx bx-user'&gt;&lt;/i&gt;&lt;/div&gt;
                &lt;div&gt;
                  &lt;h4&gt;#ORD-001&lt;/h4&gt;
                  &lt;p&gt;John Doe&lt;/p&gt;
                &lt;/div&gt;
              &lt;/div&gt;

              &lt;div class="order"&gt;
                &lt;div class="order-icon green"&gt;&lt;i class='bx bx-receipt'&gt;&lt;/i&gt;&lt;/div&gt;
                &lt;div&gt;
                  &lt;h4&gt;#ORD-002&lt;/h4&gt;
                  &lt;p&gt;Jane Smith&lt;/p&gt;
                &lt;/div&gt;
              &lt;/div&gt;

              &lt;div class="order"&gt;
                &lt;div class="order-icon purple"&gt;&lt;i class='bx bx-shopping-bag'&gt;&lt;/i&gt;&lt;/div&gt;
                &lt;div&gt;
                  &lt;h4&gt;#ORD-003&lt;/h4&gt;
                  &lt;p&gt;Michael Lee&lt;/p&gt;
                &lt;/div&gt;
              &lt;/div&gt;

              &lt;div class="order"&gt;
                &lt;div class="order-icon orange"&gt;&lt;i class='bx bx-package'&gt;&lt;/i&gt;&lt;/div&gt;
                &lt;div&gt;
                  &lt;h4&gt;#ORD-004&lt;/h4&gt;
                  &lt;p&gt;Sarah Wilson&lt;/p&gt;
                &lt;/div&gt;
              &lt;/div&gt;

              &lt;div class="order"&gt;
                &lt;div class="order-icon pink"&gt;&lt;i class='bx bx-envelope'&gt;&lt;/i&gt;&lt;/div&gt;
                &lt;div&gt;
                  &lt;h4&gt;#ORD-005&lt;/h4&gt;
                  &lt;p&gt;David Brown&lt;/p&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/section&gt;
      &lt;/main&gt;
    &lt;/div&gt;

    &lt;div class="process"&gt;
      &lt;div class="mini-state"&gt;
        &lt;div class="mini-sidebar closed"&gt;
          &lt;i class='bx bx-menu'&gt;&lt;/i&gt;
        &lt;/div&gt;
        &lt;p&gt;Tertutup&lt;/p&gt;
      &lt;/div&gt;

      &lt;div class="arrow"&gt;➜&lt;/div&gt;

      &lt;div class="mini-state center"&gt;
        &lt;div class="mini-stack"&gt;
          &lt;div&gt;&lt;/div&gt;
          &lt;div&gt;&lt;/div&gt;
          &lt;div&gt;&lt;/div&gt;
        &lt;/div&gt;
        &lt;p&gt;Animasi Smooth&lt;/p&gt;
      &lt;/div&gt;

      &lt;div class="arrow"&gt;➜&lt;/div&gt;

      &lt;div class="mini-state"&gt;
        &lt;div class="mini-sidebar opened"&gt;
          &lt;span&gt;&lt;/span&gt;
          &lt;span&gt;&lt;/span&gt;
          &lt;span&gt;&lt;/span&gt;
          &lt;span&gt;&lt;/span&gt;
        &lt;/div&gt;
        &lt;p&gt;Terbuka&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/section&gt;

  &lt;script src="https://cdn.jsdelivr.net/npm/chart.js"&gt;&lt;/script&gt;
  &lt;script src="script.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<p><strong>CSS</strong></p>
<pre class="ei-lighter-js"><code class="language-css">@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&amp;display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  background: linear-gradient(135deg, #edf3ff, #f9fbff);
  color: #f4f7ff;
}

.hero {
  min-height: 100vh;
  padding: 28px 32px 45px;
}

.title {
  text-align: center;
  margin-bottom: 34px;
}

.title h1 {
  color: #101827;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: 1px;
}

.title h1 span {
  color: #fff;
  background: linear-gradient(135deg, #1682ff, #9b5cff);
  padding: 8px 16px;
  border-radius: 10px;
  display: inline-block;
}

.title p {
  margin-top: 14px;
  color: #737d91;
  font-size: 18px;
  font-weight: 500;
}

.dashboard {
  width: 100%;
  max-width: 1180px;
  min-height: 700px;
  margin: 0 auto;
  display: flex;
  background: linear-gradient(135deg, #0d141f, #111a27);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 28px 75px rgba(17, 32, 70, 0.35);
  position: relative;
}

.sidebar {
  width: 255px;
  background: linear-gradient(180deg, #171d27, #101722);
  padding: 34px 18px;
  flex-shrink: 0;
  border-radius: 16px;
  transition: width 0.45s cubic-bezier(.4, 0, .2, 1), padding 0.45s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
  z-index: 5;
}

.dashboard.collapsed .sidebar {
  width: 78px;
  padding: 34px 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 34px;
  white-space: nowrap;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #117bff, #3168ff);
  color: #fff;
  font-size: 24px;
  flex-shrink: 0;
}

.brand h2 {
  font-size: 20px;
  font-weight: 700;
  opacity: 1;
  transition: 0.3s ease;
}

.dashboard.collapsed .brand h2,
.dashboard.collapsed nav a span {
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

nav a {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 14px;
  color: #d7dee9;
  text-decoration: none;
  border-radius: 10px;
  font-size: 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.3s ease;
}

nav a i {
  min-width: 24px;
  font-size: 24px;
}

nav a.active,
nav a:hover {
  background: linear-gradient(135deg, #257cff, #1062ff);
  color: #fff;
}

.dashboard.collapsed nav a {
  justify-content: center;
  padding: 0;
}

.main {
  flex: 1;
  min-width: 0;
  background: linear-gradient(135deg, #101722, #0b1320);
  position: relative;
  overflow: hidden;
}

header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.toggle-btn {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(46, 139, 255, 0.45);
  background: rgba(22, 119, 255, 0.08);
  color: #39a0ff;
  font-size: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 0 22px rgba(22, 119, 255, 0.35);
  transition: 0.35s ease;
}

.toggle-btn:hover {
  transform: scale(1.08) rotate(90deg);
}

.profile {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #252e3b;
  color: #e8edf6;
  display: grid;
  place-items: center;
  font-size: 27px;
}

.content {
  padding: 28px 38px 45px;
}

.content h2 {
  font-size: 34px;
  margin-bottom: 8px;
}

.content &gt; p {
  color: #c2cad7;
  margin-bottom: 30px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.card,
.chart-box,
.orders-box {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
  backdrop-filter: blur(12px);
}

.card {
  min-height: 130px;
  padding: 20px 17px;
  position: relative;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 13px;
}

.icon,
.order-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 24px;
}

.card span {
  color: #d9dfeb;
  font-weight: 600;
  font-size: 14px;
}

.card h3 {
  font-size: 28px;
  margin-top: 24px;
}

.card b {
  position: absolute;
  right: 17px;
  bottom: 26px;
  color: #24db78;
  font-size: 13px;
}

.blue {
  background: rgba(24, 119, 255, 0.22);
  color: #1c7cff;
}

.green {
  background: rgba(35, 184, 99, 0.2);
  color: #21d36b;
}

.purple {
  background: rgba(113, 92, 255, 0.25);
  color: #8a75ff;
}

.orange {
  background: rgba(255, 122, 26, 0.22);
  color: #ff8b2c;
}

.pink {
  background: rgba(255, 78, 138, 0.22);
  color: #ff4e8a;
}

.bottom {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
}

.chart-box {
  min-height: 340px;
  padding: 24px;
}

.box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.box-head h3,
.orders-box h3 {
  font-size: 18px;
}

.box-head button {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #fff;
  padding: 9px 14px;
  border-radius: 8px;
}

#salesChart {
  width: 100% !important;
  height: 250px !important;
}

.orders-box {
  padding: 24px;
}

.order {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 17px;
}

.order h4 {
  font-size: 13px;
}

.order p {
  color: #b9c2d0;
  font-size: 12px;
  margin-top: 4px;
}

.process {
  width: min(1020px, 86%);
  min-height: 145px;
  margin: 34px auto 0;
  background: rgba(85, 101, 128, 0.28);
  border-radius: 34px;
  box-shadow: 0 18px 55px rgba(70, 90, 130, 0.24);
  display: grid;
  grid-template-columns: 1fr 0.5fr 1fr 0.5fr 1fr;
  align-items: center;
  padding: 18px 38px;
  color: #fff;
}

.mini-state {
  text-align: center;
}

.mini-state p {
  margin-top: 10px;
  font-weight: 700;
}

.mini-sidebar {
  margin: auto;
  background: linear-gradient(180deg, #171d27, #101722);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(10, 20, 40, 0.22);
}

.mini-sidebar.closed {
  width: 70px;
  height: 100px;
  display: grid;
  place-items: start center;
  padding-top: 14px;
}

.mini-sidebar.closed i {
  background: #252e3b;
  padding: 7px;
  border-radius: 50%;
}

.mini-sidebar.opened {
  width: 110px;
  height: 120px;
  padding: 16px 12px;
}

.mini-sidebar.opened span {
  display: block;
  height: 12px;
  margin-bottom: 12px;
  border-radius: 4px;
  background: #1d6fff;
}

.mini-sidebar.opened span:not(:first-child) {
  background: #414b5c;
}

.mini-stack {
  width: 120px;
  height: 95px;
  margin: auto;
  position: relative;
}

.mini-stack div {
  width: 70px;
  height: 90px;
  background: linear-gradient(180deg, #171d27, #101722);
  border-radius: 8px;
  position: absolute;
  top: 0;
}

.mini-stack div:nth-child(1) {
  left: 10px;
}

.mini-stack div:nth-child(2) {
  left: 30px;
  opacity: .9;
}

.mini-stack div:nth-child(3) {
  left: 50px;
  opacity: .8;
}

.arrow {
  color: #41b4ff;
  font-size: 42px;
  font-weight: 800;
  text-align: center;
}

/* Tablet */
@media (max-width: 1024px) {
  .dashboard {
    min-height: auto;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .bottom {
    grid-template-columns: 1fr;
  }

  .process {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .arrow {
    transform: rotate(90deg);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .hero {
    padding: 24px 14px 40px;
  }

  .dashboard {
    border-radius: 28px;
  }

  .sidebar {
    position: fixed;
    left: -270px;
    top: 80px;
    bottom: 40px;
    width: 250px;
    border-radius: 0 22px 22px 0;
    transition: left 0.45s cubic-bezier(.4, 0, .2, 1);
  }

  .dashboard.mobile-open .sidebar {
    left: 0;
  }

  .dashboard.collapsed .sidebar {
    width: 250px;
    padding: 34px 18px;
  }

  .dashboard.collapsed .brand h2,
  .dashboard.collapsed nav a span {
    opacity: 1;
    transform: translateX(0);
  }

  .dashboard.collapsed nav a {
    justify-content: flex-start;
    padding: 0 14px;
  }

  .main {
    width: 100%;
  }

  header {
    padding: 0 18px;
  }

  .content {
    padding: 24px 18px 35px;
  }

  .content h2 {
    font-size: 30px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .bottom {
    grid-template-columns: 1fr;
  }

  .process {
    width: 100%;
    padding: 24px;
  }
}</code></pre>
<p><strong>JS</strong></p>
<pre class="ei-lighter-js"><code class="language-javascript">const dashboard = document.querySelector(".dashboard");
const toggleBtn = document.getElementById("toggleBtn");

function isMobile() {
  return window.innerWidth &lt;= 768;
}

toggleBtn.addEventListener("click", () =&gt; {
  if (isMobile()) {
    dashboard.classList.toggle("mobile-open");
  } else {
    dashboard.classList.toggle("collapsed");
  }
});

window.addEventListener("resize", () =&gt; {
  if (!isMobile()) {
    dashboard.classList.remove("mobile-open");
  } else {
    dashboard.classList.remove("collapsed");
  }
});

const ctx = document.getElementById("salesChart");

new Chart(ctx, {
  type: "line",
  data: {
    labels: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
    datasets: [{
      data: [1800, 3000, 4100, 3500, 4600, 5900, 5300],
      borderColor: "#147cff",
      backgroundColor: "rgba(20, 124, 255, 0.22)",
      fill: true,
      tension: 0.35,
      borderWidth: 3,
      pointRadius: 4,
      pointBackgroundColor: "#0d1420",
      pointBorderColor: "#147cff",
      pointBorderWidth: 2
    }]
  },
  options: {
    responsive: true,
    maintainAspectRatio: false,
    plugins: {
      legend: { display: false }
    },
    scales: {
      y: {
        beginAtZero: true,
        max: 8000,
        ticks: {
          callback: value =&gt; value === 0 ? "0" : value / 1000 + "K",
          color: "#c5cedb"
        },
        grid: {
          color: "rgba(255,255,255,0.08)"
        },
        border: {
          display: false
        }
      },
      x: {
        ticks: {
          color: "#c5cedb"
        },
        grid: {
          display: false
        },
        border: {
          display: false
        }
      }
    }
  }
});</code></pre>
<p>Selain fungsional, tampilan juga penting. Oleh karena itu, sidebar dengan animasi smooth bisa jadi pilihan menarik. Transisi yang halus membuat interaksi terasa lebih hidup.</p>
<hr />
<h3 id="5-sidebar-mobile-friendly-off-canvas">5. Sidebar Mobile Friendly (Off-Canvas)</h3>
<p><img decoding="async" class="alignnone wp-image-2495 size-full" src="https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Mobile-Friendly-Off-Canvas.webp" alt="" width="700" height="525" srcset="https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Mobile-Friendly-Off-Canvas.webp 700w, https://farhanhidayat.com/wp-content/uploads/2026/04/Sidebar-Mobile-Friendly-Off-Canvas-300x225.webp 300w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<h4 id="full-code-sidebar-off-canvas-mobile-friendly">Full Code &#8211; Sidebar Off-Canvas (Mobile Friendly)</h4>
<p><strong>HTML</strong></p>
<pre class="ei-lighter-js"><code class="language-html">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  &lt;title&gt;Sidebar Mobile Friendly&lt;/title&gt;
  &lt;link rel="stylesheet" href="style.css" /&gt;
  &lt;link href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css" rel="stylesheet"&gt;
&lt;/head&gt;
&lt;body&gt;

  &lt;section class="hero"&gt;
    &lt;div class="title"&gt;
      &lt;i class='bx bx-mobile-alt'&gt;&lt;/i&gt;
      &lt;h1&gt;Sidebar Mobile Friendly (Off-Canvas)&lt;/h1&gt;
    &lt;/div&gt;

    &lt;div class="phone"&gt;
      &lt;div class="status"&gt;
        &lt;span&gt;9:41&lt;/span&gt;
        &lt;div&gt;
          &lt;i class='bx bxs-signal-4'&gt;&lt;/i&gt;
          &lt;i class='bx bx-wifi'&gt;&lt;/i&gt;
          &lt;i class='bx bxs-battery'&gt;&lt;/i&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;button class="menu-btn" id="openBtn"&gt;
        &lt;i class='bx bx-menu'&gt;&lt;/i&gt;
      &lt;/button&gt;

      &lt;div class="profile"&gt;
        &lt;img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Profile"&gt;
      &lt;/div&gt;

      &lt;main class="content"&gt;
        &lt;h2&gt;Dashboard&lt;/h2&gt;
        &lt;p&gt;Welcome back, Admin!&lt;/p&gt;

        &lt;div class="cards"&gt;
          &lt;div class="card"&gt;
            &lt;div class="top"&gt;
              &lt;div class="icon blue"&gt;&lt;i class='bx bx-group'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;span&gt;Total Users&lt;/span&gt;
            &lt;/div&gt;
            &lt;h3&gt;1,250&lt;/h3&gt;
            &lt;b&gt;+12%&lt;/b&gt;
          &lt;/div&gt;

          &lt;div class="card"&gt;
            &lt;div class="top"&gt;
              &lt;div class="icon green"&gt;&lt;i class='bx bx-cart'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;span&gt;Orders&lt;/span&gt;
            &lt;/div&gt;
            &lt;h3&gt;320&lt;/h3&gt;
            &lt;b&gt;+8%&lt;/b&gt;
          &lt;/div&gt;

          &lt;div class="card"&gt;
            &lt;div class="top"&gt;
              &lt;div class="icon purple"&gt;&lt;i class='bx bx-dollar-circle'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;span&gt;Revenue&lt;/span&gt;
            &lt;/div&gt;
            &lt;h3&gt;$12,850&lt;/h3&gt;
            &lt;b&gt;+15%&lt;/b&gt;
          &lt;/div&gt;

          &lt;div class="card"&gt;
            &lt;div class="top"&gt;
              &lt;div class="icon orange"&gt;&lt;i class='bx bx-package'&gt;&lt;/i&gt;&lt;/div&gt;
              &lt;span&gt;Products&lt;/span&gt;
            &lt;/div&gt;
            &lt;h3&gt;58&lt;/h3&gt;
            &lt;b&gt;+2%&lt;/b&gt;
          &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class="chart-card"&gt;
          &lt;div class="chart-head"&gt;
            &lt;h3&gt;Sales Overview&lt;/h3&gt;
            &lt;button&gt;This Week &lt;i class='bx bx-chevron-down'&gt;&lt;/i&gt;&lt;/button&gt;
          &lt;/div&gt;
          &lt;canvas id="salesChart"&gt;&lt;/canvas&gt;
        &lt;/div&gt;
      &lt;/main&gt;

      &lt;aside class="sidebar" id="sidebar"&gt;
        &lt;button class="close-btn" id="closeBtn"&gt;
          &lt;i class='bx bx-x'&gt;&lt;/i&gt;
        &lt;/button&gt;

        &lt;div class="brand"&gt;
          &lt;div class="brand-icon"&gt;M&lt;/div&gt;
          &lt;h2&gt;Minimo&lt;/h2&gt;
        &lt;/div&gt;

        &lt;nav&gt;
          &lt;a class="active"&gt;&lt;i class='bx bxs-home'&gt;&lt;/i&gt;&lt;span&gt;Dashboard&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-bar-chart-alt-2'&gt;&lt;/i&gt;&lt;span&gt;Analytics&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-shopping-bag'&gt;&lt;/i&gt;&lt;span&gt;Products&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-cart'&gt;&lt;/i&gt;&lt;span&gt;Orders&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-user'&gt;&lt;/i&gt;&lt;span&gt;Customers&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-cog'&gt;&lt;/i&gt;&lt;span&gt;Settings&lt;/span&gt;&lt;/a&gt;
          &lt;a&gt;&lt;i class='bx bx-log-out'&gt;&lt;/i&gt;&lt;span&gt;Logout&lt;/span&gt;&lt;/a&gt;
        &lt;/nav&gt;
      &lt;/aside&gt;

      &lt;div class="overlay" id="overlay"&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/section&gt;

  &lt;script src="https://cdn.jsdelivr.net/npm/chart.js"&gt;&lt;/script&gt;
  &lt;script src="script.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<p><strong>CSS</strong></p>
<pre class="ei-lighter-js"><code class="language-css">@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&amp;display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  background: linear-gradient(135deg, #eef4ff, #fbfdff);
  color: #111827;
}

.hero {
  min-height: 100vh;
  padding: 28px 16px 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title {
  background: #fff;
  padding: 18px 40px;
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(70, 90, 130, 0.13);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.title i {
  font-size: 36px;
  color: #2878ff;
}

.title h1 {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  color: #111827;
}

.phone {
  width: 430px;
  height: 860px;
  background: #fff;
  border: 10px solid #0b0f18;
  border-radius: 52px;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 24px 65px rgba(22, 35, 65, 0.32);
}

.phone::before {
  content: "";
  position: sticky;
  display: block;
  width: 130px;
  height: 32px;
  background: #05070c;
  border-radius: 0 0 18px 18px;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  z-index: 20;
}

.status {
  position: absolute;
  top: 26px;
  left: 42px;
  right: 32px;
  z-index: 25;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.status div {
  display: flex;
  gap: 5px;
  font-size: 18px;
}

.menu-btn {
  position: absolute;
  top: 78px;
  left: 28px;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  font-size: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(90, 105, 135, 0.16);
  z-index: 15;
}

.profile {
  position: absolute;
  top: 86px;
  right: 34px;
  width: 48px;
  height: 48px;
  z-index: 15;
}

.profile img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.content {
  padding: 120px 28px 40px;
}

.content h2 {
  font-size: 26px;
  margin-bottom: 8px;
}

.content &gt; p {
  color: #6c7588;
  margin-bottom: 26px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.card,
.chart-card {
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(80, 105, 145, 0.1);
}

.card {
  min-height: 145px;
  padding: 20px 16px;
  position: relative;
}

.top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
}

.card span {
  color: #69758a;
  font-weight: 600;
  font-size: 14px;
}

.card h3 {
  font-size: 28px;
  margin-top: 30px;
}

.card b {
  position: absolute;
  right: 17px;
  bottom: 28px;
  color: #23bf63;
  font-size: 13px;
}

.blue {
  background: #eaf3ff;
  color: #1677ff;
}

.green {
  background: #e9faef;
  color: #22b85f;
}

.purple {
  background: #f0ebff;
  color: #715cff;
}

.orange {
  background: #fff1e8;
  color: #ff7b22;
}

.chart-card {
  padding: 22px;
  min-height: 300px;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.chart-head h3 {
  font-size: 18px;
}

.chart-head button {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #69758a;
  padding: 10px 12px;
  border-radius: 8px;
}

#salesChart {
  width: 100% !important;
  height: 230px !important;
}

.sidebar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 310px;
  min-height: 100%;
  background: linear-gradient(180deg, #101b2a, #0b1523);
  color: #fff;
  padding: 100px 28px 30px;
  z-index: 40;
  transform: translateX(-105%);
  transition: transform 0.38s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 20px 0 45px rgba(20, 30, 55, 0.28);
}

.sidebar.show {
  transform: translateX(0);
}

.close-btn {
  position: absolute;
  top: 76px;
  right: 26px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 34px;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2a8cff, #365cff);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 26px;
}

.brand h2 {
  font-size: 28px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

nav a {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px;
  border-radius: 12px;
  color: #e6edf8;
  text-decoration: none;
  font-size: 20px;
  cursor: pointer;
}

nav a i {
  font-size: 30px;
}

nav a.active,
nav a:hover {
  background: rgba(55, 119, 255, 0.24);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(10, 18, 32, 0.42);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 520px) {
  .title {
    padding: 14px 18px;
  }

  .phone {
    width: 100%;
    max-width: 430px;
    height: 820px;
    border-width: 8px;
    border-radius: 44px;
  }

  .sidebar {
    width: 78%;
  }

  .cards {
    gap: 14px;
  }

  .card {
    padding: 18px 14px;
  }

  .card h3 {
    font-size: 24px;
  }
}</code></pre>
<p><strong>JS</strong></p>
<pre class="ei-lighter-js"><code class="language-javascript">const openBtn = document.getElementById("openBtn");
const closeBtn = document.getElementById("closeBtn");
const sidebar = document.getElementById("sidebar");
const overlay = document.getElementById("overlay");

function openSidebar() {
  sidebar.classList.add("show");
  overlay.classList.add("show");
}

function closeSidebar() {
  sidebar.classList.remove("show");
  overlay.classList.remove("show");
}

openBtn.addEventListener("click", openSidebar);
closeBtn.addEventListener("click", closeSidebar);
overlay.addEventListener("click", closeSidebar);

const ctx = document.getElementById("salesChart");

new Chart(ctx, {
  type: "line",
  data: {
    labels: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
    datasets: [{
      data: [1200, 2600, 3900, 3500, 4600, 5900, 5200],
      borderColor: "#1677ff",
      backgroundColor: "rgba(22, 119, 255, 0.14)",
      fill: true,
      tension: 0.35,
      borderWidth: 3,
      pointRadius: 4,
      pointBackgroundColor: "#fff",
      pointBorderColor: "#1677ff",
      pointBorderWidth: 2
    }]
  },
  options: {
    responsive: true,
    maintainAspectRatio: false,
    plugins: {
      legend: { display: false }
    },
    scales: {
      y: {
        beginAtZero: true,
        max: 8000,
        ticks: {
          callback: value =&gt; value === 0 ? "0" : value / 1000 + "K",
          color: "#6d7585"
        },
        grid: {
          color: "#edf1f7"
        },
        border: {
          display: false
        }
      },
      x: {
        ticks: {
          color: "#6d7585"
        },
        grid: {
          display: false
        },
        border: {
          display: false
        }
      }
    }
  }
});</code></pre>
<p>Terakhir, ada sidebar khusus mobile yang muncul dari samping. Desain ini sering digunakan karena lebih nyaman diakses dengan satu tangan. Selain itu, tampilannya juga terlihat modern.</p>
<hr />
<h2 id="cara-menggunakan-sidebar-menu-copy-paste">Cara Menggunakan Sidebar Menu (Copy Paste)</h2>
<p>Supaya lebih praktis, kamu bisa langsung menggunakan sidebar yang sudah ada. Pertama, cukup copy kode HTML, CSS, dan JavaScript. Setelah itu, tempelkan ke project kamu.</p>
<p>Selanjutnya, kamu bisa melakukan sedikit penyesuaian. Misalnya, mengganti warna agar sesuai dengan branding atau menambahkan icon supaya lebih menarik. Dengan cara ini, kamu bisa mendapatkan tampilan profesional tanpa harus mulai dari nol.</p>
<hr />
<h2 id="kesalahan-yang-sering-terjadi">Kesalahan yang Sering Terjadi</h2>
<p>Walaupun terlihat simpel, masih banyak yang melakukan kesalahan saat membuat sidebar. Misalnya, tidak menggunakan media query sehingga tampilannya tidak responsive. Selain itu, penggunaan animasi yang berlebihan juga bisa membuat website jadi berat.</p>
<p>Di samping itu, struktur HTML yang tidak rapi sering kali menyulitkan saat pengembangan. Bahkan, banyak juga yang lupa melakukan testing di berbagai ukuran layar. Padahal, langkah ini sangat penting.</p>
<hr />
<h2 id="tips-biar-hasil-lebih-maksimal">Tips Biar Hasil Lebih Maksimal</h2>
<p>Agar hasilnya lebih optimal, kamu bisa mulai dari desain yang sederhana tapi tetap clean. Selain itu, pastikan kecepatan loading tetap terjaga dengan menghindari elemen yang tidak perlu.</p>
<p>Kemudian, fokus pada kemudahan penggunaan. Sidebar harus mudah diakses dan tidak membingungkan. Selanjutnya, gunakan kombinasi CSS dan JavaScript secukupnya agar tetap ringan.</p>
<p>Terakhir, jangan lupa untuk selalu menguji tampilan di berbagai device. Dengan begitu, kamu bisa memastikan sidebar berjalan dengan baik di semua kondisi.</p>
<hr />
<h2 id="kesimpulan">Kesimpulan</h2>
<p>Secara keseluruhan, sidebar menu responsive bukan hanya soal tampilan, tapi juga kenyamanan pengguna. Dengan menggunakan sidebar menu HTML CSS JS yang siap pakai, kamu bisa menghemat waktu sekaligus meningkatkan kualitas UI website.</p>
<p>Jadi, daripada mulai dari nol, lebih baik manfaatkan template yang sudah ada lalu sesuaikan dengan kebutuhanmu. Dengan cara ini, proses development jadi lebih cepat dan hasilnya tetap maksimal.</p>
<hr />
<h2 id="faq">FAQ</h2>
<h3 id="1-apa-itu-sidebar-menu-responsive">1. Apa itu sidebar menu responsive?</h3>
<p>Sidebar menu responsive adalah navigasi samping yang bisa menyesuaikan tampilan di berbagai ukuran layar, baik desktop maupun mobile.</p>
<h3 id="2-apakah-sidebar-harus-pakai-javascript">2. Apakah sidebar harus pakai JavaScript?</h3>
<p>Tidak selalu. Namun, jika ingin fitur interaktif seperti toggle, JavaScript biasanya diperlukan.</p>
<h3 id="3-sidebar-cocok-untuk-website-apa-saja">3. Sidebar cocok untuk website apa saja?</h3>
<p>Sidebar cocok untuk dashboard, admin panel, dan website yang memiliki banyak menu navigasi.</p>
<hr />
<p>Kalau kamu merasa website masih kurang optimal dari segi tampilan dan konten, sekarang saatnya upgrade dengan artikel SEO-friendly dan tema WordPress yang profesional.</p>
<div class="ei-btn-wrap" style="text-align: left;"><a class="ei-btn" href="https://farhanhidayat.com/artikelpro/" target="_blank" rel="noopener">Cek Layanan Kami</a></div>
<p>Artikel <a href="https://farhanhidayat.com/sidebar-menu-html-css-js/">5 Sidebar Menu Responsive Siap Pakai (HTML, CSS, JS)</a> pertama kali tampil pada <a href="https://farhanhidayat.com">Farhanhidayat.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://farhanhidayat.com/sidebar-menu-html-css-js/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
