Componenti Distintivi Componente Badge

Componente Badge

Un componente di badge pulito e minimalista progettato per i sistemi di prenotazione, con layout reattivo, combinazione di colori pastello e supporto per la modalità scura, ispirato alla tipografia svizzera/internazionale.

Anteprima

Codice HTML

<div class="font-sans antialiased bg-gray-50 text-gray-800 dark:bg-gray-900 dark:text-gray-100 p-4 sm:p-6 lg:p-8">
  <div class="max-w-7xl mx-auto py-8 sm:py-12">
    <h2 class="text-3xl sm:text-4xl font-bold mb-8 text-center tracking-tight text-gray-900 dark:text-gray-50">
      Your Upcoming Bookings
    </h2>

    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">

      <!-- Badge 1: Confirmed Appointment -->
      <div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm overflow-hidden border border-gray-200 dark:border-gray-700 hover:shadow-md transition-shadow duration-300">
        <div class="p-5 flex flex-col items-start">
          <span class="inline-flex items-center px-3 py-1.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-700 dark:text-green-50 animate-pulse-slow">
            <svg class="-ml-0.5 mr-1.5 h-3 w-3 text-green-700 dark:text-green-50" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
              <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
            </svg>
            Confirmed
          </span>
          <h3 class="mt-4 text-xl font-semibold text-gray-900 dark:text-gray-50">Dental Check-up</h3>
          <p class="mt-2 text-sm text-gray-600 dark:text-gray-400">Dr. Alice Smith</p>
          <div class="mt-4 text-gray-700 dark:text-gray-300 text-sm">
            <p class="flex items-center"><svg class="mr-2 h-4 w-4 text-gray-400 dark:text-gray-500" 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="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg>Oct 26, 2023</p>
            <p class="flex items-center mt-1"><svg class="mr-2 h-4 w-4 text-gray-400 dark:text-gray-500" 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="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>10:00 AM</p>
          </div>
          <a href="#" class="mt-5 inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-blue-500 hover:bg-blue-600 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:focus:ring-offset-gray-900 transition-colors duration-200">
            View Details
            <svg class="ml-2 -mr-1 h-3 w-3" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg>
          </a>
        </div>
      </div>

      <!-- Badge 2: Pending Reservation -->
      <div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm overflow-hidden border border-gray-200 dark:border-gray-700 hover:shadow-md transition-shadow duration-300">
        <div class="p-5 flex flex-col items-start">
          <span class="inline-flex items-center px-3 py-1.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-700 dark:text-yellow-50">
            <svg class="-ml-0.5 mr-1.5 h-3 w-3 text-yellow-700 dark:text-yellow-50" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
              <path fill-rule="evenodd" d="M8.257 3.099c.765-1.3 2.624-1.3 3.389 0l7.25 12.482A1.5 1.5 0 0118.25 17H1.75a1.5 1.5 0 01-1.301-2.19l7.25-12.482zM10 13a1 1 0 100-2 1 1 0 000 2zm0 4a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" />
            </svg>
            Pending
          </span>
          <h3 class="mt-4 text-xl font-semibold text-gray-900 dark:text-gray-50">Restaurant Table Booking</h3>
          <p class="mt-2 text-sm text-gray-600 dark:text-gray-400">The Fancy Bistro</p>
          <div class="mt-4 text-gray-700 dark:text-gray-300 text-sm">
            <p class="flex items-center"><svg class="mr-2 h-4 w-4 text-gray-400 dark:text-gray-500" 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="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg>Nov 15, 2023</p>
            <p class="flex items-center mt-1"><svg class="mr-2 h-4 w-4 text-gray-400 dark:text-gray-500" 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="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>7:30 PM (4 Guests)</p>
          </div>
          <a href="#" class="mt-5 inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-900 transition-colors duration-200">
            Review / Cancel
          </a>
        </div>
      </div>

      <!-- Badge 3: Completed Session -->
      <div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm overflow-hidden border border-gray-200 dark:border-gray-700 hover:shadow-md transition-shadow duration-300">
        <div class="p-5 flex flex-col items-start">
          <span class="inline-flex items-center px-3 py-1.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800 dark:bg-indigo-700 dark:text-indigo-50">
            <svg class="-ml-0.5 mr-1.5 h-3 w-3 text-indigo-700 dark:text-indigo-50" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
              <path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.538 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.783.57-1.838-.197-1.538-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.92 8.725c-.783-.57-.38-.72.588-1.81l3.462-.002a1 1 0 00.95-.69L9.049 2.927z" />
            </svg>
            Completed
          </span>
          <h3 class="mt-4 text-xl font-semibold text-gray-900 dark:text-gray-50">Yoga Session</h3>
          <p class="mt-2 text-sm text-gray-600 dark:text-gray-400">Zen Flow Studio</p>
          <div class="mt-4 text-gray-700 dark:text-gray-300 text-sm">
            <p class="flex items-center"><svg class="mr-2 h-4 w-4 text-gray-400 dark:text-gray-500" 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="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg>Sep 20, 2023</p>
            <p class="flex items-center mt-1"><svg class="mr-2 h-4 w-4 text-gray-400 dark:text-gray-500" 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="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>6:00 PM</p>
          </div>
          <a href="#" class="mt-5 inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-900 transition-colors duration-200">
            Leave Feedback
          </a>
        </div>
      </div>

    </div>
  </div>
</div>

<style>
  /* This is for the pulsating effect on the 'Confirmed' badge only */
  @keyframes pulse-slow {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.03); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
  }
  .animate-pulse-slow {
    animation: pulse-slow 3s infinite ease-in-out;
  }
</style>

Componenti correlati

Componente Badge

Componente badge elegante e reattivo per la documentazione o i siti wiki, caratterizzato da una combinazione di colori dai toni della terra, una tipografia di lusso e il supporto completo della modalità scura.

Aperto

Componente Badge

Componente Badge - Design minimalista/piatto con effetti reattivi e supporto per temi scuri. Niente JavaScript, HTML e CSS puri con Tailwind.

Aperto

Componente Badge

Un componente Badge reattivo con microinterazioni coinvolgenti, progettato utilizzando Tailwind CSS. Supporta la modalità oscura e include segnaposto per le immagini.

Aperto