alwkala

Chip

Component

About

A small removable pill-shaped tag used for filters, selections, or category labels, with size and color variants.

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

"use client";
import React from "react";
import Chip from "@/components/ui/chip";

function ChipDemo() {
  const [tags, setTags] = React.useState([
    { id: "fatimid", label: "قاهرة الفاطمية", variant: "primary" },
    { id: "active", label: "المكونات النشطة", variant: "default" },
  ]);

  const removeTag = (id) => {
    setTags((prev) => prev.filter((t) => t.id !== id));
  };

  return (
    <div className="flex flex-wrap gap-3 bg-background p-6 rounded-2xl border border-border">
      <Chip label="الكل" />
      {tags.map((tag) => (
        <Chip
          key={tag.id}
          label={tag.label}
          variant={tag.variant}
          onRemove={() => removeTag(tag.id)}
        />
      ))}
    </div>
  );
}

export default ChipDemo;

More by alwkala

View all
  • Callout

    Callout

    9
  • Progress Bar

    Progress Bar

    2
  • Kbd

    Kbd

  • Pagination

    Pagination

  • Back To Top

    Back To Top

  • Checkbox

    Checkbox

  • Seal

    Seal

  • Egyptian Sidebar Menu

    Egyptian Sidebar Menu