retro ui logo
RetroUI
  • Components
  • Blocks
  • Templates
  • Figma
Sign InGet Access

Getting Started

IntroductionInstallationThemesChangelogMCP ServerBlocksProTemplatesProFigma KitPro

Components

AccordionAlertAvatarBadgeBreadcrumbButtonCardCalendarCarouselCheckboxCommandDialogDrawerNewEmptyNewInputLabelLoaderMenuContext MenuPopoverProgressRadioSelectSliderSonnerSwitchTabTableTable Of ContentsNewTextareaTextToggleToggle GroupTooltip

Chart

Bar ChartUpdatedLine ChartArea ChartPie Chart

Utilities

cn
RetroUI

RetroUI

The platform for developers and designers who love unique, playful, and brutalist design.

PRODUCT
  • OS Components
  • UI Blocks
  • Templates
  • Figma Kit
  • Themes
  • Neo Screenshot
SUPPORT
  • Pricing
  • FAQ
  • Documentation
  • Changelog
  • Discord Community
  • Email Support
COMPANY
  • Blog
  • Contact
  • Terms of Use
  • Privacy Policy
Footer decoration

© 2026 AZENCOT LLC. ALL RIGHTS RESERVED.

cn

A utilily function that saves you from style conflicts.

Source

The cn utility function combines clsx and tw-merge. This enables you to construct className strings conditionally without having to worry about Tailwind CSS style conflicts.



Installation

1. Install the dependencies:

npm install clsx tailwind-merge

2. Copy the code 👇 into your lib/utils.ts file:

import clsx from "clsx";
import { ClassNameValue, twMerge } from "tailwind-merge";
 
export function cn(...classes: ClassNameValue[]) {
  return twMerge(clsx(classes));
}

Last Updated: 17 Oct, 2024

On this Page

  • Installation [#installation]