
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
react-color-gradient-picker
Advanced tools
To install, you can use npm or yarn:
$ npm install react-color-gradient-picker
$ yarn add react-color-gradient-picker
Here is a simple examples of react-color-gradient-picker being used in an app:
import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import { ColorPicker } from 'react-color-gradient-picker';
import 'react-color-gradient-picker/dist/index.css';
const color = {
red: 255,
green: 0,
blue: 0,
alpha: 1,
};
function App() {
const [colorAttrs, setColorAttrs] = useState(color);
const onChange = (colorAttrs) => {
setColorAttrs(colorAttrs);
};
return (
<ColorPicker
onStartChange={onChange}
onChange={onChange}
onEndChange={onChange}
color={colorAttrs}
/>
);
}
ReactDOM.render(<App />, document.getElementById('app-id'));
import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import { ColorPicker } from 'react-color-gradient-picker';
import 'react-color-gradient-picker/dist/index.css';
const gradient = {
points: [
{
left: 0,
red: 0,
green: 0,
blue: 0,
alpha: 1,
},
{
left: 100,
red: 255,
green: 0,
blue: 0,
alpha: 1,
},
],
degree: 0,
type: 'linear',
};
function App() {
const [gradientAttrs, setGradientAttrs] = useState(gradient);
const onChange = (gradientAttrs) => {
setGradientAttrs(gradientAttrs);
};
return (
<ColorPicker
onStartChange={onChange}
onChange={onChange}
onEndChange={onChange}
gradient={gradientAttrs}
isGradient
/>
);
}
ReactDOM.render(<App />, document.getElementById('app-id'));
FAQs
Color picker for react
The npm package react-color-gradient-picker receives a total of 205 weekly downloads. As such, react-color-gradient-picker popularity was classified as not popular.
We found that react-color-gradient-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.