file: ./content/react/components/chip.mdx # Chip Chip은 사용자가 선택, 필터링, 전환과 같은 제어 작업을 수행할 수 있도록 돕는 Pill 형태의 컴포넌트입니다. ActionChip과 ControlChip을 통합한 새로운 컴포넌트입니다. ```tsx import { Chip } from "@/registry/ui/chip"; export default function ChipPreview() { return (
Button Chip Toggle Chip
); } ```
## Installation ```bash npx @seed-design/cli@latest add chip ``` ```bash pnpm dlx @seed-design/cli@latest add chip ``` ```bash yarn dlx @seed-design/cli@latest add chip ``` ```bash bun x @seed-design/cli@latest add chip ``` ## Props ### Chip.Button

{"Whether the element should be rendered as a child of a slot."}

}, variant: { "type": "\"solid\" | \"outlineStrong\" | \"outlineWeak\"", "default": "solid" }, size: { "type": "\"large\" | \"medium\" | \"small\"", "default": "medium" }, layout: { "type": "\"iconOnly\" | \"withText\"", "default": "withText" } }} /> ### Chip.Toggle ", "default": undefined }, rootRef: { "type": "Ref", "default": undefined }, asChild: { "type": "boolean", "default": "false", description: <>

{"Whether the element should be rendered as a child of a slot."}

}, variant: { "type": "\"solid\" | \"outlineStrong\" | \"outlineWeak\"", "default": "solid" }, size: { "type": "\"large\" | \"medium\" | \"small\"", "default": "medium" }, layout: { "type": "\"iconOnly\" | \"withText\"", "default": "withText" }, disabled: { "type": "boolean", "default": undefined }, invalid: { "type": "boolean", "default": undefined }, required: { "type": "boolean", "default": undefined }, checked: { "type": "boolean", "default": undefined }, defaultChecked: { "type": "boolean", "default": undefined }, onCheckedChange: { "type": "((checked: boolean) => void)", "default": undefined }, indeterminate: { "type": "boolean", "default": undefined } }} /> ### Chip.RadioRoot void)", "default": undefined }, asChild: { "type": "boolean", "default": "false", description: <>

{"Whether the element should be rendered as a child of a slot."}

} }} /> ### Chip.RadioItem ", "default": undefined }, rootRef: { "type": "Ref", "default": undefined }, asChild: { "type": "boolean", "default": "false", description: <>

{"Whether the element should be rendered as a child of a slot."}

}, variant: { "type": "\"solid\" | \"outlineStrong\" | \"outlineWeak\"", "default": "solid" }, size: { "type": "\"large\" | \"medium\" | \"small\"", "default": "medium" }, layout: { "type": "\"iconOnly\" | \"withText\"", "default": "withText" }, value: { "type": "string", "default": undefined }, disabled: { "type": "boolean", "default": undefined }, invalid: { "type": "boolean", "default": undefined } }} /> ## Examples ### Size: Small ```tsx import { Chip } from "@/registry/ui/chip"; export default function ChipSmall() { return (
Small Button Small Toggle
); } ```
### Size: Medium ```tsx import { Chip } from "@/registry/ui/chip"; export default function ChipMedium() { return (
Medium Button Medium Toggle
); } ```
### Size: Large ```tsx import { Chip } from "@/registry/ui/chip"; import { HStack } from "@seed-design/react"; export default function ChipLarge() { return ( Large Button Large Toggle ); } ``` ### Variant: Solid ```tsx import { Chip } from "@/registry/ui/chip"; export default function ChipSolid() { return (
Solid Button Solid Toggle
); } ```
### Variant: Outline Strong ```tsx import { Chip } from "@/registry/ui/chip"; export default function ChipOutlineStrong() { return (
Outline Strong Button Outline Strong Toggle
); } ```
### Variant: Outline Weak ```tsx import { Chip } from "@/registry/ui/chip"; export default function ChipOutlineWeak() { return (
Outline Weak Button Outline Weak Toggle
); } ```
### Prefix Icon ```tsx import { Chip } from "@/registry/ui/chip"; import { IconHeartFill } from "@karrotmarket/react-monochrome-icon"; import { Icon } from "@seed-design/react"; export default function ChipPrefixIcon() { return (
} /> With Icon Button } /> With Icon Toggle
); } ```
### Suffix Icon ```tsx import { Chip } from "@/registry/ui/chip"; import { IconChevronDownLine } from "@karrotmarket/react-monochrome-icon"; import { Icon } from "@seed-design/react"; export default function ChipSuffixIcon() { return (
Button with Suffix } /> Toggle with Suffix } />
); } ```
### Prefix Avatar 아바타와 함께 사용할 수 있습니다. ```tsx import { Chip } from "@/registry/ui/chip"; import { Avatar } from "seed-design/ui/avatar"; import { IdentityPlaceholder } from "seed-design/ui/identity-placeholder"; export default function ChipPrefixAvatar() { return (
} /> With Avatar Button } /> With Avatar Toggle
); } ```
## Migration from ActionChip/ControlChip 기존 ActionChip과 ControlChip은 새로운 Chip 컴포넌트로 통합되었습니다. ### ActionChip → Chip.Button ```tsx // Before import { ActionChip } from "@seed-design/react"; Label // After import { Chip } from "@seed-design/react"; Label ``` ### ControlChip → Chip.Toggle ```tsx // Before import { ControlChip } from "@seed-design/react"; Label // After import { Chip } from "@seed-design/react"; Label ```