Skip to main content
Zayne Labs UI is completely headless and unstyled by default, giving you full control over the visual presentation.

Headless Design

Components ship with:
  • No default styles - You decide how components look
  • Structural markup - Semantic HTML with proper accessibility
  • Data attributes - Hooks for CSS targeting
  • ClassName support - Standard React className prop on all components
This approach means:
  • Zero CSS conflicts with your existing styles
  • Complete design system flexibility
  • Smaller bundle sizes (no unused CSS)
  • Framework-agnostic styling approach

Using with Tailwind CSS

Zayne Labs UI is designed to work seamlessly with Tailwind CSS.

1. Import the Preset

The library includes a Tailwind preset with theme tokens and utilities:
style.css
The preset includes:
  • Theme variables - Color tokens like zu-foreground, zu-primary, zu-accent
  • Animations - Pre-configured transitions and keyframes
  • Utilities - Helper classes for common patterns

2. Theme Tokens

The preset defines CSS custom properties for theming:
theme.css
Dark mode is automatic when using .dark class or data-theme="dark".

3. Apply Tailwind Classes

Use the className prop to style components:

Default Styles Example

Some components include minimal defaults that use Tailwind’s merge utility:
card.tsx
The cnMerge utility (wraps tailwind-merge) lets you override defaults:

Using Without Tailwind

You can style components using vanilla CSS by targeting data attributes.

Target Data Attributes

Every component renders data-scope, data-part, and data-slot attributes:
styles.css
carousel.css

ClassName Prop Usage

All components accept a className prop for custom styles:

Advanced: Custom Class Name Utilities

Many components accept a classNames prop for granular control:
carousel.tsx
This pattern is used in components with multiple internal elements that need independent styling.

Best Practices

Leverage the built-in theme tokens (zu-primary, zu-foreground, etc.) for consistency and automatic dark mode support.
Use data attributes in your global CSS for base component styles, and className for instance-specific customization.
For Tailwind projects:
  • Keep component-specific utilities in your component files
  • Extract repeated patterns into custom Tailwind utilities
  • Use the @layer directive for organization
For vanilla CSS:
  • Create separate CSS files per component
  • Use CSS custom properties for theming
  • Follow BEM or a similar naming convention alongside data attributes

Next Steps

Component Structure

Learn about the compound component pattern

TypeScript

Explore type-safe component APIs