npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

material-ui-color-components

v0.3.0

Published

Color components (ColorPicker) for React Material-Ui. No dependencies. It uses Hooks and support RGBA, HSVA, and more !

Downloads

326

Readme

material-ui-color-components

Build Status codecov NPM version License minisize

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
  • Styled with styled-components
  • Highly customizable ColorPicker : gradient picker, palette, input format, deferred mode
  • Small in size (<30kb) without any extra 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-components/

Requirements

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

Install

yarn add material-ui-color-components

Or using npm

npm install material-ui-color-components

Usage

you need to have in your dependencies:

    "@material-ui/core": "^4.9.5",
    "material-ui-popup-state": "^1.5.3",
    "prop-types": "15.7.2",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "styled-components": "^5.0.1"

material-ui-color-components bring 5 components.

<ColorPicker/>

A popover component to display a color tool box (use ColorBox)

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

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-components';

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-components';

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-components';

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-components';

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

ColorButton documentation

Roadmap

v0.3.0 - Current version

  • add Typescript support
  • accessibility : keyboard and touch support
  • localization
  • disable alpha property
  • #30, #29, #22 resolved
  • WIP - better documentation: colorType explained, i18n, typescript examples

v0.4.0 - WIP

  • optimize code
  • redesign inputs in ColorBox
  • remove styled-components to have less dependencies and reduce size
  • bugs fixes

v0.5.0 - planned

  • rtl support
  • ColorInput : display alpha and size according to MUi
  • ColorInput : optional color box as left or right icon
  • ColorPicker: left or right Colorbox
  • bugs fixes

Contribute

Contributions welcome! Read the contribution guidelines first.

License

Released under MIT License