구성 요소 사이드바 탐색 E-commerce Sidebar 내비게이션

E-commerce Sidebar 내비게이션

전자 상거래 웹 사이트를 위한 간단하고 반응이 빠른 사이드바 탐색 구성 요소로, 트라이어드 색 구성표, 호버링의 마이크로 인터랙션, 다크 모드 지원을 특징으로 하며 Tailwind CSS로 구축되었습니다.

미리 보기

HTML 코드

<div class="flex">
  <!-- Sidebar (Hidden on mobile, shown on desktop) -->
  <aside id="sidebar" class="bg-blue-500 text-white w-64 space-y-6 py-7 px-2 absolute inset-y-0 left-0 transform -translate-x-full md:relative md:translate-x-0 transition duration-200 ease-in-out">
    <a href="#" class="text-white flex items-center space-x-2 px-4">
      <span class="text-2xl font-extrabold">E-Shop</span>
    </a>

    <nav>
      <a href="#" class="block py-2.5 px-4 rounded transition duration-200 hover:bg-blue-700 dark:hover:bg-blue-900">
        Home
      </a>
      <a href="#" class="block py-2.5 px-4 rounded transition duration-200 hover:bg-blue-700 dark:hover:bg-blue-900">
        Products
      </a>
      <a href="#" class="block py-2.5 px-4 rounded transition duration-200 hover:bg-blue-700 dark:hover:bg-blue-900">
        Categories
      </a>
      <a href="#" class="block py-2.5 px-4 rounded transition duration-200 hover:bg-blue-700 dark:hover:bg-blue-900">
        Cart
      </a>
      <a href="#" class="block py-2.5 px-4 rounded transition duration-200 hover:bg-blue-700 dark:hover:bg-blue-900">
        Account
      </a>
    </nav>
  </aside>

  <!-- Content area -->
  <div class="flex-1 p-10">
    <!-- A button to toggle the sidebar on mobile -->
    <button id="sidebar-toggle" class="text-blue-700 dark:text-blue-300 focus:outline-none md:hidden">
      <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>
    </button>
    <h1 class="text-2xl font-bold text-gray-900 dark:text-white mb-8">Welcome to E-Shop</h1>
    <!-- Your main content goes here -->
    <p class="text-gray-700 dark:text-gray-300">This is the main content area. Add your product listings, categories, etc. here.</p>
  </div>
</div>

<!-- Add this script at the end of the body tag -->
<script>
  const sidebarToggle = document.getElementById('sidebar-toggle');
  const sidebar = document.getElementById('sidebar');

  sidebarToggle.addEventListener('click', () => {
    sidebar.classList.toggle('-translate-x-full');
  });
</script>

관련 구성 요소

Sidebar Navigation 구성 요소

다크 모드를 지원하는 반응형 사이드바 탐색 구성 요소. 미니멀리스트/플랫 디자인, 단색 색 구성표, 포트폴리오를 위한 복잡한 인터페이스. Tailwind CSS, picsum.photos 및 randomuser.me 를 사용합니다. 자바스크립트가 없습니다.

열다

사이드바 탐색

반응형 사이드바 탐색 구성 요소에는 아날로그 색 구성표와 어두운 테마 지원을 포함한 마이크로 인터랙션이 있습니다.

열다

RetroPastel소셜사이드바

레트로/빈티지 80년대/90년대 디자인, 파스텔 색상 및 다크 모드를 지원하는 간단하고 반응이 빠른 사이드바 탐색 구성 요소로, Tailwind CSS를 사용하는 소셜 미디어 인터페이스용으로 설계되었습니다.

열다