Skip to content

Chip

The chip component.

  • Import
    import "@tapsioss/web-components/chip";
  • Tag
    <tapsi-chip></tapsi-chip>

Properties

NameDescriptionTypeDefault Value
disabledWhether the chip is disabled or not.booleanfalse
selectedWhether the chip is selected or not.booleanfalse
sizeThe size of the chip."sm" | "md""md"
valueThe value associated with the chip.
Use it when chips are children of chip-group. This value has to be unique among sibling chips.
string-

Slots

NameDescription
-Default content slot for chip text.
leading-iconThe slot for an optional leading icon.
trailing-iconThe slot for an optional trailing icon.

TIP

You can use slot names as variables:

ts
import { Slots } from "@tapsioss/web-components/chip";

console.log(Slots.DEFAULT); // ""
console.log(Slots.LEADING_ICON); // "leading-icon"
console.log(Slots.TRAILING_ICON); // "trailing-icon"

Events

NameDescriptionType
selectFired when the chip is selected (Bubbles).SelectEvent
deselectFired when the chip is deselected (Bubbles).DeselectEvent

TIP

You can import custom event names:

ts
import { 
  SelectEvent,
  DeselectEvent
} from "@tapsioss/web-components/chip";

element.addEventListener(SelectEvent.type, handleTapsiChipSelect);
element.addEventListener(DeselectEvent.type, handleTapsiChipDeselect);