# Chip

Chips are compact elements that represent an input, attribute, or action.

Chips allow users to enter information, make selections, filter content, or trigger actions.

While included here as a standalone component, the most common use will be in some form of input, so some of the behavior demonstrated here is not shown in context.

## Basic Chips

![](https://2374445323-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MAgA8lkflyE8DVzEwHy%2F-MAgCN-yRLeQDnFB8rzN%2Fimage.png?alt=media\&token=0dafd0c5-bf85-439f-b433-31a958590bae)

```
 New-UDChip -Label 'Basic'
```

## Chips with Icons

![](https://2374445323-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MAgA8lkflyE8DVzEwHy%2F-MAgCOpgYqKULdexls2Y%2Fimage.png?alt=media\&token=abc622b1-5d37-4fbf-9317-4367752055e8)

```
New-UDChip -Label 'Basic' -Icon (New-UDIcon -Icon 'user')
```

## OnClick

Shows a toast when the chip is clicked.

```
New-UDChip -Label 'OnClick' -OnClick {
    Show-UDToast -Message 'Hello!'
}
```

## OnDelete

```
New-UDChip -Label 'OnDelete' -OnClick {
    Show-UDToast -Message 'Goodbye!'
}
```

**New-UDChip**

| Name       | Type      | Description                                            | Required |
| ---------- | --------- | ------------------------------------------------------ | -------- |
| Id         | String    | The ID of the component. It defaults to a random GUID. | false    |
| Label      | String    | The label for the chip.                                | false    |
| OnDelete   | Object    | A script block to call when the chip is deleted.       | false    |
| OnClick    | Object    | A script block to call when the chip is clicked.       | false    |
| Icon       | Object    | An icon to show within the chip.                       | false    |
| Style      | Hashtable | CSS styles to apply to the chip.                       | false    |
| Variant    | String    | The theme variant to apply to the chip.                | false    |
| Avatar     | String    | An avatar to show within the chip.                     | false    |
| AvatarType | String    | The type of avatar to show in the chip.                | false    |
