The ChipList control has the following types.
Input Chip holds information in compact form. It converts user input into chips.
import { ChipList } from '@syncfusion/ej2-buttons';
new ChipList({chips: ['Andrew', 'Janet', 'Laura', 'Margaret']}, '#chip');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Chip</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet" />
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<body>
<div id='loader'>LOADING....</div>
<div id='container'>
<div id="chip"></div>
</div>
</body>
</html>
#container {
visibility: hidden;
display: inline-block;
position: relative;
left: 50%;
top: 100px;
transform: translateX(-50%);
}
#loader {
color: #008cff;
height: 40px;
width: 30%;
position: absolute;
font-family: 'Helvetica Neue','calibiri';
font-size:16px;
top: 45%;
left: 45%;
}
Choice Chip allows you to select a single chip from the set of ChipList/ChipCollection. It can be enabled by setting the selection
property to Single
.
import { ChipList } from '@syncfusion/ej2-buttons';
new ChipList({chips: ['Small', 'Medium', 'Large', 'Extra Large'], selection: "Single"}, '#chip');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Chip</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet" />
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<body>
<div id='loader'>LOADING....</div>
<div id='container'>
<div id="chip"></div>
</div>
</body>
</html>
#container {
visibility: hidden;
display: inline-block;
position: relative;
left: 50%;
top: 100px;
transform: translateX(-50%);
}
#loader {
color: #008cff;
height: 40px;
width: 30%;
position: absolute;
font-family: 'Helvetica Neue','calibiri';
font-size:16px;
top: 45%;
left: 45%;
}
Filter Chip allows you to select a multiple chip from the set of ChipList/ChipCollection. It can be enabled by setting the selection
property to Multiple
.
import { ChipList } from '@syncfusion/ej2-buttons';
new ChipList({chips: ['Chai', 'Chang', 'Aniseed Syrup', 'Ikura'], selection: "Multiple"}, '#chip');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Chip</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet" />
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<body>
<div id='loader'>LOADING....</div>
<div id='container'>
<div id="chip"></div>
</div>
</body>
</html>
#container {
visibility: hidden;
display: inline-block;
position: relative;
left: 50%;
top: 100px;
transform: translateX(-50%);
}
#loader {
color: #008cff;
height: 40px;
width: 30%;
position: absolute;
font-family: 'Helvetica Neue','calibiri';
font-size:16px;
top: 45%;
left: 45%;
}
The Action Chip triggers the event like click or delete, which helps doing action based on the event.
import { ChipList } from '@syncfusion/ej2-buttons';
new ChipList({chips: ['Send a text', 'Set a remainder', 'Read my emails ', 'Set alarm'],
click: (e: ClickEventArgs)=>{
alert('you have clicked ' + e.text)
} }, '#chip');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Chip</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet" />
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<body>
<div id='loader'>LOADING....</div>
<div id='container'>
<div id="chip"></div>
</div>
</body>
</html>
#container {
visibility: hidden;
display: inline-block;
position: relative;
left: 50%;
top: 100px;
transform: translateX(-50%);
}
#loader {
color: #008cff;
height: 40px;
width: 30%;
position: absolute;
font-family: 'Helvetica Neue','calibiri';
font-size:16px;
top: 45%;
left: 45%;
}
Deletable Chip allows you to delete a chip from ChipList/ChipCollection. It can be enabled by setting the enableDelete
property to true
.
import { ChipList } from '@syncfusion/ej2-buttons';
new ChipList({chips: ['Send a text', 'Set a remainder', 'Read my emails ', 'Set alarm'], enableDelete: true}, '#chip');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Chip</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet" />
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<body>
<div id='loader'>LOADING....</div>
<div id='container'>
<div id="chip"></div>
</div>
</body>
</html>
#container {
visibility: hidden;
display: inline-block;
position: relative;
left: 50%;
top: 100px;
transform: translateX(-50%);
}
#loader {
color: #008cff;
height: 40px;
width: 30%;
position: absolute;
font-family: 'Helvetica Neue','calibiri';
font-size:16px;
top: 45%;
left: 45%;
}