react-toolbox/components/chip
Galeel 85048a39a8 mixins is already imported in base, hence removed the redundant import | Galeel 2016-05-10 18:41:35 +05:30
..
Chip.js Indentify Avatar by constructur in Chip 2016-04-10 22:31:28 +02:00
_config.scss Use sass lint 2016-04-10 12:20:59 +02:00
index.js Add chip component 2016-04-02 13:37:21 +02:00
readme.md Update chip children prop type, readme 2016-04-04 11:34:48 +02:00
style.scss mixins is already imported in base, hence removed the redundant import | Galeel 2016-05-10 18:41:35 +05:30

readme.md

Chip

Chips represent complex entities in small blocks, such as a contact. Chips can be used for various types of entities, including free form text, predefined text, rules, or contacts. Chips may also contain icons.

To add an icon or contact image to a chip, include an Avatar element as the first child.

import Avatar from 'react-toolbox/lib/avatar';
import Chip from 'react-toolbox/lib/chip';

const ChipTest = () => (
  <div>
    <Chip>Example chip</Chip>
    <Chip>
      <span style={{textDecoration: 'line-through'}}>Standard</span>
      <strong>Custom</strong> chip <small>(custom markup)</small>
    </Chip>

    <Chip deletable>Deletable Chip</Chip>

    <Chip>
      <Avatar style={{backgroundColor: 'deepskyblue'}} icon="folder" />
      <span>Avatar Chip</span>
    </Chip>

    <Chip>
      <Avatar title="A" /><span>Initial chip</span>
    </Chip>

    <Chip>
      <Avatar><img src="https://placeimg.com/80/80/animals"/></Avatar>
      <span>Image contact chip</span>
    </Chip>
  </div>
);

Properties

Name Type Default Description
children Node Child components, usually Avatar and inline elements.
className String '' Additional class name to provide custom styling.
deletable Boolean false If true, the chip will be rendered with a delete icon.
onDeleteClick Function Callback to be invoked when the delete icon is clicked.