Add Utilities

Commonly used utilities for using Layer UI

Install dependencies

npm install tailwindcss@latest clsx tailwind-merge framer-motion 

Add util file

Copy and paste the following code into your project lib/utils.ts.

import {ClassValue, clsx} from "clsx";
import {twMerge} from "tailwind-merge";
import DocsCode from '../../../../../../packages/ui/src/componentpreview/DocsCode';


export function cn(...inputs: ClassValue[]) {
    return twMerge(clsx(inputs));
} 

Copy & Paste

Absolutely! Now you can visit any component page and follow the provided instructions. Simply copy and paste the components you need, without any unnecessary bloat or third-party dependencies.

Success