Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-tailwind-skeleton

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tailwind-skeleton

Skeleton component build using Tailwind

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
0
Weekly downloads
 
Created
Source

ReactTailwindSkeleton Components

A React component library for displaying skeleton loaders for tables and other UI elements. This package provides two main components: TableSkeleton and Skeleton. These components can be customized with various properties to fit different use cases.

Installation

To install the package, run:

npm install react-tailwind-skeleton

Usage

Importing the Components

You can import the components in your React application as follows:

import React from "react";
import { Skeleton, TableSkeleton } from "react-tailwind-skeleton";

const App = () => {
  return (
    <div>
      <TableSkeleton
        columns={3}
        rows={5}
        headerTitles={["Name", "Email", "Phone"]}
      />
      <Skeleton
        width="100px"
        height="100px"
        shape="circle"
        animate={true}
        borderRadius="50%"
      />
    </div>
  );
};

export default App;

TableSkeleton Props

The TableSkeleton component accepts the following props:

  • columns (number): Number of columns in the table.
  • rows (number): Number of rows in the table.
  • headerTitles (string[], optional): Array of strings for the header titles. If not provided or length doesn't match columns, headers won't be shown.

Skeleton Props

The Skeleton component accepts the following props:

  • width (string, optional): Width of the skeleton element. Defaults to 100%.
  • height (string, optional): Height of the skeleton element. Defaults to 100%.
  • shape ('rectangle' | 'circle', optional): Shape of the skeleton element. Defaults to rectangle.
  • animate (boolean, optional): Whether to animate the skeleton element. Defaults to true.
  • borderRadius (string, optional): Custom border radius for the skeleton element. If not provided, it uses Tailwind's default rounded class.

Example

Table with 3 columns and 5 rows with header titles:
<TableSkeleton columns={3} rows={5} headerTitles={["Name", "Email", "Phone"]} />
Table with 4 columns and 3 rows without header titles:
<TableSkeleton columns={4} rows={3} />
Rectangle skeleton element:
<Skeleton
  width="200px"
  height="100px"
  shape="rectangle"
  animate={true}
  borderRadius="10px"
/>

Development

Building the Package

To build the package, run:

npm run build

Running the Development Server

To start the development server, run:

npm run dev

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 01 Jul 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc