taw-ui
Guide

Theming

Zero custom tokens. shadcn theming, out of the box.

taw-ui components use the same CSS variables as your shadcn components. If your theme works with shadcn, it works with taw-ui. No extra configuration.

The Mental Model

taw-ui doesn't introduce its own design token system. Components use standard shadcn/Tailwind classes: bg-card, text-foreground, text-muted-foreground, border, bg-destructive, text-primary, and so on. Your existing theme cascade handles everything.

Your Theme
CSS Variable
taw-ui Component
--card: 0 0% 100%
--card
bg-card
--foreground: 222 84% 5%
--foreground
text-foreground
--border: 214 32% 91%
--border
border
--primary: 222 47% 11%
--primary
text-primary
Your globals.cssStandard shadcn variablesTailwind utility class

How It Works

taw-ui components just work with your existing shadcn setup. Here's what your globals.css already looks like:

globals.css
/* globals.css — your existing shadcn theme */
@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --primary: 222.2 47.4% 11.2%;
    --muted: 210 40% 96%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --destructive: 0 84.2% 60.2%;
    --border: 214.3 31.8% 91.4%;
  }
  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    /* ... */
  }
}

That's it. No taw-ui-specific setup. Components read from these standard variables.

Token Mapping

Here's which shadcn tokens taw-ui components use, and where:

Component AreaToken Used
Card backgroundsbg-card
Primary texttext-foreground
Secondary texttext-muted-foreground
Bordersborder
Accents / CTAstext-primary, bg-primary
Error statestext-destructive, bg-destructive
Success indicatorstext-emerald-600 dark:text-emerald-400
Warning indicatorstext-amber-600 dark:text-amber-400

For semantic colors like success and warning, components use Tailwind's built-in color utilities with dark: modifiers rather than shadcn tokens, since shadcn doesn't define these.

Dark Mode

Dark mode works the same way it does with shadcn — add the dark class to your <html> element. taw-ui components respond to the same .dark cascade. For semantic colors like success and warning, components use Tailwind's dark: modifier.

<!-- Dark mode toggle  same as any shadcn app -->
<html class="dark">
  <!-- All taw-ui components automatically use dark theme values -->
</html>

Customization

To customize taw-ui components, you have two paths:

1. Change your shadcn theme

Update the CSS variables in globals.css. All components — both shadcn and taw-ui — update automatically.

2. Edit the component

The component lives in your project. Open the file and change classes, layout, or behavior directly.

Example: warmer card backgrounds
globals.css
/* Want a warmer card background? Change the shadcn token */
:root {
  --card: 30 20% 99%;
}

Best Practices

Use shadcn tokens for theme-aware colors that respond to dark mode automatically
Hardcode hex values in component classes — they won't respond to theme changes
Use Tailwind utilities for fixed colors (emerald, amber, red) with dark: modifiers
Rely on shadcn tokens for semantic colors (success, warning) that shadcn doesn't define
Test both light and dark mode after theme changes
Override light mode variables and forget the .dark counterpart

taw-ui uses Tailwind v4's (--var) syntax for CSS variable references in utility classes. This is the standard approach in Tailwind v4 projects.

Troubleshooting

?Components look unstyled

Make sure your shadcn setup is complete. Run npx shadcn@latest init if you haven't.

?Colors don't match my theme

taw-ui uses standard shadcn tokens. Check that your globals.css defines --card, --foreground, --muted-foreground, --primary, --border, and --destructive.

Theming is simple because it's not ours.

taw-ui follows your shadcn theme. No custom tokens to learn, no extra CSS to import. Change your theme and every component updates with it.