Component

Color Picker Input

Color selection components including native picker and preset swatches

  • Component
  • Tailwind
  • MIT

Preview

Live component

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

Install

Add to your project

terminal
npx devsnips add Tailwind/Components/Input/color-picker
registry path: Tailwind/Components/Input/color-picker

Source

Implementation

code.html
<!-- Color Picker - Standard -->
<div>
  <label class="block text-sm font-medium text-gray-700 mb-2">Brand Color</label>
  <div class="flex items-center gap-4">
    <input type="color" value="#3B82F6" class="w-14 h-14 rounded-lg border-2 border-gray-200 cursor-pointer" />
    <input type="text" value="#3B82F6" class="flex-1 px-4 py-3 bg-white border border-gray-300 rounded-lg font-mono text-sm focus:outline-none focus:ring-2 focus:ring-blue-500" />
  </div>
</div>

<!-- Color Picker - Presets -->
<div class="mt-6">
  <label class="block text-sm font-medium text-gray-700 mb-3">Accent Color</label>
  <div class="flex items-center gap-3">
    <button class="w-10 h-10 rounded-full bg-blue-500 ring-2 ring-offset-2 ring-blue-500"></button>
    <button class="w-10 h-10 rounded-full bg-purple-500 hover:ring-2 hover:ring-offset-2 hover:ring-purple-500 transition-all"></button>
    <button class="w-10 h-10 rounded-full bg-pink-500 hover:ring-2 hover:ring-offset-2 hover:ring-pink-500 transition-all"></button>
    <button class="w-10 h-10 rounded-full bg-green-500 hover:ring-2 hover:ring-offset-2 hover:ring-green-500 transition-all"></button>
    <button class="w-10 h-10 rounded-full bg-amber-500 hover:ring-2 hover:ring-offset-2 hover:ring-amber-500 transition-all"></button>
    <button class="w-10 h-10 rounded-full bg-gray-300 hover:ring-2 hover:ring-offset-2 hover:ring-gray-400 transition-all"></button>
  </div>
</div>

<!-- Color Picker - Gradient Swatches -->
<div class="mt-6">
  <label class="block text-sm font-medium text-gray-700 mb-3">Theme Gradient</label>
  <div class="grid grid-cols-4 gap-3">
    <button class="h-12 rounded-lg bg-gradient-to-r from-blue-500 to-cyan-500 hover:ring-2 hover:ring-offset-2 hover:ring-blue-500 transition-all"></button>
    <button class="h-12 rounded-lg bg-gradient-to-r from-purple-500 to-pink-500 hover:ring-2 hover:ring-offset-2 hover:ring-purple-500 transition-all"></button>
    <button class="h-12 rounded-lg bg-gradient-to-r from-amber-500 to-orange-500 hover:ring-2 hover:ring-offset-2 hover:ring-amber-500 transition-all"></button>
    <button class="h-12 rounded-lg bg-gradient-to-r from-green-500 to-emerald-500 hover:ring-2 hover:ring-offset-2 hover:ring-green-500 transition-all"></button>
  </div>
</div>
32 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/input/color-picker

Continue browsing

View all