Chips

Chips (Tags) represent complex entities in small blocks, such as a contact. They can contain a photo, short title string, and brief information.

Chips HTML Layout

Let's look at basic chip HTML layout

<div class="chip">
    <div class="chip-media">
        <img src="http://lorempixel.com/100/100/people/9/">
    </div>
    <div class="chip-label">Jane Doe</div>
    <a href="#" class="chip-delete"></a>
</div>

Where

  • <div class="chip"> - Chip container

    • <div class="chip-media"> - Chip "media" element, can contain image/avatar or icon. Optional

    • <div class="card-label"> - Chip text label

    • <a class="card-delete"> - Chip delete icon-link. Optional

Examples

<div class="content-block-title">Chips With Text</div>
<div class="content-block">
  <div class="chip">
    <div class="chip-label">Example Chip</div>
  </div>
  <div class="chip">
    <div class="chip-label">Another Chip</div>
  </div>
  <div class="chip">
    <div class="chip-label">One More Chip</div>
  </div>
  <div class="chip">
    <div class="chip-label">Fourth Chip</div>
  </div>
  <div class="chip">
    <div class="chip-label">Last One</div>
  </div>
</div>
<div class="content-block-title">Icon Chips</div>
<div class="content-block">
  <div class="chip">
    <div class="chip-media bg-blue"><i class="icon demo-icon-calendar"></i></div>
    <div class="chip-label">Set Date</div>
  </div>
  <div class="chip">
    <div class="chip-media bg-purple"><i class="icon demo-icon-email"></i></div>
    <div class="chip-label">Sent</div>
  </div>
  <div class="chip">
    <div class="chip-media bg-red"><i class="icon demo-icon-upload"></i></div>
    <div class="chip-label">Uploaded</div>
  </div>
</div>
<div class="content-block-title">Contact Chips</div>
<div class="content-block">
  <div class="chip">
    <div class="chip-media"><img src="http://lorempixel.com/100/100/people/9/"></div>
    <div class="chip-label">Jane Doe</div>
  </div>
  <div class="chip">
    <div class="chip-media"><img src="http://lorempixel.com/100/100/people/3/"></div>
    <div class="chip-label">John Doe</div>
  </div>
  <div class="chip">
    <div class="chip-media"><img src="http://lorempixel.com/100/100/people/7/"></div>
    <div class="chip-label">Adam Smith</div>
  </div>
  <div class="chip">
    <div class="chip-media bg-pink">J</div>
    <div class="chip-label">Jennifer</div>
  </div>
  ...
</div>
<div class="content-block-title">Deletable Chips / Tags</div>
<div class="content-block">
  <div class="chip">
    <div class="chip-label">Example Chip</div>
    <a href="#" class="chip-delete"></a>
  </div>
  <div class="chip">
    <div class="chip-media bg-teal">C</div>
    <div class="chip-label">Chris</div>
    <a href="#" class="chip-delete"></a>
  </div>
  <div class="chip">
    <div class="chip-media bg-purple"><i class="icon demo-icon-email"></i></div>
    <div class="chip-label">Sent</div>
    <a href="#" class="chip-delete"></a>
  </div>
  <div class="chip">
    <div class="chip-media"><img src="http://lorempixel.com/100/100/people/9/"></div>
    <div class="chip-label">Jane Doe</div>
    <a href="#" class="chip-delete"></a>
  </div>
  ...
</div>
var $$ = Dom7;
$$('.chip-delete').on('click', function (e) {
    e.preventDefault();
    var chip = $$(this).parents('.chip');
    myApp.confirm('Do you want to delete this tiny demo Chip?', function () {
        chip.remove();
    });
});