clsxとtailwind-mergeを組み合わせたクラス名ユーティリティ
...inputsClassValue[]| Prop | Type | Default |
|---|---|---|
...inputs | ClassValue[] | - |
classNamestring| Prop | Type | Default |
|---|---|---|
className | string | - |
import { cn } from '@k8ordo/ui';const className = cn(
'rounded-lg border px-4 py-2',
'bg-bg-mute text-fg-base',
);
// Conditional classes
const className = cn(
'rounded-lg px-4 py-2',
isActive && 'bg-bg-mute',
isError && 'bg-red-500',
);