コンポーネント いいね/リアクションボタン Like/Reaction Buttons コンポーネント

Like/Reaction Buttons コンポーネント

マイクロインタラクションを備えた「いいね」ボタンと「リアクション」ボタンを備えたWebコンポーネントで、Tailwind CSSを使用したダークテーマのサポートがあります。

プレビュー

HTMLコード

<div class="flex flex-col items-center justify-center p-4">
  <h2 class="text-xl font-semibold mb-4 dark:text-white">React to this</h2>
  <div class="flex space-x-4">
    <button class="group bg-blue-500 text-white px-4 py-2 rounded-full transition-transform transform hover:scale-105 hover:bg-blue-600 focus:outline-none focus:ring focus:ring-blue-300">
      <span class="flex items-center space-x-2">
        <img src="https://picsum.photos/20/20" alt="like" class="rounded-full">
        <span>Like</span>
      </span>
    </button>
    <button class="group bg-gray-300 text-gray-800 px-4 py-2 rounded-full transition-transform transform hover:scale-105 hover:bg-gray-400 focus:outline-none focus:ring focus:ring-gray-300 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600">
      <span class="flex items-center space-x-2">
        <img src="https://picsum.photos/20/20?random=1" alt="love" class="rounded-full">
        <span>Love</span>
      </span>
    </button>
    <button class="group bg-yellow-500 text-white px-4 py-2 rounded-full transition-transform transform hover:scale-105 hover:bg-yellow-600 focus:outline-none focus:ring focus:ring-yellow-300">
      <span class="flex items-center space-x-2">
        <img src="https://picsum.photos/20/20?random=2" alt="laugh" class="rounded-full">
        <span>Laugh</span>
      </span>
    </button>
    <button class="group bg-red-500 text-white px-4 py-2 rounded-full transition-transform transform hover:scale-105 hover:bg-red-600 focus:outline-none focus:ring focus:ring-red-300">
      <span class="flex items-center space-x-2">
        <img src="https://picsum.photos/20/20?random=3" alt="wow" class="rounded-full">
        <span>Wow</span>
      </span>
    </button>
  </div>
</div>

<style>
  @media (prefers-color-scheme: dark) {
    body {
      background-color: #1a1a1a;
      color: #ffffff;
    }
  }
</style>

関連コンポーネント

類似のダークモードのいいね/リアクションボタン

ポートフォリオ用の複雑でレスポンシブな「いいね/リアクションボタン」コンポーネントで、ダークモードのUIと類似の配色を備え、純粋なHTMLとTailwind CSSを使用して実装されています。Tailwind の dark: プレフィックスを介してダーク モードをサポートします。

開ける

Like/Reaction Buttons コンポーネント

Tailwind CSS を使用した 3D Design Like/Reaction Buttons コンポーネントで、ダークテーマのサポートとレスポンシブエフェクトを備えています。

開ける

Like/Reaction Buttons コンポーネント

企業のWebサイト向けに設計されたレトロ/ビンテージのいいね/リアクションボタンコンポーネントで、アースカラーとダークモードをサポートするレスポンシブデザインが特徴です。

開ける