Component

Feedback Modal

Feedback collection modal with star rating, category selection, text area, and optional email field for user feedback.

  • Component
  • Tailwind
  • HTML
  • MIT

Preview

Live component

Interactive preview
Open preview
9:41 100%
devsnips.dev/library/tailwind/components/modals/feedback-modal/
fluid · no fixed width 100%
No dependencies Production-ready

Install

Add to your project

terminal
npx devsnips add Tailwind/Components/Modals/feedback-modal
registry path: Tailwind/Components/Modals/feedback-modal

Source

Implementation

code.html
<!-- Feedback Modal -->
<div id="feedback-modal" class="fixed inset-0 z-50 hidden">
  <!-- Backdrop -->
  <div class="fixed inset-0 bg-black/50 backdrop-blur-sm" onclick="closeModal('feedback-modal')"></div>
  
  <!-- Modal Container -->
  <div class="fixed inset-0 flex items-center justify-center p-4">
    <div class="relative bg-white dark:bg-gray-900 rounded-2xl shadow-2xl w-full max-w-lg transform transition-all" role="dialog" aria-modal="true" aria-labelledby="feedback-modal-title">
      
      <!-- Header -->
      <div class="p-6 pb-4 border-b border-gray-100 dark:border-gray-800">
        <div class="flex items-center justify-between">
          <div class="flex items-center gap-3">
            <div class="w-10 h-10 bg-pink-100 dark:bg-pink-900/30 rounded-xl flex items-center justify-center">
              <svg class="w-5 h-5 text-pink-600 dark:text-pink-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"/>
              </svg>
            </div>
            <div>
              <h3 id="feedback-modal-title" class="text-lg font-semibold text-gray-900 dark:text-white">Share Your Feedback</h3>
              <p class="text-sm text-gray-500 dark:text-gray-400">Help us improve DevSnips</p>
            </div>
          </div>
          <button onclick="closeModal('feedback-modal')" class="p-2 rounded-lg text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors">
            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
              <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
            </svg>
          </button>
        </div>
      </div>
      
      <!-- Content -->
      <div class="p-6 space-y-6">
        <!-- Rating -->
        <div>
          <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">How would you rate your experience?</label>
          <div class="flex items-center justify-center gap-2">
            <button class="p-3 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors">
              <svg class="w-8 h-8 text-gray-300 dark:text-gray-600 hover:text-red-500 transition-colors" fill="currentColor" viewBox="0 0 24 24">
                <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
              </svg>
            </button>
            <button class="p-3 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors">
              <svg class="w-8 h-8 text-gray-300 dark:text-gray-600 hover:text-red-500 transition-colors" fill="currentColor" viewBox="0 0 24 24">
                <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
              </svg>
            </button>
            <button class="p-3 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors">
              <svg class="w-8 h-8 text-gray-300 dark:text-gray-600 hover:text-orange-500 transition-colors" fill="currentColor" viewBox="0 0 24 24">
                <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
              </svg>
            </button>
            <button class="p-3 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors">
              <svg class="w-8 h-8 text-orange-400 transition-colors" fill="currentColor" viewBox="0 0 24 24">
                <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
              </svg>
            </button>
            <button class="p-3 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors">
              <svg class="w-8 h-8 text-gray-300 dark:text-gray-600 hover:text-yellow-500 transition-colors" fill="currentColor" viewBox="0 0 24 24">
                <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
              </svg>
            </button>
          </div>
        </div>
        
        <!-- Feedback Type -->
        <div>
          <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">What is this about?</label>
          <div class="flex flex-wrap gap-2">
            <button class="px-4 py-2 text-sm font-medium bg-pink-100 dark:bg-pink-900/30 text-pink-600 dark:text-pink-400 rounded-full">Bug Report</button>
            <button class="px-4 py-2 text-sm font-medium bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors">Feature Request</button>
            <button class="px-4 py-2 text-sm font-medium bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors">Improvement</button>
            <button class="px-4 py-2 text-sm font-medium bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors">Other</button>
          </div>
        </div>
        
        <!-- Message -->
        <div>
          <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Tell us more</label>
          <textarea rows="4" placeholder="Describe your feedback in detail..." class="w-full px-4 py-3 border border-gray-200 dark:border-gray-700 rounded-xl bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder-gray-400 focus:ring-2 focus:ring-pink-500 focus:border-transparent transition-all resize-none"></textarea>
        </div>
        
        <!-- Email (optional) -->
        <div>
          <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Email (optional)</label>
          <input type="email" placeholder="you@example.com" class="w-full px-4 py-3 border border-gray-200 dark:border-gray-700 rounded-xl bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder-gray-400 focus:ring-2 focus:ring-pink-500 focus:border-transparent transition-all">
        </div>
      </div>
      
      <!-- Footer -->
      <div class="flex items-center gap-3 p-6 border-t border-gray-100 dark:border-gray-800">
        <button onclick="closeModal('feedback-modal')" class="flex-1 py-3 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-800 rounded-xl hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors">Cancel</button>
        <button onclick="closeModal('feedback-modal')" class="flex-1 py-3 text-sm font-medium text-white bg-gradient-to-r from-pink-500 to-rose-600 rounded-xl hover:from-pink-600 hover:to-rose-700 transition-colors shadow-lg shadow-pink-500/30">Submit Feedback</button>
      </div>
    </div>
  </div>
</div>

<!-- Demo Trigger Button -->
<button onclick="openModal('feedback-modal')" class="px-6 py-3 bg-gradient-to-r from-pink-500 to-rose-600 text-white font-medium rounded-xl hover:from-pink-600 hover:to-rose-700 transition-all focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2">Open Feedback Modal</button>
100 lines UTF-8 · LF · Spaces: 2

AI-ready

Available to your agent.

This component is reachable through the DevSnips CLI, MCP server and Skills integrations — one registry, one resource path.

Resource path

devsnips://components/modals/feedback-modal

Continue browsing

View all