custom-headless-spinner
v0.0.1
Published
React tailwind spinner
Downloads
76
Readme
Checkbox Component
Description
The Spinner
component is a customizable tailwind spinner.
Installation
To use the Spinner
component in your project, you can install it via npm (or include it as part of your component library):
npm install custom-headless-spinner
Usage
Here’s a simple example of how to use the Spinner
component in your application:
import React, { useState } from "react";
import { Spinner } from "custom-headless-spinner";
const App = () => {
return (
<div>
<Spinner />
</div>
);
};
export default App;
Props
Spinner Props
This Spinner component does not currently accept any props. It is designed to be a flexible, standalone loading indicator.
Styles
The Spinner
component is styled using Tailwind CSS classes. Make sure to include Tailwind CSS in your project to apply the styles correctly.
Example CSS Setup
If you haven’t set up Tailwind CSS yet, here’s a basic example of how to do it:
- Install Tailwind CSS:
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
- Configure your tailwind.config.js file:
module.exports = {
content: ["./src/**/*.{js,jsx,ts,tsx}", "./public/index.html"],
theme: {
extend: {},
},
plugins: [],
};
- Include Tailwind in your CSS file: Add the following lines to your main CSS file to include Tailwind’s base, components, and utilities:
@tailwind base;
@tailwind components;
@tailwind utilities;
Customization
Feel free to customize the Tailwind classes used in the Spinner
component as needed to fit the design of your application.