{"id":18832830,"url":"https://github.com/brandymint/react-color-picker","last_synced_at":"2025-04-14T04:30:28.243Z","repository":{"id":30509317,"uuid":"34063740","full_name":"BrandyMint/react-color-picker","owner":"BrandyMint","description":"React Color Picker","archived":false,"fork":false,"pushed_at":"2015-04-17T12:45:19.000Z","size":11815,"stargazers_count":0,"open_issues_count":0,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T18:21:24.477Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jslog.com/react-color-picker","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrandyMint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-16T15:23:21.000Z","updated_at":"2020-07-17T03:20:38.000Z","dependencies_parsed_at":"2022-09-01T13:01:06.510Z","dependency_job_id":null,"html_url":"https://github.com/BrandyMint/react-color-picker","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandyMint%2Freact-color-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandyMint%2Freact-color-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandyMint%2Freact-color-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandyMint%2Freact-color-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrandyMint","download_url":"https://codeload.github.com/BrandyMint/react-color-picker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248821605,"owners_count":21166911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T01:59:07.645Z","updated_at":"2025-04-14T04:30:28.212Z","avatar_url":"https://github.com/BrandyMint.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Color Picker\n\nDemo: [jslog.com/react-color-picker](http://jslog.com/react-color-picker)\n\n![Color Picker](https://cloud.githubusercontent.com/assets/512416/5023604/0761ac7a-6aca-11e4-90db-d8678be7c267.PNG)\n\n## Install\n\n#### NPM\n\n```sh\n$ npm install react-color-picker\n```\n\n#### Bower\n\n```sh\nbower install react-color-picker\n```\n\n#### Other\n\nUse `dist/react-color-picker.js`, which uses umd (exported as `ColorPicker`).\n\nUse version `\u003e=2.0.0` for React `\u003e=0.12.0`. For previous React versions, use `==1.4.1`.\n\n## Usage\n\n`react-color-picker` does not include `React` (not even in `dist/react-color-picker.js`) so you'll have to manually include that.\n\nYou can have either **controlled** (using **value**) or **uncontrolled** (using **defaultValue**) pickers.\n\n#### Please don't forget to include the styles!!! - `index.css` or `index.styl`\n\nExample (**controlled**)\n```jsx\n\nvar React = require('react')\nvar ColorPicker = require('react-color-picker')\n\nvar App = React.createClass({\n\n    displayName: 'App',\n\n    onDrag: function(color, c){\n        COLOR = color\n        this.setState({})\n    },\n\n    render: function(){\n\n        return (\n            \u003cdiv\u003e\n                \u003cColorPicker value={COLOR} onDrag={this.onDrag} /\u003e\n                \u003cdiv style={{background: COLOR, width: 100, height: 50, color: 'white'}}\u003e\n                    {COLOR}\n                \u003c/div\u003e\n            \u003c/div\u003e\n        )\n    }\n})\n\nReact.renderComponent(App(), document.body)\n\n```\n\nExample (**uncontrolled**)\n```jsx\nReact.renderComponent(\n    \u003cColorPicker defaultValue='#452135'/\u003e,\n    document.body\n)\n\n```\n\n## HueSpectrum\n\nYou can use only the hue spectrum if that is what you need.\n\n```jsx\nvar React = require('react')\nvar HueSpectrum = require('react-color-picker').HueSpectrum\n\n\u003cHueSpectrum value={color} width={100}/\u003e\n\u003cHueSpectrum defaultValue=\"red\" /\u003e\n```\n\n## SaturationSpectrum\n\nYou can use only the saturation spectrum if that is what you need.\n\n```jsx\nvar React = require('react')\nvar SaturationSpectrum = require('react-color-picker').SaturationSpectrum\n\n\u003cSaturationSpectrum value={color} height={400}/\u003e\n\u003cSaturationSpectrum defaultValue=\"red\" /\u003e\n```\n\n## Properties\n\nIt's best if you specify a fixed size for the color picker.\n\nAvailable options:\n\n * saturationWidth\n * saturationHeight\n * hueWidth\n * hueHeight (defaults to saturationHeight)\n\n```jsx\n\u003cColorPicker value={color} saturationWidth={400} saturationHeight={500} /\u003e\n\u003cColorPicker value={color} saturationWidth={400} saturationHeight={500} hueWidth={100}/\u003e\n```\n\nYou can specify any other properties on the `ColorPicker`, including `className`, `style`, etc\nThe `ColorPicker` will always have a css class `color-picker`\n\nThe ColorPicker, the HueSpectrum and the SaturationSpectrum all accept `onDrag` and `onChange` callbacks.\n\n### onDrag(colorString)\n\nCalled during the dragging operation.\n\n### onChange(colorString)\n\nCalled after mouse up - when the color has been selected\n\n## Development\n\nIn order to make new build, run\n\n```sh\n$ npm run build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandymint%2Freact-color-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrandymint%2Freact-color-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandymint%2Freact-color-picker/lists"}