lara-light-indigo

Chip

Chip represents entities using icons, labels and images.

Basic
Action
Comedy
Mystery
Thriller
Icon
Apple
Facebook
Google
Microsoft
Image
chipAmy Elsner
chipAsiya Javayant
chipOnyama Limba
chipXuxue Feng
Styling
Action
Apple
chipOnyama Limba
chipXuxue Feng
Import via Module

import { Chip } from 'primereact/chip';
 
Import via CDN

<script src="https://unpkg.com/primereact/core/core.min.js"></script>
<script src="https://unpkg.com/primereact/chip/chip.min.js"></script>
 
Getting Started

Chip can display labels, icons and images.


<Chip label="Text Only" />
<Chip label="Text with icon" icon="pi pi-check" />
<Chip label="Text with image" image="user.png" />
 
Removable

Setting removable property displays an icon to close the chip, the optional onRemoveevent is available to get notified when a chip is hidden.


<Chip label="Text" removable />
 
Templating

Content can easily be customized with the template property instead of using the built-in modes.


<Chip template="Content" />
<Chip template={<span>Content<span>} />
<Chip template={(props) => <span>Content<span>} />
 
Properties
NameTypeDefaultDescription
labelstringnullDefines the text to display.
iconstringnullDefines the icon to display.
imagestringnullDefines the image to display.
removablebooleanfalseWhether to display a remove icon.
removeIconstringpi pi-times-circleIcon of the remove element.
stylestringnullInline style of the element.
classNamestringnullStyle class of the element.
templateanynullTemplate of an item.
imageAltanynullIt specifies an alternate text for an image, if the image cannot be displayed.
Events
NameParametersDescription
onRemoveevent: Browser eventCallback to invoke when a chip is removed.
onImageErrorevent: Browser eventThis event is triggered if an error occurs while loading an image file.
Styling

Following is the list of structural style classes, for theming classes visit theming page.

NameElement
p-chipContainer element.
p-chip-imageContainer element in image mode.
p-chip-textText of the chip.
pi-chip-remove-iconRemove icon.
Dependencies

None.

Component Scale

Input Style

Ripple Effect

Free Themes

Built-in component themes created by the PrimeReact Theme Designer.

Bootstrap
Blue
Purple
Blue
Purple
Material Design
Indigo
Deep Purple
Indigo
Deep Purple
Material Design Compact
Indigo
Deep Purple
Indigo
Deep Purple
Tailwind
Tailwind Light
Fluent UI
Blue
PrimeOne Design - 2022 NEW
Lara Indigo
Lara Blue
Lara Purple
Lara Teal
Lara Indigo
Lara Blue
Lara Purple
Lara Teal
PrimeOne Design - 2021
Saga Blue
Saga Green
Saga Orange
Saga Purple
Vela Blue
Vela Green
Vela Orange
Vela Purple
Arya Blue
Arya Green
Arya Orange
Arya Purple
Premium Themes

Premium themes are only available exclusively for PrimeReact Theme Designer subscribers and therefore not included in PrimeReact core.

Soho Light
Soho Dark
Viva Light
Viva Dark
Mira
Nano

Legacy Free Themes

Nova
Nova Alt
Nova Accent
Luna Blue
Luna Green
Luna Amber
Luna Pink
Rhea

Premium Create-React-App Templates

Beautifully crafted premium create-react-app application templates by the PrimeTek design team.

Sakai
Atlantis
Freya
Ultima
Diamond
Sapphire
Serenity
Babylon
Avalon
Apollo
Roma