@udecode/cn exports one class-name helper and re-exports
@udecode/react-utils.
import { cn } from '@udecode/cn';
export function Button({
active,
className,
...props
}: React.ComponentProps<'button'> & { active?: boolean }) {
return (
<button
className={cn(
'inline-flex rounded-md px-3 py-2',
active && 'bg-accent',
className
)}
{...props}
/>
);
}Write concrete components directly. Keep defaults, variants, and React 19
ref props visible in their owning component instead of wrapping it in a
component factory.
import { cn } from '@udecode/cn';
export function Button({
active,
className,
...props
}: React.ComponentProps<'button'> & { active?: boolean }) {
return (
<button
className={cn(
'inline-flex rounded-md px-3 py-2',
active && 'bg-accent',
className
)}
{...props}
/>
);
}