Skip to Content
Archi-ui 1.0.25 is released 🎉

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.

Basic Chip

The chip component supports outlined and filled styling.

Usage

import { Chip } from 'archi-ui'
<Chip>Basic Chip</Chip>

Chip actions

You can use the following actions.

  • Chips with the onClick prop defined change appearance on focus, hover, and click.
  • Chips with the onDelete prop defined will display a delete icon which changes appearance on hover.

Chip clickable

Chip Deletable

Clickable and deletable

To use the chip component as hyperlink, just pass href prop or change the root element to <a> tag using component prop.

Custome delete icon

Use the deleteIcon prop to override an default delete icon. Your deleteIcon can be an SVG icon, or a React component.

Chip adornments

You can add ornaments to the beginning of the component.

Use the avatar prop to add an avatar or use the icon prop to add an icon.

Avatar Chip

Icon Chip

Chip color

Use color prop to apply different colors for component.

Chip Size

Use size prop to change the size of the button.

Chip with badge

10
10

Chip array

An example of rendering multiple chips from n array of values, Deleting a chip removes it from the array.

Example: Filter the Movie Genres, and fetch the API for the filtered data to display movie details.

Chip API

API reference docs for the React Chip component.

Props

NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Override or extend the styles applied to the component.
variant'filled' | 'outlined''filled'The variant to use.
size'sm' | 'md''md'The size of the component.
color'default' | 'primary' | 'secondary' | 'info' | 'warning' | 'success' | 'error''default'The color of the component.
disabledboolfalseIf true, the component is disabled.
clickablebool-If true, the chip will be appear clickable, and will raise when pressed, even if the onClick prop is not defined. If false, the chip will not appear clickable, even if onClick prop is defined. This can be used, for example, along with the component prop to indicate an anchor Chip is clickable. Note: this controls the UI and does not affect the onClick event.
componentelementType-The component used for the root node. Either a string to use a HTML element or a component.
hrefstring-The URL to link to when the button is clicked. If defined, an <a> element will be used as the root node.
avatarelement-The Avatar element to display.
iconnode-Icon element.
deleteIconelement-Override the default delete icon element. Shown only if onDelete is set.
onDeletefunc-Callback fired when the delete icon is clicked. If set, the delete icon will be shown.
Last updated on