Syed Hasnain

Color Picker

AI chats 191

About

A Tailwind palette picker with search, hex and opacity inputs, and optional linear, radial, and conic gradients with draggable stops.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Color Picker to your project and fits it to your theme.

Code

How Color Picker is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { useState } from 'react'
import ColorPicker, { ColorPickerPopover } from '@/components/ui/color-picker'

const brandColors = ['#ff5a1f', '#1d1d1f', '#f5f0e8', '#3b5bdb', '#12b886']

export default function Demo() {
  const [fill, setFill] = useState('#2b7fff')

  return (
    <div className="flex flex-col items-center gap-4">
      <div
        aria-hidden="true"
        className="size-40 rounded-[16px] shadow-card"
        style={{ background: fill || 'transparent' }}
      />
      <ColorPickerPopover
        allowGradient
        label="Fill"
        onValueChange={setFill}
        recentColors={brandColors}
        recentLabel="Brand colors"
        align="center"
        side="right"
        value={fill}
      />
    </div>
  )
}

Dependencies

More by Syed Hasnain

View all
  • Cost Meter

    Cost Meter

    53
  • Message Scroller

    Message Scroller

    42
  • Attachments

    Attachments

    42
  • Commit

    Commit

    37
  • Background Inbox

    Background Inbox

    36
  • Video Player

    Video Player

    30
  • Image Generation Loader

    Image Generation Loader

    29
  • Approval Card

    Approval Card

    29

More in AI chats

View all
  • AI Actions

    AI Actions

    349
  • Agent Chat

    Agent Chat

    19
  • Aquarium Prompt

    Aquarium Prompt

    98
  • Research Report

    Research Report

    6
  • Illos Knowledge Sources

    Illos Knowledge Sources

    52
  • Message With Header And Delivery Status

    Message With Header And Delivery Status

    57
  • Inline Citation

    Inline Citation

    10
  • Chat Bubble

    Chat Bubble

    203

Explore more

Part of Pasta UI — browse the full library on 21st.dev.