Getting Started with HubLab
Your complete guide to building with AI-powered React components
Welcome to HubLab! This guide will walk you through everything you need to know to start building amazing React applications using HubLab's 290+ components with AI assistants. Whether you're a beginner or an experienced developer, this tutorial will help you get up and running quickly.
By the end of this guide, you'll know how to browse components, use AI assistants to implement them, customize them for your needs, and deploy production-ready applications. Let's get started!
Time to Complete
Approximately 15-30 minutes
Prerequisites
Before you begin, make sure you have the following tools and accounts set up. Don't worry if you're missing something - we'll guide you through each requirement.
1. Node.js and npm
Node.js is the JavaScript runtime that powers React and Next.js. You'll need version 18.0 or higher installed on your computer.
Check if you have Node.js installed:
node --version npm --version
If you don't have Node.js installed, download it from nodejs.org
2. Next.js Project
HubLab components work best with Next.js 14 or higher. If you don't have a project yet, create one using the following command:
Create a new Next.js project:
npx create-next-app@latest my-hublab-project cd my-hublab-project
When prompted, select: Yes for TypeScript, Yes for ESLint, Yes for Tailwind CSS, No for src/ directory, Yes for App Router, and No for import alias customization.
3. Tailwind CSS
All HubLab components are styled with Tailwind CSS. If you created your project with create-next-app and selected Tailwind CSS, you're all set! Otherwise, follow the Tailwind installation guide for Next.js.
Verify Tailwind is installed:
# Check if tailwind.config.js exists ls tailwind.config.js
4. AI Assistant Account
Choose at least one AI assistant to work with. Each has its own strengths:
- Grok:Best for creative customizations and rapid prototyping (requires X Premium+)
- Claude:Ideal for production code with best practices (free and paid tiers available)
- ChatGPT:Great for learning and detailed explanations (free and paid tiers available)
- Copilot:Perfect for IDE integration and inline suggestions (subscription required)
Step-by-Step Tutorial
Explore the Component Library
Start by exploring HubLab's component library to find the components you need. You can browse by category or use the search function to find specific components.
Component Categories:
Buttons, forms, navigation, modals, cards, alerts, and more
Product cards, shopping carts, checkout flows, filters
Charts, data tables, stats cards, analytics widgets
Hero sections, CTAs, testimonials, pricing tables
Choose Your AI Assistant
Select the AI assistant you want to work with. Each assistant has unique strengths, so choose based on your needs and preferences.
Grok
X's creative AI assistant, perfect for rapid prototyping and unique customizations
Best For:
- •Creative component variations and unique designs
- •Rapid prototyping and quick iterations
- •Real-time information and current trends
Implement Your First Component
Now it's time to implement your first HubLab component! Let's start with a simple example: adding a primary button to your application. Follow the AI-specific instructions below.
Using Grok
1. Access Grok on X
Go to X (formerly Twitter) and click on the Grok button. Make sure you have X Premium+.
2. Describe What You Want
Example Prompt:
"Create a primary button component in React with TypeScript using Tailwind CSS. The button should have hover effects, support different sizes (small, medium, large), and include loading and disabled states. Style it with a green background that matches the terminal-green color (#00ff00)."
Grok will generate a complete button component with creative enhancements.
3. Copy and Paste the Code
Copy the generated code and create a new file in your project at components/Button.tsx
4. Import and Use
import Button from '@/components/Button';
export default function Page() {
return (
<Button size="medium" onClick={() => alert('Clicked!')}>
Click Me
</Button>
);
}Customize Components
All HubLab components are built with Tailwind CSS, making customization straightforward. You can easily modify colors, spacing, typography, and behavior to match your brand.
Customization Approaches
1. Modify Tailwind Classes
The simplest way to customize is to change the Tailwind classes in the component.
// Change background from green to blue className="bg-blue-600 hover:bg-blue-700" // Adjust padding and border radius className="px-8 py-4 rounded-xl"
2. Use Component Props
Many components accept className props for easy customization without editing the source.
<Button className="bg-purple-600 text-lg shadow-xl" size="lg" > Custom Button </Button>
3. Extend with CSS Variables
For theme-wide changes, use CSS variables in your global stylesheet.
:root {
--color-primary: #00ff00;
--color-secondary: #0000ff;
--border-radius: 0.5rem;
}Build More Complex Features
Once you're comfortable with basic components, it's time to combine multiple components to build complete features and pages.
Example: Building a Product Page
Ask your AI assistant to help you combine multiple components:
Prompt Example:
"Using HubLab components, create a product detail page with: a navigation bar, product image gallery, product title and description, price display, add to cart button, reviews section, and related products grid. Use TypeScript and make it mobile-responsive."
Your AI assistant will combine multiple components into a cohesive page layout.
E-commerce Features
- • Product listings with filters
- • Shopping cart functionality
- • Checkout flow with payment
- • Order tracking dashboard
Dashboard Features
- • Analytics charts and graphs
- • Data tables with filtering
- • User management interface
- • Settings and configuration
Common Workflows
Building a Landing Page
- 1.Start with a Hero component for your main message
- 2.Add a Features section to showcase benefits
- 3.Include Testimonials for social proof
- 4.Add a Pricing Table to display plans
- 5.End with a CTA Section and Contact Form
Creating an Admin Dashboard
- 1.Implement a Sidebar Navigation for main menu
- 2.Add Stats Cards to display key metrics
- 3.Include Charts for data visualization
- 4.Add Data Tables for managing records
- 5.Include Activity Feed for recent events
Building an Online Store
- 1.Create a Product Grid to display items
- 2.Add Product Filters for easy searching
- 3.Implement Shopping Cart with item management
- 4.Build Checkout Flow with forms and validation
- 5.Add Order Confirmation and tracking pages
Troubleshooting Common Issues
Issue: Tailwind Classes Not Working
Symptoms: Components appear unstyled or missing CSS.
Solution: Make sure Tailwind CSS is properly configured:
// Check tailwind.config.js includes your component paths
module.exports = {
content: [
'./app/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
],
// ...
}Issue: TypeScript Errors
Symptoms: Red squiggly lines, type errors, "cannot find module" errors.
Solution: Make sure all imports are correct and types are defined:
// Install missing type definitions npm install --save-dev @types/react @types/node // Restart your TypeScript server in VS Code // Cmd+Shift+P > "TypeScript: Restart TS Server"
Issue: Component Not Rendering
Symptoms: Component doesn't appear on the page, no errors.
Solution: Check for common mistakes:
- •Ensure you're using 'use client' directive for client components
- •Check that component is properly exported (export default)
- •Verify import path is correct
- •Look for JavaScript errors in browser console
Issue: AI Assistant Misunderstands Requirements
Symptoms: Generated code doesn't match what you wanted.
Solution: Improve your prompts:
- •Be more specific about requirements
- •Mention "HubLab components" explicitly
- •Provide examples of what you want
- •Ask the AI to clarify if it's unsure
Next Steps
Explore Components
Browse all 290+ components to see what's available and get inspired for your next project.
View Components →Read Documentation
Dive deeper into the API, learn about advanced features, and discover best practices.
Read Docs →Join Community
Connect with other HubLab users, share your projects, and get help when you need it.
Join Now →You're Ready to Build!
Congratulations! You now know how to use HubLab components with AI assistants. Start building amazing applications with 290+ production-ready components.