@metadiv-studio/loader
A lightweight, customizable loading spinner component built with React and Tailwind CSS. This package provides a simple yet flexible loader that can be easily integrated into any React application.
Installation
npm install @metadiv-studio/loader
Tailwind CSS Configuration
Important: Before using this package, you must add the following path to your tailwind.config.ts file to ensure all styles are properly loaded:
module.exports = {
content: [
"./node_modules/@metadiv-studio/**/*.{js,ts,jsx,tsx}"
],
}
Usage
import { Loader } from '@metadiv-studio/loader';
function App() {
return (
<div className="relative">
<Loader size="md" color="strong" />
</div>
);
}
Props
size (optional)
Controls the dimensions of the loader spinner.
- Type:
"sm" | "md" | "lg"
- Default:
"sm"
- Values:
"sm": 16x16 pixels (w-4 h-4)
"md": 24x24 pixels (w-6 h-6)
"lg": 32x32 pixels (w-8 h-8)
Example:
<Loader size="sm" />
<Loader size="md" />
<Loader size="lg" />
color (optional)
Defines the color intensity of the spinner.
- Type:
"light" | "strong"
- Default:
"light"
- Values:
"light": Uses text-txtc-lv1 (subtle, less prominent)
"strong": Uses text-txtc-lv3 (more visible, higher contrast)
Example:
<Loader color="light" />
<Loader color="strong" />