🌗 Theming Guide
Our component library is built with Tailwind CSS and supports customizable theming via CSS variables, enabling both light and dark modes.
You can fully adapt the theme to match your design system.
✅ Tailwind Configuration
To enable theming, use the following tailwind.config.ts
setup:
tailwind.config.ts
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./app/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
"./node_modules/@composer-kit/**/*.{html,js,ts,jsx,tsx,mdx}", // Check your node_modules path
],
darkMode: "class",
safelist: ["dark"],
theme: {
keyframes: {
shimmer: {
"0%": { transform: "translateX(-100%)" },
"100%": { transform: "translateX(100%)" },
},
spin: {
from: { transform: "rotate(0deg)" },
to: { transform: "rotate(360deg)" },
},
"accordion-down": {
from: { height: "0" },
to: { height: "var(--radix-accordion-content-height)" },
},
"accordion-up": {
from: { height: "var(--radix-accordion-content-height)" },
to: { height: "0" },
},
},
animation: {
shimmer: "shimmer 1.5s infinite linear",
spin: "spin 1s linear infinite",
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
},
extend: {
boxShadow: {
dropShadow: "0px 1px 0px rgba(0, 0, 0, 0.4)",
},
fontFamily: {
"vietnam-pro": "var(--font-vietnam-pro)",
inter: "var(--font-inter)",
},
colors: {
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
},
},
plugins: [require("tailwindcss-animate")],
};
🎨 Global Styles & Variables
Add these styles to your global CSS file (e.g., app.css
, globals.css
):
globals.css
@tailwind base;
@tailwind components;
@tailwind utilities;
body {
font-family: Arial, Helvetica, sans-serif;
}
@layer utilities {
.text-balance {
text-wrap: balance;
}
}
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 0 0% 3.9%;
--card: 0 0% 100%;
--card-foreground: 0 0% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 0 0% 3.9%;
--primary: 0 0% 9%;
--primary-foreground: 0 0% 98%;
--secondary: 0 0% 96.1%;
--secondary-foreground: 0 0% 9%;
--muted: 0 0% 96.1%;
--muted-foreground: 0 0% 45.1%;
--accent: 0 0% 96.1%;
--accent-foreground: 0 0% 9%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 0 0% 89.8%;
--input: 0 0% 89.8%;
--ring: 0 0% 3.9%;
--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
--radius: 0.5rem;
}
.dark {
--background: 0 0% 3.9%;
--foreground: 0 0% 98%;
--card: 0 0% 3.9%;
--card-foreground: 0 0% 98%;
--popover: 0 0% 3.9%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 0 0% 9%;
--secondary: 0 0% 14.9%;
--secondary-foreground: 0 0% 98%;
--muted: 0 0% 14.9%;
--muted-foreground: 0 0% 63.9%;
--accent: 0 0% 14.9%;
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;
--border: 0 0% 14.9%;
--input: 0 0% 14.9%;
--ring: 0 0% 83.1%;
}
- {
@apply border-border;
}
body {
@apply bg-[#fff] dark:bg-[#1B1C1D] text-foreground;
}
}
🧩 Customizing Your Design System
You can override any of the CSS variables to match your brand's colors or spacing. Just modify them at the root level of your app:
globals.css
:root {
--primary: 220 90% 56%;
--primary-foreground: 0 0% 100%;
--radius: 1rem;
}
✨ Summary
- Toggle dark mode via the
dark
class - Customize themes using HSL-based CSS variables
- Fully responsive to Tailwind’s
theme()
functions
Let us know if you’d like a boilerplate starter repo with this preconfigured!