Guide
Components
Chip

Chip Component

A versatile and customizable React component for displaying interactive chips.

Example Preview

Chip Example

Usage

import React from "react";
import { Chip } from "@/@core";
 
const MyComponent = () => {
  const handleChipClick = () => {
    // Handle chip click event
  };
 
  const handleDelete = () => {
    // Handle chip delete event
  };
 
  return (
    <Chip
      label="Example Chip"
      onClick={handleChipClick}
      onDelete={handleDelete}
      size="medium"
      color="primary"
      variant="filled"
      skin="light"
      rounded={false}
      // Add other props as needed
    />
  );
};
 
export default MyComponent;

Props

PropTypeDescription
labelstringThe text content of the chip.
onClick() => voidA callback function to be executed when the chip is clicked.
componentElementTypeThe HTML element type or React component to be used for the chip. Defaults to 'div'.
hrefstringThe URL to navigate to when the chip is clicked.
targetstringThe target attribute for the link specified in href.
clickablebooleanIf true, the chip will be clickable, triggering the onClick or navigation to href.
iconReactNodeAn optional icon element to be displayed within the chip.
colorprimary secondary, success, warning, error, info, accent, baseThe color of the chip. Defaults to 'base'.
variantstringThe visual style variant of the chip (e.g., filled, outlined). Defaults to 'filled'.
sizesmall medium largeThe size of the chip.
skinlight, dark'The color scheme of the chip.
roundedbooleanIf true, the chip will have rounded corners.
onDelete() => voidA callback function to be executed when the delete icon is clicked.
deleteIconReactNodeAn optional delete icon element to be displayed within the chip.
classNamestringAdditional CSS classes to be applied to the chip.

Examples

// Import the Chip component
import { Chip } from "@/@core";
 
// Create a simple chip
const SimpleChip = () => {
  return <Chip label="Simple Chip" />;
};
 
// Create a clickable chip with an icon
const ClickableChip = () => {
  return (
    <Chip
      label="Clickable Chip"
      onClick={() => alert("Chip clicked")}
      clickable
      icon={<YourIconComponent />}
    />
  );
};
 
// Create a chip with delete functionality
const DeletableChip = () => {
  return (
    <Chip
      label="Deletable Chip"
      onDelete={() => alert("Delete icon clicked")}
      deleteIcon={<YourDeleteIconComponent />}
    />
  );
};

Feel free to customize the Chip component according to your application's needs.