Search results

Chip Customization

This section explains the customization of styles, leading icons, avatar, and trailing icons in Chip control.

Styles

The Chip control has the following predefined styles that can be defined using the cssClass property.

Class Description
e-primary Represents a primary chip.
e-success Represents a positive chip.
e-info Represents an informative chip.
e-warning Represents a chip with caution.
e-danger Represents a negative chip.
tagHelper
default.cs
<ejs-chiplist id="chip-avatar" enableDelete="true">
    <e-chips>
      <e-chip text="Primary" cssClass="e-primary" enabled="true"></e-chip>
      <e-chip text="Success" cssClass="e-success" enabled="true"></e-chip>
      <e-chip text="Info" cssClass="e-info" enabled="true"></e-chip>
      <e-chip text="Warning" cssClass="e-warning" enabled="true"></e-chip>
      <e-chip text="Danger" cssClass="e-danger" enabled="true"></e-chip>
    </e-chips>
</ejs-chiplist>
public IActionResult Index()
    {
            return View();
    }

Leading Icon

You can add and customize the leading icon of chip using the leadingIconCss property.

tagHelper
default.cs
<ejs-chiplist id="chip-avatar">
    <e-chips>
      <e-chip text="Andrew" leadingIconCss="andrew" enabled="true"></e-chip>
      <e-chip text="Janet" leadingIconCss="janet" enabled="true"></e-chip>
      <e-chip text="Laura" leadingIconCss="laura" enabled="true"></e-chip>
      <e-chip text="Margaret" leadingIconCss="margaret" enabled="true"></e-chip>    
    </e-chips>
</ejs-chiplist>

<style>
  #chip-avatar .andrew {
    background-image: url('./andrew.png')
  }

  #chip-avatar .margaret {
    background-image: url('./margaret.png')
  }

  #chip-avatar .laura {
    background-image: url('./laura.png')
  }

  #chip-avatar .janet {
    background-image: url('./janet.png')
  }
</style>
public IActionResult Index()
    {
            return View();
    }

Avatar

You can add and customize the avatar of chip using the avatarIconCss property.

tagHelper
default.cs
<ejs-chiplist id="chip-avatar">
    <e-chips>
      <e-chip text="Andrew" avatarIconCss="andrew" enabled="true"></e-chip>
      <e-chip text="Janet" avatarIconCss="janet" enabled="true"></e-chip>
      <e-chip text="Laura" avatarIconCss="laura" enabled="true"></e-chip>
      <e-chip text="Margaret" avatarIconCss="margaret" enabled="true"></e-chip>    
    </e-chips>
</ejs-chiplist>

<style>
  #chip-avatar .andrew {
    background-image: url('./andrew.png')
  }

  #chip-avatar .margaret {
    background-image: url('./margaret.png')
  }

  #chip-avatar .laura {
    background-image: url('./laura.png')
  }

  #chip-avatar .janet {
    background-image: url('./janet.png')
  }
</style>
public IActionResult Index()
    {
            return View();
    }

Avatar Content

You can add and customize the avatar content of chip using the avatarText property.

tagHelper
default.cs
<ejs-chiplist id="chip-avatar">
    <e-chips>
      <e-chip text="Andrew" AvatarText="A" enabled="true"></e-chip>
      <e-chip text="Janet" AvatarText="J" enabled="true"></e-chip>
      <e-chip text="Laura" AvatarText="L" enabled="true"></e-chip>
      <e-chip text="Margaret" AvatarText="M" enabled="true"></e-chip>    
    </e-chips>
</ejs-chiplist>
public IActionResult Index()
    {
            return View();
    }

Trailing Icon

You can add and customize the trailing icon of chip using the trailingIconCss property.

tagHelper
default.cs
<ejs-chiplist id="chip-avatar">
    <e-chips>
      <e-chip text="Andrew" trailingIconCss="e-dlt-btn" enabled="true"></e-chip>
      <e-chip text="Janet" trailingIconCss="e-dlt-btn" enabled="true"></e-chip>
      <e-chip text="Laura" trailingIconCss="e-dlt-btn" enabled="true"></e-chip>
      <e-chip text="Margaret" trailingIconCss="e-dlt-btn" enabled="true"></e-chip>    
    </e-chips>
</ejs-chiplist>
public IActionResult Index()
    {
            return View();
    }

Outline Chip

Outline chip has the border with the background transparent. It can be set using the cssClass property.

tagHelper
default.cs
<div>
    <ejs-chiplist id="chip" cssClass="e-outline">
        <e-chips>
            <e-chip text="Chai"></e-chip>
            <e-chip text="Chang"></e-chip>
            <e-chip text="Aniseed Syrup"></e-chip>
            <e-chip text="Ikura"></e-chip>
        </e-chips>
    </ejs-chiplist>
    <ejs-chiplist id="chip" cssClass="e-outline" enableDelete="true">
        <e-chips>
            <e-chip text="Andrew"></e-chip>
            <e-chip text="Janet"></e-chip>
            <e-chip text="Laura"></e-chip>
            <e-chip text="Margaret"></e-chip>
        </e-chips>
    </ejs-chiplist>
</div>
public IActionResult Index()
    {
            return View();
    }