Installation

Learn how to install and configure Twistail UI components.

Dependencies

npm install radix-ui tailwind-variants lucide-react sonner next-themes cmdk \
input-otp date-fns react-day-picker recharts allotment
npm install -D tailwindcss @tailwindcss/postcss postcss postcss-load-config

Tailwind CSS

styles/global.css
@import "tailwindcss";
@import "./motion.css";
@import "./theme.css";
 
@variant dark (&:where([data-theme="dark"] *));
 
@theme inline {
    /* Base colors */
    --color-background: var(--background);
    --color-foreground: var(--foreground);
    --color-primary: var(--primary);
    --color-primary-foreground: var(--primary-foreground);
    --color-secondary: var(--secondary);
    --color-secondary-foreground: var(--secondary-foreground);
    --color-card: var(--card);
    --color-card-foreground: var(--card-foreground);
    --color-popover: var(--popover);
    --color-popover-foreground: var(--popover-foreground);
    --color-muted: var(--muted);
    --color-muted-foreground: var(--muted-foreground);
    --color-accent: var(--accent);
    --color-accent-foreground: var(--accent-foreground);
    --color-border: var(--border);
    --color-input: var(--input);
    --color-ring: var(--ring);
    --color-sidebar-foreground: var(--sidebar-foreground);
    --color-sidebar-primary: var(--sidebar-primary);
    --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
    --color-sidebar-accent: var(--sidebar-accent);
    --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
    --color-sidebar-border: var(--sidebar-border);
    --color-sidebar-ring: var(--sidebar-ring);
 
    /* Status colors */
    --color-destructive: var(--destructive);
    --color-destructive-foreground: var(--destructive-foreground);
    --color-success: var(--success);
    --color-success-foreground: var(--success-foreground);
    --color-warning: var(--warning);
    --color-warning-foreground: var(--warning-foreground);
    --color-info: var(--info);
    --color-info-foreground: var(--info-foreground);
 
    /* Chart colors */
    --color-chart-1: var(--chart-1);
    --color-chart-2: var(--chart-2);
    --color-chart-3: var(--chart-3);
    --color-chart-4: var(--chart-4);
    --color-chart-5: var(--chart-5);
    --color-sidebar: var(--sidebar);
 
    /* Scale and typography */
    --radius-sm: calc(var(--radius) - 4px);
    --radius-md: calc(var(--radius) - 2px);
    --radius-lg: var(--radius);
    --radius-xl: calc(var(--radius) + 4px);
    --font-sans: var(--font-sans);
    --font-mono: var(--font-mono);
 
    /* Sidebar width */
    --sidebar-width: var(--sidebar-width);
    --sidebar-width-mobile: var(--sidebar-width-mobile);
    --sidebar-width-icon: var(--sidebar-width-icon);
 
    /* Override gray colors (zinc) */
    --color-gray-50: var(--color-zinc-50);
    --color-gray-100: var(--color-zinc-100);
    --color-gray-200: var(--color-zinc-200);
    --color-gray-300: var(--color-zinc-300);
    --color-gray-400: var(--color-zinc-400);
    --color-gray-500: var(--color-zinc-500);
    --color-gray-600: var(--color-zinc-600);
    --color-gray-700: var(--color-zinc-700);
    --color-gray-800: var(--color-zinc-800);
    --color-gray-900: var(--color-zinc-900);
    --color-gray-950: var(--color-zinc-950);
}
 
@layer base {
    * {
        @apply border-border outline-ring/50;
    }
    html,
    body {
        @apply antialiased min-h-screen scroll-smooth;
    }
    body {
        @apply bg-background text-foreground font-sans;
    }
    button:not(:disabled),
    [role="button"]:not(:disabled) {
        cursor: pointer;
    }
}
 
/* Debug element */
@utility debug {
    border-width: 1px;
    border-style: dashed;
    border-color: #f87171;
}

Folder Structure

accordion.tsx
accordion.css.ts
index.ts
global.css
theme.css
package.json
Edit on GitHub

Last updated on

On this page