d2-ui
Version:
18 lines (15 loc) • 475 B
Markdown
id: usage-include
title: Include the Component
Import a color picker from `react-color` at the top of a component and then use it in the render function:
```
import React from 'react';
import { SketchPicker } from 'react-color';
class Component extends React.Component {
render() {
return <SketchPicker />;
}
}
```
You can import `ChromePicker` `CompactPicker` `MaterialPicker` `PhotoshopPicker` `SketchPicker` `SliderPicker` `SwatchesPicker` respectively.