0.0.18 • Published 2 years ago

color-gradient-picker v0.0.18

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Color Gradient Picker

Table of Contents

Installation

To install, you can use npm or yarn:

$ npm install color-gradient-picker
$ yarn add color-gradient-picker

Examples

Here is a simple examples of color-gradient-picker being used in an app:

Default Picker

import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import { ColorPicker } from 'color-gradient-picker'
import 'color-gradient-picker/dist/index.css';

function App() {
    const [colorAttrs, setColorAttrs] = useState('rgba(0, 144, 255, 1)');
    
    const onChange = (colorAttrs) => {
        setColorAttrs(colorAttrs);
    };
  
    return (
        <ColorPicker.DefaultPicker
            onChange={onChange}
            onlySolid
            value={colorAttrs}
        />

    );
}

ReactDOM.render(<App />, document.getElementById('app-id'));

Custom Picker

import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import { ColorPicker } from 'color-gradient-picker'
import 'color-gradient-picker/dist/index.css';

function App() {
    const [color, setColor] = useState('linear-gradient(rgba(0, 144, 255, 1) 0%, rgba(0, 72, 128, 1) 100%)');
    
    const onChange = (gradientAttrs) => {
        setColor(gradientAttrs);
    };
  
    return (
        <ColorPicker.AutoPicker
            value={color}
            onChange={onChange}
        />

    );
}

ReactDOM.render(<App />, document.getElementById('app-id'));
0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago