phat-library
v0.1.4
Published
A customizable and reusable React component library built with **Vite**, **TailwindCSS**, and **shadcn/ui**.
Readme
🧩 My UI Lib
A customizable and reusable React component library built with Vite, TailwindCSS, and shadcn/ui.
✨ Features
- 💅 Built with TailwindCSS
- 🧱 Powered by shadcn/ui
- ⚡ Fast build with Vite
- 💡 Tree-shakable and type-safe
- 📦 Easy to consume in React apps
📦 Installation
npm install phat-library
# or
yarn add phat-libraryUsage
import { useState } from "react";
import { Button } from "my-ui-lib"; // Replace with actual path
import GATooltip from "my-ui-lib/Tooltip"; // Replace with actual path
const App = () => {
const [controlledTooltipOpen, setControlledTooltipOpen] = useState(false);
const [hoverTooltipOpen, setHoverTooltipOpen] = useState(false);
const handleTooltipContentClick = () => {
setControlledTooltipOpen(!controlledTooltipOpen);
};
const handleHoverTooltip = () => {
setHoverTooltipOpen(!hoverTooltipOpen);
};
return (
<div className="flex gap-4 p-4 justify-center items-center min-h-screen">
<GATooltip
content="Simple test tooltip"
sideTooltipContent="top"
alignTooltipContent="center"
delayDuration={100}
open={hoverTooltipOpen}
onOpenChange={handleHoverTooltip}
>
<Button variant="destructive">Hover Tooltip</Button>
</GATooltip>
<GATooltip
open={controlledTooltipOpen}
sideTooltipContent="bottom"
alignTooltipContent="start"
delayDuration={200}
>
<Button onClick={handleTooltipContentClick}>Clicked Tooltip</Button>
</GATooltip>
<GATooltip
content="Tooltip positioned on the left side"
sideTooltipContent="left"
alignTooltipContent="end"
delayDuration={400}
>
<Button variant="outline">Tooltip</Button>
</GATooltip>
</div>
);
};
export default App;