Menu

Chip

Filter / input tag. 3 styles × 4 states.

Installation

$ npx uix-ui@latest add chip

This copies the file into components/ui/chip.tsx in your project. npx shadcn@latest add @uix/chip works too.

Usage

chip.tsx
import { Chip } from "@/components/ui/chip";

<div className="flex flex-wrap items-center gap-2">
  <Chip appearance="filled">Filled</Chip>
  <Chip appearance="outline">Outline</Chip>
  <Chip appearance="soft">Soft</Chip>
  <Chip appearance="outline" disabled>Disabled</Chip>
</div>

Examples

Appearances

Removable

Props

PropTypeDefaultDescription
appearancefilled | outline | soft"filled"
selectedbooleanfalse
disabledbooleanfalse
onClickReact.MouseEventHandler<HTMLButtonElement>–
leadingAvatarReact.ReactNode–Avatar before the label (for example <Avatar size="xs" initials="AB" />).
leadingIconReact.ReactNode–Icon before the label.
onRemove() => void–Shows a remove button and calls this when it is pressed.

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
  • components/ui/icons.tsx
esc

↑↓ to navigate · ↵ to select · esc to close