Socket
Socket
Sign inDemoInstall

material-ui-color

Package Overview
Dependencies
100
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    material-ui-color

The lightest colorpicker for React Material-Ui. No dependencies. It uses Hooks and support Typescript, and more !


Version published
Weekly downloads
9.5K
decreased by-0.79%
Maintainers
1
Install size
251 kB
Created
Weekly downloads
 

Readme

Source

material-ui-color picker and other components

Build Status codecov NPM version License minisize dependency status dev dependency status peer dependency status Downloads

Collections of color components for material-ui. No dependencies, small, highly customizable and theming support !

Video of ColorPicker

Contents

Why another ColorPicker ?

  • Fully compatible with Material-UI : theming and low level components
  • Highly customizable ColorPicker : gradient picker, palette, input format, deferred mode
  • Small in size (<30kb) without any direct dependencies
  • Use modern React hook and coding conventions
  • Documentation made with Storybook, using Component Story Format and MDX

Documentation

Full documentation is available here :

https://mikbry.github.io/material-ui-color/

Examples

You can find examples here and here.

Also in codesanbox

Requirements

  • Works on modern browsers supporting ES6+ (Not compatible with IE)
  • React and Material-UI frameworks

Install

yarn add material-ui-color

Or using npm

npm install material-ui-color

Usage

you need to have in your dependencies:

    "@material-ui/core": "^4.11.2",
    "material-ui-popup-state": "^1.7.1",
    "prop-types": "^15.7.2",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",

material-ui-color bring 5 components.

<ColorPicker/>

A popover component to display a color tool box. It uses ColorBox and material-ui-popup-state.

import { ColorPicker } from 'material-ui-color';

export const Container = () => (
  <div>
    <ColorPicker defaultValue="transparent"/>
  </div>
);

At first it display a button + an input

ColorPicker documentation

<ColorBox />

A component to display a color tool box

import { ColorBox } from 'material-ui-color';

export const Container = () => (
  <div>
    <ColorBox defaultValue="transparent"/>
  </div>
);

ColorBox documentation

<ColorInput />

An input component to display/edit color values in different format (plain, hex, rgb, hsl, hsv).

import { ColorInput } from 'material-ui-color';

export const Container = () => (
  <div>
    <ColorInput defaultValue="red"/>
  </div>
);

ColorInput documentation

<ColorPalette />

A component to display a grid of color buckets.

import { ColorPalette } from 'material-ui-color';

const palette = {
  red: '#ff0000',
  blue: '#0000ff',
  green: '#00ff00',
  yellow: 'yellow',
  cyan: 'cyan',
  lime: 'lime',
  gray: 'gray',
  orange: 'orange',
  purple: 'purple',
  black: 'black',
  white: 'white',
  pink: 'pink',
  darkblue: 'darkblue',
};

export const Container = () => (
  <div>
    <ColorPalette palette={palette} />
  </div>
);

ColorPalette documentation

<ColorButton />

Displays a button filled with a color

import { ColorButton } from 'material-ui-color';

export const Container = () => (
  <div>
    <ColorButton color="red"/>
  </div>
);

ColorButton documentation

Roadmap

v1.0.0 - Current version

  • remove styled-components to have less dependencies and reduce size
  • display wrong color using a red checked box
  • bugs fixes

Contribute

Contributions welcome! Read the contribution guidelines first.

License

Released under MIT License

Keywords

FAQs

Last updated on 26 May 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc