darshan-rajadhyaksha

Chip

Component

About

A compact labeled chip for showing a value, category, status, or interactive tag, with optional avatar/icon, a delete action, semantic color variants, and small/medium/large sizes. React port of the Chip component from Darshan Rajadhyaksha's SolidJS RockSolid component library.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Chip to your project and fits it to your theme.

Code

How Chip is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import type { MouseEvent } from "react";
import Chip from "@/components/ui/chip";

export default function Example() {
  const handleDelete = (event: MouseEvent) => {
    console.log("Chip deleted", event);
  };
  return (
    <div className="flex gap-4">
      <Chip
        label="Chip 1"
        variant="solid"
        onDelete={handleDelete}
        onClick={() => {}}
      />
      <Chip label="Chip 2" onDelete={handleDelete} />
    </div>
  );
}

Dependencies

More by darshan-rajadhyaksha

View all
  • Backdrop

    Backdrop

    1
  • Switch

    Switch

  • Avatar

    Avatar

  • Progress Bar

    Progress Bar

  • Accessible Dialog

    Accessible Dialog

  • Input

    Input

  • Card Content

    Card Content

  • Breadcrumbs

    Breadcrumbs