Tailwindcss Radix screenshot

Tailwindcss Radix

Author Avatar Theme by Ecklf
Updated: 7 Apr 2025
2151 Stars

Utilities and variants for styling Radix state

Categories

Overview:

The tailwindcss v3 library is designed to provide classnames for accessing Radix data attributes, allowing for improved auto-completion compared to using data-* variants. Essentially, it functions as the @headlessui-tailwindcss for Radix components.

Features:

  • Installation: Easily add the plugin to your project plugins array.
  • Options: Offers various styling state options for customization.
  • Accessing parent and sibling state: Allows for styling based on parent or sibling element states.
  • Disabled state: Supports generated disabled variant for elements.
  • CSS Variable Utilities: Includes utilities for dealing with CSS variables for layout and positioning.
  • Migration from v1 and v2: Provides guidance on migrating from previous versions while noting specific changes.

Installation:

To install the tailwindcss v3 library, add the plugin to your project’s plugins array. Here is a basic guide on how to do it:

  1. Install the library via npm:

    npm install tailwindcss
    
  2. Add the plugin to your Tailwind CSS configuration file:

    module.exports = {
      // Other configurations...
      plugins: [
        require('tailwindcss'),
        require('@tailwindcss/custom-forms'),
        // Add the tailwindcss-v3 plugin here
      ],
    };
    

Summary:

The tailwindcss v3 library enhances the styling capabilities for Radix components by providing classnames for accessing data attributes. It offers features such as styling states, disabled variants, CSS variable utilities, and migration assistance. By following the installation guide and exploring the various options, developers can efficiently customize styles for Radix components within their projects.