---
id: api-onClose
title: onClose
---
If you are using the ColorPicker as a popup, you can pass a function to `onClose` that will fire when the popup is closed. The callback gets called with the latest color information as the first argument.

```
var React = require('react');
var ColorPicker = require('react-color');

class Component extends React.Component {

  handleClose(color) {
    ...
  }

  render() {
    return <ColorPicker display={ true } onClose={ this.handleClose } />;
  }
}
```
