Chip Group
BsChipGroup extends the BsChip component by providing groupable functionality. It is used for creating groups of selections using chips.
Overview
<bs-chip-group>
is a collection of <bs-chip>
. Rather than create multiple <bs-chip>
, it’s better to create single <bs-chip-group>
. <bs-chip-group>
provides select functionality, which will come in handy when working with more chips. The items
property is used as data source to create the chips.
Multi Rows
If the total width of chip items exceeds the container's width, use column
property to wrap chip items.
Multiple Selection
By default <bs-chip-group>
works in single selection mode. Use multiple
property to enable multiple selection mode.
Filter Chips
Filter chips use tags or descriptive words to filter content. It creates an alternative visual style that communicates to the user that the chip is selected. They are a good alternative to toggle buttons or checkboxes. Use checked-icon
property to enable this feature. Additionally, you can use active-class
property to change the appearance of the selected chips.
Enabling Avatar
Additionally, each chips can also has avatar. This can be achieved by providing the imgSrc
on the chips data source.
Sliding Chips
Sliding Chips is used when the total width of chip items exceed the container's width, but still wants to keep it within a single row. When enabled, it creates a visual style like slide carousel. Left and right arrows button is provided as a navigation functionality. To enable this feature, use the slider-button
property explicitly.
API Reference
TChipOptionItem
The Chip's item has properties as described below:
Property | Type | Description |
---|---|---|
id | String | <BsChip> element ID. |
text required | String | The item text. |
value | String /Number /Boolean | The item value. |
disabled | Boolean | <BsChip> element state. |
dismissible | Boolean | Enable dismissible <BsChip> . |
href | String | Render <BsChip> as <a> element and define its href property and apply chip styles to the <a> element. |
icon | String | The icon to display inside the <BsChip> . Updated on v2.1.0 Use any valid android icon name from Google Material Symbols with or without a suffix. Valid suffixes are: iconVariant property. |
iconFlip | String | Flip the icon. Valid values are: horizontal , vertical , both . |
iconPulse | Boolean | Apply pulse animation to the icon. |
iconSpin | Boolean | Apply spin animation to the icon. |
iconRotation | Number | Rotate the icon. Valid values are: 90 , 180 , 270 . |
iconVariant | String | Predefined icon style variant. Valid values are: outlined , rounded , sharp , filled , outlined_filled , rounded_filled , and sharp_filled . Updated on v2.1.0 |
imgSrc | String | <BsChip> avatar image source url. |