Start building beautiful interfaces with Canx UI components.
✨ Recommendation
If you used create-canx v1.0.6+, Canx UI and Tailwind CSS are already installed and configured! You can skip this page.
Canx UI is built on top of React and Tailwind CSS. Make sure your project meets these requirements:
Install the canx-ui package using your preferred package manager:
bun add canx-uinpm install canx-uipnpm add canx-uiyarn add canx-uiCanx UI is designed to be compatible with both Tailwind CSS v3 and v4.
Ensure your CSS variables are defined in your global CSS. When you run init, we provide the compatible CSS variables.
You also need to ensure that your project is configured to scan the `src` directory for class names.
Update your tailwind.config.js file to scan the component files if you are not using the modular CLI (copy-paste method):
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{ts,tsx}",
// If you installed the full package via npm:
"./node_modules/canx-ui/dist/**/*.{js,ts,jsx,tsx}"
],
theme: {
extend: {},
},
plugins: [],
}We recommend using the CLI to initialize your project. This will set up the necessary utilities (cn helper) and prepare your project for adding components.
npx canx-ui initThis command creates src/lib/utils.ts.
You can now add individual components to your project. This will copy the component source code to your src/components/ui directory, allowing you to fully customize them.
npx canx-ui add buttonThis method is favored over installing the full library as it gives you complete ownership of the code and reduces bundle size.