Socket
Book a DemoInstallSign in
Socket

tw-react-components

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tw-react-components

A set of React components build with TailwindCSS to make a nice dashboard.

latest
Source
npmnpm
Version
0.0.197
Version published
Weekly downloads
45
-15.09%
Maintainers
1
Weekly downloads
 
Created
Source

TailwindCSS React Components

NPM Version codecov License: MIT

A comprehensive library of React components built with TailwindCSS for creating beautiful and responsive dashboards.

Demo

Check out the live demo to see the components in action.

Features

  • 🎨 Beautiful UI components built with TailwindCSS
  • 🌙 Light and dark mode support
  • 📱 Fully responsive design
  • ♿ Accessible components using Radix UI
  • 🧩 Customizable and extensible
  • 🧪 Well-tested with comprehensive test coverage

Installation

# Using npm
npm install tw-react-components

# Using yarn
yarn add tw-react-components

# Using pnpm
pnpm add tw-react-components

Requirements

  • React 18 or later
  • TailwindCSS 3

Setup

1. Configure TailwindCSS

Add the required plugins to your tailwind.config.js:

module.exports = {
  content: [
    // ...
    './node_modules/tw-react-components/**/*.{js,ts,jsx,tsx}',
  ],
  plugins: [
    require('@tailwindcss/forms'),
    require('tailwindcss-animate'),
    // Include the custom plugin from tw-react-components (optional)
    require('tw-react-components/tailwindcss-plugin'),
  ],
};

2. Import the CSS

Add the following import to your main CSS file:

@import 'tw-react-components/index.css';

Available Components

This library provides a wide range of components:

  • Layout: Building blocks for page layouts

    • Layout - Main container for your application
    • Flex - Flexible box layout component
    • Block - Block-level layout component
    • Card - Container with styling and functionality
  • Navigation:

    • Navbar - Top navigation bar
    • Sidebar - Side navigation component
    • Tabs - Tabbed interface component
  • Data Display:

    • Table - Regular table component
    • DataTable - Advanced data table with sorting and filtering
    • List - Displaying lists of data
    • ListSorter - Sortable list component
    • Badge - Small status indicator
  • Input & Form:

    • Button - Various button styles
    • Form - Form controls and helpers
    • Switch - Toggle switch component
  • Feedback & Overlay:

    • Dialog - Modal dialog boxes
    • Popover - Content that appears over the UI
    • Tooltip - Information shown on hover
    • Sheet - Slide-in panels
    • Skeleton - Loading placeholders
    • Spinner - Loading indicator
    • Hint - Contextual hints and tips
  • Utilities:

    • Separator - Visual dividers
    • Collapsible - Expandable/collapsible content
    • DropdownMenu - Menu that appears on click
    • Pagination - Navigate through pages of content
    • ThemeSelector - Toggle between light and dark themes

Usage

import React from 'react';

import { Button, Card, Flex } from 'tw-react-components';

function MyComponent() {
  return (
    <Card className="p-4">
      <h2 className="text-lg font-medium">Card Title</h2>
      <p className="mt-2 text-sm text-gray-500">Card content goes here</p>

      <Flex className="mt-4 justify-end gap-2">
        <Button variant="outline">Cancel</Button>
        <Button>Submit</Button>
      </Flex>
    </Card>
  );
}

Development

This project uses Nx as a build system and Yarn as a package manager.

# Install dependencies
yarn

# Start the development server
yarn start

# Build the library
yarn build

# Run tests
yarn test

# Lint the code
yarn lint

# Format the code
yarn prettier:fix

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add some amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

FAQs

Package last updated on 21 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts