Getting Started
Components
- Advanced Toast
- ArrowButton
- Arrows
- Avatar
- Backdrop
- Basic Toast
- Breadcrumb
- Button
- CardBackground
- Card
- ChatButton
- Checkbox
- Checkboxes
- Chip
- ChoiceExpander
- Clickable
- Date Field
- Dropdown
- ElasticHeight
- ExpandableCard
- Filter
- FormCheckbox
- Form Control
- Form Label
- HamburgerIcon
- Heading
- Image
- Link
- Loader
- Number Field
- Pagination
- Password
- Phone Field
- Popin
- Portal
- Prose
- Radio Group
- Radio
- Range
- Select
- SidebarLayout
- Spinner
- Switch
- Tabs
- Tag
- TextField
- ValidationMessage
'use client';
import { Chip } from '@/ui/Chip';
import { Icon } from '@clubmed/trident-icons';
export function ChipDemo() {
return (
<Chip color="sienna" size="size-32" theme="solid">
<Icon name="Error" width="16px" />
</Chip>
);
}
Installation
npx shadcn@latest add https://develop.trident-ui.pro.clubmed/r/chip.json
Usage
import { Chip } from '@/docs/lib/ui/chip';
import { Icon } from '@clubmed/trident-icons';
export function Component() {
return (
<Chip color="sienna" size="size-32" theme="solid">
<Icon name="AEXC_Fill" width="16px" />
</Chip>
);
}API Reference
Chip
| Prop | Type | Default | Description |
|---|---|---|---|
color | Colors | "sienna" | The color of the chip. Available colors: "black", "darkGrey", "green", "lavender", "lightGrey", "lightSand", "marygold", "orange", "red", "saffron", "sand", "sienna", "ultramarine", "verdigris", "wave", "white", "current". |
size | string | "size-32" | The size of the chip in pixels. Common values include "size-32", "size-40", "size-48", etc. Uses Tailwind's size utilities. |
theme | "solid" | "outline" | "light" | "dark" | "solid" | The visual theme of the chip. "solid" fills with the specified color, "outline" creates a transparent background with colored border and text, "light" applies a light sand background, and "dark" applies an ultramarine background. |
className | string | undefined | Additional CSS classes to apply to the chip. |
children | ReactNode | undefined | The content to display inside the chip, typically an icon. |
icon | IconicNames | undefined | The icon to display inside the chip. |
iconWidth | string | "24px" | The width of the icon inside the chip. |
rotation | number | undefined | The rotation of the icon inside the chip. |
Notes
- The Chip component is designed to be perfectly circular with an
aspect-squareratio - The component includes a hover effect (
hocus:bg-saffron) that changes the background to saffron on hover or focus - When using the
"light"or"dark"theme, thecolorprop is ignored as these themes have predefined colors - The chip is rendered as a
<span>element and accepts all standard span HTML attributes - The component uses the
data-name="Chip"attribute for testing and debugging purposes