Skip to content

About

Controlled, accessible React color picker with presets and validation.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

RentnerPicker

CI CodeQL OpenSSF Scorecard npm version npm downloads MIT license

Controlled React color picker with presets, HEX/RGB input, accessible controls, and localization.

Installation

Requires React 19, React DOM 19, and Tailwind CSS 4.

npm install @rentnerkev/picker
# or with Bun
bun add @rentnerkev/picker

Import the package styles after Tailwind in your app stylesheet:

@import 'tailwindcss';
@import '@rentnerkev/picker/tailwind.css';

Quick start

'use client'

import { useState } from 'react'
import { CustomColorPicker } from '@rentnerkev/picker'

export function BrandColor() {
    const [color, setColor] = useState('#13ecd6')
    return (
        <CustomColorPicker
            label="Brand color"
            value={color}
            onValueChange={setColor}
            locale="en"
        />
    )
}

Screenshots

Hue, saturation & brightness
Hue, saturation & brightness
Custom indigo presets
Custom indigo presets
RGB color input
RGB color input
Compact color trigger
Compact color trigger

Full API & usage · Local playground · MIT license

Run the playground from the repository root:

bun install --cwd playground
bun run playground:dev

AI and read-only MCP access

The separate @rentnerkev/picker/ai entry is for Node.js and Bun tooling. It reads only this installed package's manifest, README, usage guide, and built TypeScript declarations. It does not import React, mount UI, run examples, perform network requests, or require an MCP runtime. Keep it in server/tooling code.

import {
    getPackageInfo,
    getPackageApi,
    getPackageDocumentation,
    searchPackageDocumentation,
    getPackageExamples,
} from '@rentnerkev/picker/ai'

const info = getPackageInfo()
const api = getPackageApi() // All public typed subpaths and dependent declarations
const usage = getPackageDocumentation('usage') // Full guide, including CSS and providers
const readme = getPackageDocumentation('readme')
const matches = searchPackageDocumentation('messages') // Literal, case-insensitive lines
const examples = getPackageExamples() // Fenced examples from the usage guide

getPackageApi({ subpath: '.', symbol: 'CustomColorPicker' }) validates the symbol against the selected public entry and returns its complete declaration context. Unknown subpaths or symbols throw an error. File paths are not accepted. The ./ai entry itself is excluded from this UI API context. The manifest's exports map remains available through getPackageInfo().

Public website discovery is planned at llms.txt and the MCP endpoint. These addresses become available after the website deployment; this documentation does not claim the endpoint is already online. The website's read-only tools expose public package information, API declarations, usage guides, examples, and search, without accounts, write operations, or access to private project files. The installed /ai entry works locally without that service. Always use the documentation and declarations for the version installed in your project.

Shared field sizes/slots, portal defaults, theme.css and pure ./form adapters with draft validity are documented in the usage guide.

Community

See Contributing, the Code of Conduct, Support, and the Security Policy.

About

Controlled, accessible React color picker with presets and validation.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages