Installations
npm install @uiw/react-color
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Node Version
20.18.1
NPM Version
10.8.2
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (98.29%)
HTML (1.02%)
CSS (0.65%)
Less (0.04%)
Developer
Download Statistics
Total Downloads
990,067
Last Day
6,114
Last Week
25,031
Last Month
103,376
Last Year
820,284
GitHub Statistics
343 Stars
460 Commits
109 Forks
4 Watching
9 Branches
15 Contributors
Bundle Size
42.77 kB
Minified
12.72 kB
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
2.3.4
Package Id
@uiw/react-color@2.3.4
Unpacked Size
185.46 kB
Size
41.63 kB
File Count
10
NPM Version
10.8.2
Node Version
20.18.1
Publised On
11 Dec 2024
Total Downloads
Cumulative downloads
Total Downloads
990,067
Last day
2.3%
6,114
Compared to previous day
Last week
-16.9%
25,031
Compared to previous week
Last month
19.9%
103,376
Compared to previous month
Last year
489.9%
820,284
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
20
Peer Dependencies
3
Dev Dependencies
1
React Color
Getting Started
1npm i @uiw/react-color
1import { Slider, Sketch, Material, Colorful, Compact, Circle, Wheel, Block, Github, Chrome } from '@uiw/react-color'; 2import { Alpha, Hue, ShadeSlider, Saturation, Interactive, hsvaToHslaString } from '@uiw/react-color'; 3import { EditableInput, EditableInputRGBA, EditableInputHSLA } from '@uiw/react-color'; 4 5function Demo() { 6 const [hex, setHex] = useState("#fff"); 7 return ( 8 <Sketch 9 style={{ marginLeft: 20 }} 10 color={hex} 11 onChange={(color) => { 12 setHex(color.hex); 13 }} 14 /> 15 ); 16}
Support dark/night Theme
1[data-color-mode*='dark'] .w-color-sketch { 2 --sketch-background: #323232 !important; 3} 4 5[data-color-mode*='dark'] .w-color-swatch { 6 --sketch-swatch-border-top: 1px solid #525252 !important; 7} 8 9[data-color-mode*='dark'] .w-color-block { 10 --block-background-color: #323232 !important; 11 --block-box-shadow: rgb(0 0 0 / 10%) 0 1px !important; 12} 13 14[data-color-mode*='dark'] .w-color-editable-input { 15 --editable-input-label-color: #757575 !important; 16 --editable-input-box-shadow: #616161 0px 0px 0px 1px inset !important; 17 --editable-input-color: #bbb !important; 18} 19 20[data-color-mode*='dark'] .w-color-github { 21 --github-border: 1px solid rgba(0, 0, 0, 0.2) !important; 22 --github-background-color: #323232 !important; 23 --github-box-shadow: rgb(0 0 0 / 15%) 0px 3px 12px !important; 24 --github-arrow-border-color: rgba(0, 0, 0, 0.15) !important; 25} 26 27[data-color-mode*='dark'] .w-color-compact { 28 --compact-background-color: #323232 !important; 29} 30 31[data-color-mode*='dark'] .w-color-material { 32 --material-background-color: #323232 !important; 33 --material-border-bottom-color: #707070 !important; 34} 35 36[data-color-mode*='dark'] .w-color-alpha { 37 --alpha-pointer-background-color: #6a6a6a !important; 38 --alpha-pointer-box-shadow: rgb(0 0 0 / 37%) 0px 1px 4px 0px !important; 39}
Documentation
You can find the react-color documentation on the website.
Packages
Base Components
Development
1npm install # Installation dependencies 2npm run build # Compile all package
1cd packages/color-block 2# listen to the component compile and output the .js file 3# listen for compilation output type .d.ts file 4npm run watch # Monitor the compiled package `@uiw/react-block`
1npm run start # development mode, listen to compile preview website instance
Contributors
As always, thanks to our amazing contributors!
Made with contributors.
License
Licensed under the MIT License.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/ci.yml:8
Reason
8 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 7
Reason
Found 6/28 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Warn: no topLevel permission defined: .github/workflows/pr.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/uiwjs/react-color/pr.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:21
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:23
- Warn: npmCommand not pinned by hash: .github/workflows/pr.yml:16
- Warn: npmCommand not pinned by hash: .github/workflows/pr.yml:18
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 7 third-party GitHubAction dependencies pinned
- Info: 0 out of 4 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 8 are checked with a SAST tool
Score
5.1
/10
Last Scanned on 2025-01-20
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More