Customization
className
Every component accepts className. Classes are merged with tailwind-merge, so your utilities override conflicting defaults instead of fighting them.
<Button className="rounded-full px-8">Pill</Button>cn()
The same merge helper is exported for your own components. It understands datui's type scale.
import { cn } from "datui";
cn("text-title-1 px-2", isActive && "text-primary px-4"); // "text-title-1 text-primary px-4"Variant functions
Components with visual variants export their class-variance-authority function (for example buttonVariants) so you can style other elements to match.
import { buttonVariants } from "datui";
import Link from "next/link";
<Link href="/pricing" className={buttonVariants({ variant: "outline" })}>Pricing</Link>Icon motion
datui's built-in close, chevron, search, send and calendar icons are animated versions of lucide icons (adapted from lucide-animated). They play when the surrounding button, link or field is hovered or keyboard-focused. Check marks draw in with CSS. For icons you pass into datui slots, use the CSS classes below. Motion turns off automatically when the user prefers reduced motion.
dt-icon-draw— strokes draw in when the icon mounts (set--dt-icon-draw-lengthfor long paths)dt-icon-pop— scales in when the icon mounts, for icon swapsdt-icon-turn,dt-icon-nudge,dt-icon-nudge-back,dt-icon-tilt— react when the surrounding button or link is hovered or keyboard-focused
import { Button } from "datui";
import { ArrowRight } from "lucide-react";
<Button after={<ArrowRight className="dt-icon-nudge size-icon-sm" />}>Next</Button>Composition
Slots such as before, after and subtitle accept any node, and interactive components accept as to render a different element or a router link component.