A modern web application for browsing and managing AI models β built with React 19, Vite, Tailwind CSS, and DaisyUI.
| Technology | Version | Purpose |
|---|---|---|
| React | ^19.2.5 | UI library |
| Vite | ^8.0.10 | Build tool & dev server |
| Tailwind CSS | ^4.2.4 | Utility-first styling |
| DaisyUI | ^5.5.19 | Component library |
| React Toastify | ^11.1.0 | Toast notifications |
| @vitejs/plugin-react | ^6.0.1 | React fast refresh via Babel/Oxc |
- π Models Tab β Browse available AI models with card-based layout
- π Cart Tab β Add models to cart and manage selections, with live count badge
- β‘ Suspense-based Lazy Loading β Models load asynchronously with a spinner fallback
- π¨ Gradient Tab UI β Active tab highlights with custom gradients (red-orange for Models, indigo-purple for Cart)
- π Toast Notifications β User-friendly feedback using React Toastify
- π DaisyUI Light Theme β Clean, accessible UI out of the box
The tab switcher uses DaisyUI's tabs-box with radio inputs. Instead of relying on DaisyUI's default checked styling (which doesn't support gradients), each tab uses inline style props to conditionally apply gradient backgrounds based on the active tab state β making it fully controlled by React.
style={{
background: activeTab === "Models"
? "linear-gradient(135deg, #ff416c, #ff4b2b)"
: "transparent",
color: activeTab === "Models" ? "white" : "inherit",
}}- Models tab β Red-to-orange gradient (
#ff416c β #ff4b2b) - Cart tab β Indigo-to-purple gradient (
#6366f1 β #8b5cf6)
Models are fetched asynchronously and passed as a Promise to the <Models /> component. React's <Suspense> wraps the tab content and shows a DaisyUI spinner while the data resolves β no manual loading state needed.
<Suspense
fallback={
<div className="flex items-center justify-center h-64">
<span className="loading loading-spinner loading-lg"></span>
</div>
}
>
{activeTab === "Models" && <Models modelPromise={modelPromise} />}
{activeTab === "Cart" && <Cart />}
</Suspense>The Cart tab label dynamically shows the number of items currently in the cart, updating in real time as models are added or removed.
aria-label={`Cart (${modelCards.length})`}React Toastify is used for non-intrusive feedback messages β triggered when a user adds or removes a model from the cart, keeping the UI clean without any modal interruption.
Built mobile-first using Tailwind CSS utility classes. The card grid adapts gracefully across screen sizes, and the tab bar stays centered on all viewports.
ai-model-hub/
βββ public/
β βββ favicon.svg
βββ src/
β βββ main.jsx # App entry point
β βββ App.jsx # Root component with tab logic & Suspense
β βββ components/
β β βββ Models.jsx # AI model card listing
β β βββ Cart.jsx # Cart view
β βββ index.css # Global styles
βββ index.html
βββ vite.config.js
βββ eslint.config.js
βββ package.json
- Node.js >= 18
- npm or yarn
# Clone the repository
git clone https://github.com/Morshedul-developer/ai-model-hub.git
# Navigate into the project
cd ai-model-hub
# Install dependencies
npm installThis project is private and not licensed for public distribution.
Morshedul Khaer β Frontend Developer focused on building clean, responsive, and modern web experiences.
- π Portfolio: morshedul-khaer.netlify.app
- π» GitHub: @Morshedul-developer
- π§ Email: nijhumkhandoker9@gmail.com